mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-02 09:11:49 +00:00
feat: add ipak and iwd zone definition metadata to replace type
This commit is contained in:
@ -1,5 +1,13 @@
|
||||
#include "ZoneDefinition.h"
|
||||
|
||||
ZoneDefinitionObjContainer::ZoneDefinitionObjContainer(std::string name, const ZoneDefinitionObjContainerType type, const unsigned start)
|
||||
: m_name(std::move(name)),
|
||||
m_type(type),
|
||||
m_asset_start(start),
|
||||
m_asset_end(0u)
|
||||
{
|
||||
}
|
||||
|
||||
ZoneDefinitionAsset::ZoneDefinitionAsset(const asset_type_t type, std::string name, const bool isReference)
|
||||
: m_asset_type(type),
|
||||
m_asset_name(std::move(name)),
|
||||
@ -21,8 +29,7 @@ void ZoneDefinitionProperties::Include(const ZoneDefinitionProperties& otherProp
|
||||
}
|
||||
|
||||
ZoneDefinition::ZoneDefinition()
|
||||
: m_type(ProjectType::NONE),
|
||||
m_game(GameId::COUNT)
|
||||
: m_game(GameId::COUNT)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -4,25 +4,35 @@
|
||||
#include "Zone/AssetList/AssetList.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
enum class ProjectType
|
||||
enum class ZoneDefinitionObjContainerType : uint8_t
|
||||
{
|
||||
NONE,
|
||||
FASTFILE,
|
||||
IPAK,
|
||||
|
||||
COUNT
|
||||
IWD,
|
||||
IPAK
|
||||
};
|
||||
|
||||
static constexpr const char* ProjectType_Names[]{
|
||||
"none",
|
||||
"fastfile",
|
||||
"ipak",
|
||||
class ZoneDefinitionObjContainer
|
||||
{
|
||||
public:
|
||||
std::string m_name;
|
||||
ZoneDefinitionObjContainerType m_type;
|
||||
|
||||
/**
|
||||
* \brief The first asset (inclusive) to include in the obj container.
|
||||
*/
|
||||
unsigned m_asset_start;
|
||||
|
||||
/**
|
||||
* \brief The last asset (exclusive) to include in the obj container.
|
||||
*/
|
||||
unsigned m_asset_end;
|
||||
|
||||
ZoneDefinitionObjContainer(std::string name, ZoneDefinitionObjContainerType type, unsigned start);
|
||||
};
|
||||
static_assert(std::extent_v<decltype(ProjectType_Names)> == static_cast<unsigned>(ProjectType::COUNT));
|
||||
|
||||
class ZoneDefinitionAsset
|
||||
{
|
||||
@ -54,7 +64,6 @@ public:
|
||||
void Include(const ZoneDefinition& definitionToInclude);
|
||||
|
||||
std::string m_name;
|
||||
ProjectType m_type;
|
||||
GameId m_game;
|
||||
ZoneDefinitionProperties m_properties;
|
||||
std::vector<std::string> m_includes;
|
||||
@ -63,4 +72,5 @@ public:
|
||||
std::vector<std::string> m_targets_to_build;
|
||||
std::vector<std::string> m_gdts;
|
||||
std::vector<ZoneDefinitionAsset> m_assets;
|
||||
std::vector<ZoneDefinitionObjContainer> m_obj_containers;
|
||||
};
|
||||
|
Reference in New Issue
Block a user