mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-02-10 17:43:03 +00:00
Merge pull request #672 from Laupetin/refactor/game-asset-type-names
refactor: game asset type names
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "GameLanguage.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
@@ -64,5 +66,8 @@ public:
|
||||
[[nodiscard]] virtual const std::string& GetShortName() const = 0;
|
||||
[[nodiscard]] virtual const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const = 0;
|
||||
|
||||
[[nodiscard]] virtual asset_type_t GetAssetTypeCount() const = 0;
|
||||
[[nodiscard]] virtual std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const = 0;
|
||||
|
||||
static IGame* GetGameById(GameId gameId);
|
||||
};
|
||||
|
||||
@@ -1,28 +1,56 @@
|
||||
#include "GameIW3.h"
|
||||
|
||||
#include "IW3.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::IW3;
|
||||
}
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
|
||||
"clipmap_unused", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
namespace IW3
|
||||
{
|
||||
static std::string fullName = "Call Of Duty 4: Modern Warfare";
|
||||
return fullName;
|
||||
}
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::IW3;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW3";
|
||||
return shortName;
|
||||
}
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty 4: Modern Warfare";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW3";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
asset_type_t Game::GetAssetTypeCount() const
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
} // namespace IW3
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/IGame.h"
|
||||
|
||||
namespace IW3
|
||||
@@ -10,5 +11,8 @@ namespace IW3
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW3
|
||||
|
||||
@@ -1,28 +1,61 @@
|
||||
#include "GameIW4.h"
|
||||
|
||||
#include "IW4.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::IW4;
|
||||
}
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel",
|
||||
"material", "pixelshader", "vertexshader", "vertexdecl", "techniqueset",
|
||||
"image", "sound", "soundcurve", "loadedsound", "clipmap_unused",
|
||||
"clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents",
|
||||
"fxworld", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals",
|
||||
"fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
|
||||
"tracer", "vehicle", "addonmapents",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
namespace IW4
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Modern Warfare 2";
|
||||
return fullName;
|
||||
}
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::IW4;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW4";
|
||||
return shortName;
|
||||
}
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Modern Warfare 2";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW4";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
asset_type_t Game::GetAssetTypeCount() const
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
} // namespace IW4
|
||||
|
||||
@@ -10,5 +10,8 @@ namespace IW4
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW4
|
||||
|
||||
@@ -1,28 +1,98 @@
|
||||
#include "GameIW5.h"
|
||||
|
||||
#include "IW5.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::IW5;
|
||||
}
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"physpreset",
|
||||
"physcollmap",
|
||||
"xanim",
|
||||
"xmodelsurfs",
|
||||
"xmodel",
|
||||
"material",
|
||||
"pixelshader",
|
||||
"vertexshader",
|
||||
"vertexdecl",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"glassworld",
|
||||
"pathdata",
|
||||
"vehicletrack",
|
||||
"mapents",
|
||||
"fxworld",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"attachment",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"surfacefx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"scriptfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"structureddatadef",
|
||||
"tracer",
|
||||
"vehicle",
|
||||
"addonmapents",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
namespace IW5
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Modern Warfare 3";
|
||||
return fullName;
|
||||
}
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::IW5;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW5";
|
||||
return shortName;
|
||||
}
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Modern Warfare 3";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW5";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
asset_type_t Game::GetAssetTypeCount() const
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
} // namespace IW5
|
||||
|
||||
@@ -10,5 +10,8 @@ namespace IW5
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW5
|
||||
|
||||
@@ -1,43 +1,74 @@
|
||||
#include "GameT5.h"
|
||||
|
||||
#include "T5.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace T5;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::T5;
|
||||
}
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Black Ops";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "T5";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
{GameLanguage::LANGUAGE_ENGLISH, "en_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH, "fr_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH_CAN, "fc_"},
|
||||
{GameLanguage::LANGUAGE_GERMAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_AUSTRIAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_ITALIAN, "it_"},
|
||||
{GameLanguage::LANGUAGE_SPANISH, "sp_"},
|
||||
{GameLanguage::LANGUAGE_BRITISH, "br_"},
|
||||
{GameLanguage::LANGUAGE_RUSSIAN, "ru_"},
|
||||
{GameLanguage::LANGUAGE_POLISH, "po_"},
|
||||
{GameLanguage::LANGUAGE_KOREAN, "ko_"},
|
||||
{GameLanguage::LANGUAGE_JAPANESE, "ja_"},
|
||||
{GameLanguage::LANGUAGE_CZECH, "cz_"},
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"xmodelpieces", "physpreset", "physconstraints", "destructibledef", "xanim", "xmodel", "material",
|
||||
"techniqueset", "image", "soundbank", "soundpatch", "clipmap_unused", "clipmap", "comworld",
|
||||
"gameworldsp", "gameworldmp", "mapents", "gfxworld", "gfxlightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "weapondef", "weaponvariant", "snddriverglobals",
|
||||
"fx", "fximpacttable", "aitype", "mptype", "mpbody", "mphead", "character",
|
||||
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
|
||||
"emblemset",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
namespace T5
|
||||
{
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::T5;
|
||||
}
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Black Ops";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "T5";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
{GameLanguage::LANGUAGE_ENGLISH, "en_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH, "fr_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH_CAN, "fc_"},
|
||||
{GameLanguage::LANGUAGE_GERMAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_AUSTRIAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_ITALIAN, "it_"},
|
||||
{GameLanguage::LANGUAGE_SPANISH, "sp_"},
|
||||
{GameLanguage::LANGUAGE_BRITISH, "br_"},
|
||||
{GameLanguage::LANGUAGE_RUSSIAN, "ru_"},
|
||||
{GameLanguage::LANGUAGE_POLISH, "po_"},
|
||||
{GameLanguage::LANGUAGE_KOREAN, "ko_"},
|
||||
{GameLanguage::LANGUAGE_JAPANESE, "ja_"},
|
||||
{GameLanguage::LANGUAGE_CZECH, "cz_"},
|
||||
};
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
asset_type_t Game::GetAssetTypeCount() const
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
} // namespace T5
|
||||
|
||||
@@ -10,5 +10,8 @@ namespace T5
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace T5
|
||||
|
||||
@@ -1,46 +1,130 @@
|
||||
#include "GameT6.h"
|
||||
|
||||
#include "T6.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::T6;
|
||||
}
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Black Ops II";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "T6";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
{GameLanguage::LANGUAGE_ENGLISH, "en_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH, "fr_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH_CAN, "fc_"},
|
||||
{GameLanguage::LANGUAGE_GERMAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_AUSTRIAN, "as_"},
|
||||
{GameLanguage::LANGUAGE_ITALIAN, "it_"},
|
||||
{GameLanguage::LANGUAGE_SPANISH, "sp_"},
|
||||
{GameLanguage::LANGUAGE_BRITISH, "br_"},
|
||||
{GameLanguage::LANGUAGE_RUSSIAN, "ru_"},
|
||||
{GameLanguage::LANGUAGE_POLISH, "po_"},
|
||||
{GameLanguage::LANGUAGE_KOREAN, "ko_"},
|
||||
{GameLanguage::LANGUAGE_JAPANESE, "ja_"},
|
||||
{GameLanguage::LANGUAGE_CZECH, "cz_"},
|
||||
{GameLanguage::LANGUAGE_FULL_JAPANESE, "fj_"},
|
||||
{GameLanguage::LANGUAGE_PORTUGUESE, "bp_"},
|
||||
{GameLanguage::LANGUAGE_MEXICAN_SPANISH, "ms_"},
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"xmodelpieces",
|
||||
"physpreset",
|
||||
"physconstraints",
|
||||
"destructibledef",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"soundbank",
|
||||
"soundpatch",
|
||||
"clipmap_unused",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"gfxlightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"fonticon",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"weapondef",
|
||||
"weaponvariant",
|
||||
"weaponfull",
|
||||
"attachment",
|
||||
"attachmentunique",
|
||||
"camo",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"fximpacttable",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"mpbody",
|
||||
"mphead",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"xglobals",
|
||||
"ddl",
|
||||
"glasses",
|
||||
"emblemset",
|
||||
"script",
|
||||
"keyvaluepairs",
|
||||
"vehicle",
|
||||
"memoryblock",
|
||||
"addonmapents",
|
||||
"tracer",
|
||||
"skinnedverts",
|
||||
"qdb",
|
||||
"slug",
|
||||
"footsteptable",
|
||||
"footstepfxtable",
|
||||
"zbarrier",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
namespace T6
|
||||
{
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::T6;
|
||||
}
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty: Black Ops II";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "T6";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
{GameLanguage::LANGUAGE_ENGLISH, "en_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH, "fr_"},
|
||||
{GameLanguage::LANGUAGE_FRENCH_CAN, "fc_"},
|
||||
{GameLanguage::LANGUAGE_GERMAN, "ge_"},
|
||||
{GameLanguage::LANGUAGE_AUSTRIAN, "as_"},
|
||||
{GameLanguage::LANGUAGE_ITALIAN, "it_"},
|
||||
{GameLanguage::LANGUAGE_SPANISH, "sp_"},
|
||||
{GameLanguage::LANGUAGE_BRITISH, "br_"},
|
||||
{GameLanguage::LANGUAGE_RUSSIAN, "ru_"},
|
||||
{GameLanguage::LANGUAGE_POLISH, "po_"},
|
||||
{GameLanguage::LANGUAGE_KOREAN, "ko_"},
|
||||
{GameLanguage::LANGUAGE_JAPANESE, "ja_"},
|
||||
{GameLanguage::LANGUAGE_CZECH, "cz_"},
|
||||
{GameLanguage::LANGUAGE_FULL_JAPANESE, "fj_"},
|
||||
{GameLanguage::LANGUAGE_PORTUGUESE, "bp_"},
|
||||
{GameLanguage::LANGUAGE_MEXICAN_SPANISH, "ms_"},
|
||||
};
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
asset_type_t Game::GetAssetTypeCount() const
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
} // namespace T6
|
||||
|
||||
@@ -10,5 +10,8 @@ namespace T6
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace T6
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
|
||||
IgnoredAssetLookup::IgnoredAssetLookup() = default;
|
||||
|
||||
@@ -89,7 +88,7 @@ XAssetInfoGeneric* AssetCreationContext::AddAssetGeneric(GenericAssetRegistratio
|
||||
addedAsset = m_zone.m_pools->AddAsset(std::move(xAssetInfo));
|
||||
|
||||
if (addedAsset == nullptr)
|
||||
con::error("Failed to add asset of type \"{}\" to pool: \"{}\"", *m_zone.m_pools->GetAssetTypeName(assetType), pAssetName);
|
||||
con::error(R"(Failed to add asset of type "{}" to pool: "{}")", *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType), pAssetName);
|
||||
return addedAsset;
|
||||
}
|
||||
|
||||
@@ -99,7 +98,7 @@ XAssetInfoGeneric* AssetCreationContext::LoadDefaultAssetDependency(const asset_
|
||||
if (result.HasTakenAction() && !result.HasFailed())
|
||||
return result.GetAssetInfo();
|
||||
|
||||
con::error("Failed to create default asset of type {}", *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::error("Failed to create default asset of type {}", *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -129,11 +128,11 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_
|
||||
if (!result.HasFailed())
|
||||
return result.GetAssetInfo();
|
||||
|
||||
con::error("Could not load asset \"{}\" of type \"{}\"", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::error(R"(Could not load asset "{}" of type "{}")", assetName, *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
}
|
||||
else if (required)
|
||||
{
|
||||
con::error("Missing asset \"{}\" of type \"{}\"", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::error(R"(Missing asset "{}" of type "{}")", assetName, *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -151,7 +150,8 @@ IndirectAssetReference AssetCreationContext::LoadIndirectAssetReferenceGeneric(c
|
||||
const auto result = m_creators->CreateAsset(assetType, assetName, *this);
|
||||
if (!result.HasTakenAction() && !result.HasFailed())
|
||||
{
|
||||
con::warn("Could not load indirectly referenced asset \"{}\" of type \"{}\"", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::warn(
|
||||
R"(Could not load indirectly referenced asset "{}" of type "{}")", assetName, *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
}
|
||||
return IndirectAssetReference(assetType, assetName);
|
||||
}
|
||||
@@ -187,11 +187,11 @@ XAssetInfoGeneric* AssetCreationContext::ForceLoadDependencyGeneric(const asset_
|
||||
if (!result.HasFailed())
|
||||
return result.GetAssetInfo();
|
||||
|
||||
con::error("Could not load asset \"{}\" of type \"{}\"", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::error(R"(Could not load asset "{}" of type "{}")", assetName, *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
}
|
||||
else
|
||||
{
|
||||
con::error("Missing asset \"{}\" of type \"{}\"", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
con::error(R"(Missing asset "{}" of type "{}")", assetName, *IGame::GetGameById(m_zone.m_game_id)->GetAssetTypeName(assetType));
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
class AssetCreatorCollection;
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
|
||||
AssetCreatorCollection::AssetCreatorCollection(const Zone& zone)
|
||||
{
|
||||
m_asset_creators_by_type.resize(zone.m_pools->GetAssetTypeCount());
|
||||
m_asset_post_processors_by_type.resize(zone.m_pools->GetAssetTypeCount());
|
||||
m_default_asset_creators_by_type.resize(zone.m_pools->GetAssetTypeCount());
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
m_asset_creators_by_type.resize(game->GetAssetTypeCount());
|
||||
m_asset_post_processors_by_type.resize(game->GetAssetTypeCount());
|
||||
m_default_asset_creators_by_type.resize(game->GetAssetTypeCount());
|
||||
}
|
||||
|
||||
void AssetCreatorCollection::AddAssetCreator(std::unique_ptr<IAssetCreator> creator)
|
||||
|
||||
@@ -18,7 +18,7 @@ void ContentPrinter::PrintContent() const
|
||||
con::info("Content:");
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
con::info("{}, {}", *pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
con::info("{}, {}", *game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
|
||||
con::info("");
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include "SearchPath/OutputPathFilesystem.h"
|
||||
#include "UnlinkerArgs.h"
|
||||
#include "UnlinkerPaths.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Utils/ObjFileStream.h"
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
#include "Zone/Definition/ZoneDefWriter.h"
|
||||
#include "ZoneLoading.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <fstream>
|
||||
#include <regex>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
@@ -27,7 +26,7 @@ namespace
|
||||
class UnlinkerImpl : public Unlinker
|
||||
{
|
||||
public:
|
||||
UnlinkerImpl(UnlinkerArgs args)
|
||||
explicit UnlinkerImpl(UnlinkerArgs args)
|
||||
: m_args(std::move(args))
|
||||
{
|
||||
}
|
||||
@@ -96,34 +95,27 @@ namespace
|
||||
|
||||
void UpdateAssetIncludesAndExcludes(const AssetDumpingContext& context) const
|
||||
{
|
||||
const auto assetTypeCount = context.m_zone.m_pools->GetAssetTypeCount();
|
||||
const auto gameId = context.m_zone.m_game_id;
|
||||
const auto* game = IGame::GetGameById(gameId);
|
||||
const auto assetTypeCount = game->GetAssetTypeCount();
|
||||
|
||||
ObjWriting::Configuration.AssetTypesToHandleBitfield = std::vector<bool>(assetTypeCount);
|
||||
const auto initialValue = m_args.m_asset_type_handling == UnlinkerArgs::AssetTypeHandling::EXCLUDE;
|
||||
ObjWriting::Configuration.AssetTypesToHandleBitfield = std::vector(assetTypeCount, initialValue);
|
||||
|
||||
std::vector<bool> handledSpecifiedAssets(m_args.m_specified_asset_types.size());
|
||||
for (auto i = 0u; i < assetTypeCount; i++)
|
||||
{
|
||||
const auto assetTypeName = std::string(*context.m_zone.m_pools->GetAssetTypeName(i));
|
||||
|
||||
const auto foundSpecifiedEntry = m_args.m_specified_asset_type_map.find(assetTypeName);
|
||||
if (foundSpecifiedEntry != m_args.m_specified_asset_type_map.end())
|
||||
{
|
||||
ObjWriting::Configuration.AssetTypesToHandleBitfield[i] = m_args.m_asset_type_handling == UnlinkerArgs::AssetTypeHandling::INCLUDE;
|
||||
assert(foundSpecifiedEntry->second < handledSpecifiedAssets.size());
|
||||
handledSpecifiedAssets[foundSpecifiedEntry->second] = true;
|
||||
}
|
||||
else
|
||||
ObjWriting::Configuration.AssetTypesToHandleBitfield[i] = m_args.m_asset_type_handling == UnlinkerArgs::AssetTypeHandling::EXCLUDE;
|
||||
}
|
||||
|
||||
const AssetNameResolver assetNameResolver(gameId);
|
||||
auto anySpecifiedValueInvalid = false;
|
||||
for (auto i = 0u; i < handledSpecifiedAssets.size(); i++)
|
||||
for (const auto& specifiedValue : m_args.m_specified_asset_types)
|
||||
{
|
||||
if (!handledSpecifiedAssets[i])
|
||||
const auto maybeAssetType = assetNameResolver.GetAssetTypeByName(specifiedValue);
|
||||
if (!maybeAssetType)
|
||||
{
|
||||
con::error("Unknown asset type \"{}\"", m_args.m_specified_asset_types[i]);
|
||||
con::error("Unknown asset type \"{}\"", specifiedValue);
|
||||
anySpecifiedValueInvalid = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
ObjWriting::Configuration.AssetTypesToHandleBitfield[*maybeAssetType] = !initialValue;
|
||||
}
|
||||
|
||||
if (anySpecifiedValueInvalid)
|
||||
@@ -134,7 +126,7 @@ namespace
|
||||
std::ostringstream ss;
|
||||
for (auto i = 0u; i < assetTypeCount; i++)
|
||||
{
|
||||
const auto assetTypeName = std::string(*context.m_zone.m_pools->GetAssetTypeName(i));
|
||||
const auto assetTypeName = std::string(*game->GetAssetTypeName(i));
|
||||
|
||||
if (first)
|
||||
first = false;
|
||||
|
||||
@@ -35,7 +35,7 @@ set condition material FxElemDef::elemType == FX_ELEM_TYPE_SPRITE_BILLBOARD
|
||||
use FxEffectDefRef;
|
||||
set condition handle never;
|
||||
set string name;
|
||||
set assetref name ASSET_TYPE_FX;
|
||||
set assetref name AssetFx;
|
||||
|
||||
// FxTrailDef
|
||||
use FxTrailDef;
|
||||
|
||||
@@ -7,7 +7,7 @@ set string szInternalName;
|
||||
set string szDisplayName;
|
||||
set string szOverlayName;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set string szModeName;
|
||||
set scriptstring hideTags;
|
||||
set scriptstring notetrackSoundMapKeys;
|
||||
|
||||
@@ -37,7 +37,7 @@ set condition material FxElemDef::elemType == FX_ELEM_TYPE_SPRITE_BILLBOARD
|
||||
use FxEffectDefRef;
|
||||
set condition handle never;
|
||||
set string name;
|
||||
set assetref name ASSET_TYPE_FX;
|
||||
set assetref name AssetFx;
|
||||
|
||||
// FxElemExtendedDefPtr
|
||||
use FxElemExtendedDefPtr;
|
||||
|
||||
@@ -10,7 +10,7 @@ set reusable hideTags;
|
||||
set scriptstring hideTags;
|
||||
set count hideTags 32;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set reusable szXAnims;
|
||||
set count szXAnims 37;
|
||||
set string szAltWeaponName;
|
||||
@@ -26,11 +26,11 @@ set reusable gunXModel;
|
||||
set count gunXModel 16;
|
||||
set reusable szXAnimsRightHanded;
|
||||
set string szXAnimsRightHanded;
|
||||
set assetref szXAnimsRightHanded ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnimsRightHanded AssetXAnim;
|
||||
set count szXAnimsRightHanded 37;
|
||||
set reusable szXAnimsLeftHanded;
|
||||
set string szXAnimsLeftHanded;
|
||||
set assetref szXAnimsLeftHanded ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnimsLeftHanded AssetXAnim;
|
||||
set count szXAnimsLeftHanded 37;
|
||||
set string szModeName;
|
||||
set reusable notetrackSoundMapKeys;
|
||||
|
||||
@@ -38,7 +38,7 @@ set condition material FxElemDef::elemType == FX_ELEM_TYPE_SPRITE_BILLBOARD
|
||||
use FxEffectDefRef;
|
||||
set condition handle never;
|
||||
set string name;
|
||||
set assetref name ASSET_TYPE_FX;
|
||||
set assetref name AssetFx;
|
||||
|
||||
// FxElemExtendedDefPtr
|
||||
use FxElemExtendedDefPtr;
|
||||
|
||||
@@ -16,7 +16,7 @@ set count underBarrels 3;
|
||||
set reusable others;
|
||||
set count others 4;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set reusable szXAnims;
|
||||
set count szXAnims WEAP_ANIM_COUNT;
|
||||
set reusable animOverrides;
|
||||
@@ -39,8 +39,8 @@ set count aiVsPlayerAccuracyGraphKnots aiVsPlayerAccuracyGraphKnotCount;
|
||||
use AnimOverrideEntry;
|
||||
set string overrideAnim;
|
||||
set string altmodeAnim;
|
||||
set assetref overrideAnim ASSET_TYPE_XANIMPARTS;
|
||||
set assetref altmodeAnim ASSET_TYPE_XANIMPARTS;
|
||||
set assetref overrideAnim AssetXAnim;
|
||||
set assetref altmodeAnim AssetXAnim;
|
||||
|
||||
// NoteTrackToSoundEntry
|
||||
use NoteTrackToSoundEntry;
|
||||
@@ -58,11 +58,11 @@ set reusable gunXModel;
|
||||
set count gunXModel 16;
|
||||
set reusable szXAnimsRightHanded;
|
||||
set string szXAnimsRightHanded;
|
||||
set assetref szXAnimsRightHanded ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnimsRightHanded AssetXAnim;
|
||||
set count szXAnimsRightHanded WEAP_ANIM_COUNT;
|
||||
set reusable szXAnimsLeftHanded;
|
||||
set string szXAnimsLeftHanded;
|
||||
set assetref szXAnimsLeftHanded ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnimsLeftHanded AssetXAnim;
|
||||
set count szXAnimsLeftHanded WEAP_ANIM_COUNT;
|
||||
set string szModeName;
|
||||
set reusable notetrackSoundMapKeys;
|
||||
@@ -121,4 +121,4 @@ set condition sound never;
|
||||
// snd_alias_list_name
|
||||
use snd_alias_list_name;
|
||||
set string soundName;
|
||||
set assetref soundName ASSET_TYPE_SOUND;
|
||||
set assetref soundName AssetSound;
|
||||
|
||||
@@ -37,7 +37,7 @@ set condition material FxElemDef::elemType == FX_ELEM_TYPE_SPRITE_BILLBOARD
|
||||
use FxEffectDefRef;
|
||||
set condition handle never;
|
||||
set string name;
|
||||
set assetref name ASSET_TYPE_FX;
|
||||
set assetref name AssetFx;
|
||||
|
||||
// FxTrailDef
|
||||
use FxTrailDef;
|
||||
|
||||
@@ -8,7 +8,7 @@ set reusable weapDef;
|
||||
set string szDisplayName;
|
||||
set string szAltWeaponName;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set count szXAnims NUM_WEAP_ANIMS;
|
||||
set reusable szXAnims;
|
||||
set scriptstring hideTags;
|
||||
|
||||
@@ -38,7 +38,7 @@ set condition material FxElemDef::elemType == FX_ELEM_TYPE_SPRITE_BILLBOARD
|
||||
use FxEffectDefRef;
|
||||
set condition handle never;
|
||||
set string name;
|
||||
set assetref name ASSET_TYPE_FX;
|
||||
set assetref name AssetFx;
|
||||
|
||||
// FxElemExtendedDefPtr
|
||||
use FxElemExtendedDefPtr;
|
||||
|
||||
@@ -12,7 +12,7 @@ set reusable hideTags;
|
||||
set string viewModelTag;
|
||||
set string worldModelTag;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set count szXAnims 88;
|
||||
set reusable szXAnims;
|
||||
set count locationDamageMultipliers 21;
|
||||
|
||||
@@ -13,7 +13,7 @@ set reusable attachments;
|
||||
set count attachmentUniques 95;
|
||||
set reusable attachmentUniques;
|
||||
set string szXAnims;
|
||||
set assetref szXAnims ASSET_TYPE_XANIMPARTS;
|
||||
set assetref szXAnims AssetXAnim;
|
||||
set count szXAnims NUM_WEAP_ANIMS;
|
||||
set reusable szXAnims;
|
||||
set scriptstring hideTags;
|
||||
|
||||
@@ -8,7 +8,6 @@ MemberInformation::MemberInformation(StructureInformation* parent, StructureInfo
|
||||
m_is_script_string(false),
|
||||
m_is_reusable(false),
|
||||
m_is_leaf(false),
|
||||
m_fast_file_block(nullptr),
|
||||
m_asset_ref(nullptr)
|
||||
m_fast_file_block(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ public:
|
||||
std::unique_ptr<IEvaluation> m_alloc_alignment;
|
||||
std::unique_ptr<CustomAction> m_post_load_action;
|
||||
const FastFileBlock* m_fast_file_block;
|
||||
const EnumMember* m_asset_ref;
|
||||
std::string m_asset_ref;
|
||||
};
|
||||
|
||||
@@ -397,22 +397,22 @@ namespace
|
||||
{
|
||||
if (modifier.IsArray())
|
||||
{
|
||||
LINEF("MarkArray_IndirectAssetRef({0}, {1}, {2});",
|
||||
member->m_asset_ref->m_name,
|
||||
LINEF("MarkArray_IndirectAssetRef({0}::EnumEntry, {1}, {2});",
|
||||
member->m_asset_ref,
|
||||
MakeMemberAccess(info, member, modifier),
|
||||
modifier.GetArraySize())
|
||||
}
|
||||
else
|
||||
{
|
||||
LINEF("MarkArray_IndirectAssetRef({0}, {1}, {2});",
|
||||
member->m_asset_ref->m_name,
|
||||
LINEF("MarkArray_IndirectAssetRef({0}::EnumEntry, {1}, {2});",
|
||||
member->m_asset_ref,
|
||||
MakeMemberAccess(info, member, modifier),
|
||||
MakeEvaluation(modifier.GetPointerArrayCountEvaluation()))
|
||||
}
|
||||
}
|
||||
else if (loadType == MemberLoadType::SINGLE_POINTER)
|
||||
{
|
||||
LINEF("Mark_IndirectAssetRef({0}, {1});", member->m_asset_ref->m_name, MakeMemberAccess(info, member, modifier))
|
||||
LINEF("Mark_IndirectAssetRef({0}::EnumEntry, {1});", member->m_asset_ref, MakeMemberAccess(info, member, modifier))
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -505,7 +505,7 @@ namespace
|
||||
{
|
||||
MarkMember_ScriptString(info, member, modifier, loadType);
|
||||
}
|
||||
else if (member->m_asset_ref)
|
||||
else if (!member->m_asset_ref.empty())
|
||||
{
|
||||
MarkMember_AssetRef(info, member, modifier, loadType);
|
||||
}
|
||||
@@ -740,7 +740,7 @@ namespace
|
||||
if (computations.ShouldIgnore() || computations.IsInRuntimeBlock())
|
||||
return;
|
||||
|
||||
if (member->m_is_script_string || member->m_asset_ref
|
||||
if (member->m_is_script_string || !member->m_asset_ref.empty()
|
||||
|| member->m_type && (member->m_type->m_requires_marking || StructureComputations(member->m_type).IsAsset()))
|
||||
{
|
||||
if (info->m_definition->GetType() == DataDefinitionType::UNION)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
static constexpr auto CAPTURE_TYPE = 1;
|
||||
static constexpr auto CAPTURE_ASSET_NAME = 2;
|
||||
constexpr auto CAPTURE_TYPE = 1;
|
||||
constexpr auto CAPTURE_ASSET_NAME = 2;
|
||||
} // namespace
|
||||
|
||||
SequenceAsset::SequenceAsset()
|
||||
@@ -31,7 +31,7 @@ void SequenceAsset::ProcessMatch(CommandsParserState* state, SequenceResult<Comm
|
||||
if (definition == nullptr)
|
||||
throw ParsingException(typeNameToken.GetPos(), "Unknown type");
|
||||
|
||||
auto* definitionWithMembers = dynamic_cast<DefinitionWithMembers*>(definition);
|
||||
const auto* definitionWithMembers = dynamic_cast<DefinitionWithMembers*>(definition);
|
||||
if (definitionWithMembers == nullptr)
|
||||
throw ParsingException(typeNameToken.GetPos(), "Type must be struct or union");
|
||||
|
||||
|
||||
@@ -7,10 +7,17 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
static constexpr auto TAG_DEFAULT = 1;
|
||||
constexpr auto CAPTURE_TYPE = 1;
|
||||
constexpr auto CAPTURE_ASSET_NAME = 2;
|
||||
|
||||
static constexpr auto CAPTURE_TYPE = 1;
|
||||
static constexpr auto CAPTURE_ASSET_TYPE_ENUM_ENTRY = 2;
|
||||
bool AssetWithNameIsKnown(const std::string& assetName, const IDataRepository& repository)
|
||||
{
|
||||
return std::ranges::any_of(repository.GetAllStructureInformation(),
|
||||
[&assetName](const StructureInformation* info)
|
||||
{
|
||||
return !info->m_asset_name.empty() && info->m_asset_name == assetName;
|
||||
});
|
||||
}
|
||||
} // namespace
|
||||
|
||||
SequenceAssetRef::SequenceAssetRef()
|
||||
@@ -22,17 +29,18 @@ SequenceAssetRef::SequenceAssetRef()
|
||||
create.Keyword("set"),
|
||||
create.Keyword("assetref"),
|
||||
create.Label(CommandsCommonMatchers::LABEL_TYPENAME).Capture(CAPTURE_TYPE),
|
||||
create.Identifier().Capture(CAPTURE_ASSET_TYPE_ENUM_ENTRY),
|
||||
create.Identifier().Capture(CAPTURE_ASSET_NAME),
|
||||
create.Char(';'),
|
||||
});
|
||||
}
|
||||
|
||||
void SequenceAssetRef::ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const
|
||||
{
|
||||
const auto& enumEntryToken = result.NextCapture(CAPTURE_ASSET_TYPE_ENUM_ENTRY);
|
||||
const auto* enumMember = state->GetRepository()->GetEnumMemberByName(enumEntryToken.IdentifierValue());
|
||||
if (enumMember == nullptr)
|
||||
throw ParsingException(enumEntryToken.GetPos(), "Unknown asset type enum entry");
|
||||
const auto& assetNameToken = result.NextCapture(CAPTURE_ASSET_NAME);
|
||||
auto assetName = assetNameToken.IdentifierValue();
|
||||
|
||||
if (!AssetWithNameIsKnown(assetName, *state->GetRepository()))
|
||||
throw ParsingException(assetNameToken.GetPos(), "No asset with this name");
|
||||
|
||||
const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE);
|
||||
|
||||
@@ -75,5 +83,5 @@ void SequenceAssetRef::ProcessMatch(CommandsParserState* state, SequenceResult<C
|
||||
if (typeDecl->m_type->GetType() != DataDefinitionType::BASE_TYPE)
|
||||
throw ParsingException(typeNameToken.GetPos(), "Invalid type for string, must be a base type");
|
||||
|
||||
lastMember->m_asset_ref = enumMember;
|
||||
lastMember->m_asset_ref = std::move(assetName);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace
|
||||
continue;
|
||||
|
||||
// Any script strings, asset refs and assets need to be processed.
|
||||
if (member->m_is_script_string || member->m_asset_ref || member->m_type && StructureComputations(member->m_type).IsAsset())
|
||||
if (member->m_is_script_string || !member->m_asset_ref.empty() || member->m_type && StructureComputations(member->m_type).IsAsset())
|
||||
{
|
||||
info->m_requires_marking = true;
|
||||
return true;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "AssetNameResolverIW3.h"
|
||||
|
||||
#include "Game/IW3/GameAssetPoolIW3.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolIW3::AssetTypeNameByType(assetType));
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
{
|
||||
return GameId::IW3;
|
||||
}
|
||||
|
||||
std::optional<const char*> AssetNameResolver::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return GameAssetPoolIW3::AssetTypeNameByType(assetType);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
class AssetNameResolver final : public HashMapBasedAssetNameResolver
|
||||
{
|
||||
public:
|
||||
AssetNameResolver();
|
||||
[[nodiscard]] GameId GetGameId() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW3
|
||||
@@ -3,26 +3,13 @@
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* ASSET_TYPE_NAMES[]{
|
||||
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
|
||||
"clipmap_unused", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable",
|
||||
};
|
||||
}
|
||||
|
||||
GameAssetPoolIW3::GameAssetPoolIW3(Zone* zone, const zone_priority_t priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
|
||||
|
||||
#define INIT_POOL(poolName) (poolName) = std::make_unique<AssetPoolDynamic<decltype(poolName)::element_type::type>>(m_priority)
|
||||
|
||||
INIT_POOL(m_phys_preset);
|
||||
@@ -151,26 +138,3 @@ XAssetInfoGeneric* GameAssetPoolIW3::GetAsset(const asset_type_t type, const std
|
||||
|
||||
#undef CASE_GET_ASSET
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW3::AssetTypeNameByType(const asset_type_t assetType)
|
||||
{
|
||||
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW3::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return AssetTypeNameByType(assetType);
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW3::AssetTypeCount()
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW3::GetAssetTypeCount() const
|
||||
{
|
||||
return AssetTypeCount();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
class GameAssetPoolIW3 final : public ZoneAssetPools
|
||||
{
|
||||
@@ -41,12 +40,6 @@ public:
|
||||
|
||||
[[nodiscard]] XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static std::optional<const char*> AssetTypeNameByType(asset_type_t assetType);
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
||||
static asset_type_t AssetTypeCount();
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) override;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone
|
||||
|
||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone) const
|
||||
{
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
const auto* pools = dynamic_cast<GameAssetPoolIW3*>(zone.m_pools.get());
|
||||
|
||||
assert(pools);
|
||||
@@ -18,7 +19,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
|
||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
||||
if (!pools->m_localize->m_asset_lookup.empty())
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
break;
|
||||
|
||||
default:
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "AssetNameResolverIW4.h"
|
||||
|
||||
#include "Game/IW4/GameAssetPoolIW4.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolIW4::AssetTypeNameByType(assetType));
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
{
|
||||
return GameId::IW4;
|
||||
}
|
||||
|
||||
std::optional<const char*> AssetNameResolver::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return GameAssetPoolIW4::AssetTypeNameByType(assetType);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class AssetNameResolver final : public HashMapBasedAssetNameResolver
|
||||
{
|
||||
public:
|
||||
AssetNameResolver();
|
||||
[[nodiscard]] GameId GetGameId() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW4
|
||||
@@ -3,31 +3,13 @@
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* ASSET_TYPE_NAMES[]{
|
||||
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel",
|
||||
"material", "pixelshader", "vertexshader", "vertexdecl", "techniqueset",
|
||||
"image", "sound", "soundcurve", "loadedsound", "clipmap_unused",
|
||||
"clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents",
|
||||
"fxworld", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals",
|
||||
"fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
|
||||
"tracer", "vehicle", "addonmapents",
|
||||
};
|
||||
}
|
||||
|
||||
GameAssetPoolIW4::GameAssetPoolIW4(Zone* zone, const zone_priority_t priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
|
||||
|
||||
#define INIT_POOL(poolName) (poolName) = std::make_unique<AssetPoolDynamic<decltype(poolName)::element_type::type>>(m_priority)
|
||||
|
||||
INIT_POOL(m_phys_preset);
|
||||
@@ -186,26 +168,3 @@ XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, const std
|
||||
|
||||
#undef CASE_GET_ASSET
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW4::AssetTypeNameByType(const asset_type_t assetType)
|
||||
{
|
||||
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW4::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return AssetTypeNameByType(assetType);
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW4::AssetTypeCount()
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW4::GetAssetTypeCount() const
|
||||
{
|
||||
return AssetTypeCount();
|
||||
}
|
||||
|
||||
@@ -50,12 +50,6 @@ public:
|
||||
|
||||
[[nodiscard]] XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static std::optional<const char*> AssetTypeNameByType(asset_type_t assetType);
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
||||
static asset_type_t AssetTypeCount();
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) override;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone
|
||||
|
||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone) const
|
||||
{
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
const auto* pools = dynamic_cast<GameAssetPoolIW4*>(zone.m_pools.get());
|
||||
|
||||
assert(pools);
|
||||
@@ -18,7 +19,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
|
||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
||||
if (!pools->m_localize->m_asset_lookup.empty())
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
break;
|
||||
|
||||
default:
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "AssetNameResolverIW5.h"
|
||||
|
||||
#include "Game/IW5/GameAssetPoolIW5.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolIW5::AssetTypeNameByType(assetType));
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
{
|
||||
return GameId::IW5;
|
||||
}
|
||||
|
||||
std::optional<const char*> AssetNameResolver::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return GameAssetPoolIW5::AssetTypeNameByType(assetType);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
class AssetNameResolver final : public HashMapBasedAssetNameResolver
|
||||
{
|
||||
public:
|
||||
AssetNameResolver();
|
||||
[[nodiscard]] GameId GetGameId() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace IW5
|
||||
@@ -3,68 +3,13 @@
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* ASSET_TYPE_NAMES[]{
|
||||
"physpreset",
|
||||
"physcollmap",
|
||||
"xanim",
|
||||
"xmodelsurfs",
|
||||
"xmodel",
|
||||
"material",
|
||||
"pixelshader",
|
||||
"vertexshader",
|
||||
"vertexdecl",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"glassworld",
|
||||
"pathdata",
|
||||
"vehicletrack",
|
||||
"mapents",
|
||||
"fxworld",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"attachment",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"surfacefx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"scriptfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"structureddatadef",
|
||||
"tracer",
|
||||
"vehicle",
|
||||
"addonmapents",
|
||||
};
|
||||
}
|
||||
|
||||
GameAssetPoolIW5::GameAssetPoolIW5(Zone* zone, const zone_priority_t priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
|
||||
|
||||
#define INIT_POOL(poolName) (poolName) = std::make_unique<AssetPoolDynamic<decltype(poolName)::element_type::type>>(m_priority)
|
||||
|
||||
INIT_POOL(m_phys_preset);
|
||||
@@ -236,26 +181,3 @@ XAssetInfoGeneric* GameAssetPoolIW5::GetAsset(const asset_type_t type, const std
|
||||
|
||||
#undef CASE_GET_ASSET
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW5::AssetTypeNameByType(const asset_type_t assetType)
|
||||
{
|
||||
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolIW5::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return AssetTypeNameByType(assetType);
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW5::AssetTypeCount()
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolIW5::GetAssetTypeCount() const
|
||||
{
|
||||
return AssetTypeCount();
|
||||
}
|
||||
|
||||
@@ -55,12 +55,6 @@ public:
|
||||
|
||||
[[nodiscard]] XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static std::optional<const char*> AssetTypeNameByType(asset_type_t assetType);
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
||||
static asset_type_t AssetTypeCount();
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) override;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone
|
||||
|
||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone) const
|
||||
{
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
const auto* pools = dynamic_cast<GameAssetPoolIW5*>(zone.m_pools.get());
|
||||
|
||||
assert(pools);
|
||||
@@ -18,7 +19,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
|
||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
||||
if (!pools->m_localize->m_asset_lookup.empty())
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
break;
|
||||
|
||||
default:
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "AssetNameResolverT5.h"
|
||||
|
||||
#include "Game/T5/GameAssetPoolT5.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
using namespace T5;
|
||||
|
||||
AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolT5::AssetTypeNameByType(assetType));
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
{
|
||||
return GameId::T5;
|
||||
}
|
||||
|
||||
std::optional<const char*> AssetNameResolver::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return GameAssetPoolT5::AssetTypeNameByType(assetType);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
namespace T5
|
||||
{
|
||||
class AssetNameResolver final : public HashMapBasedAssetNameResolver
|
||||
{
|
||||
public:
|
||||
AssetNameResolver();
|
||||
[[nodiscard]] GameId GetGameId() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace T5
|
||||
@@ -3,29 +3,13 @@
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace T5;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* ASSET_TYPE_NAMES[]{
|
||||
"xmodelpieces", "physpreset", "physconstraints", "destructibledef", "xanim", "xmodel", "material",
|
||||
"techniqueset", "image", "soundbank", "soundpatch", "clipmap_unused", "clipmap", "comworld",
|
||||
"gameworldsp", "gameworldmp", "mapents", "gfxworld", "gfxlightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "weapondef", "weaponvariant", "snddriverglobals",
|
||||
"fx", "fximpacttable", "aitype", "mptype", "mpbody", "mphead", "character",
|
||||
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
|
||||
"emblemset",
|
||||
};
|
||||
}
|
||||
|
||||
GameAssetPoolT5::GameAssetPoolT5(Zone* zone, const zone_priority_t priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
|
||||
|
||||
#define INIT_POOL(poolName) (poolName) = std::make_unique<AssetPoolDynamic<decltype(poolName)::element_type::type>>(m_priority)
|
||||
|
||||
INIT_POOL(m_phys_preset);
|
||||
@@ -175,26 +159,3 @@ XAssetInfoGeneric* GameAssetPoolT5::GetAsset(const asset_type_t type, const std:
|
||||
|
||||
#undef CASE_GET_ASSET
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolT5::AssetTypeNameByType(const asset_type_t assetType)
|
||||
{
|
||||
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolT5::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return AssetTypeNameByType(assetType);
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolT5::AssetTypeCount()
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolT5::GetAssetTypeCount() const
|
||||
{
|
||||
return AssetTypeCount();
|
||||
}
|
||||
|
||||
@@ -47,12 +47,6 @@ public:
|
||||
|
||||
[[nodiscard]] XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static std::optional<const char*> AssetTypeNameByType(asset_type_t assetType);
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
||||
static asset_type_t AssetTypeCount();
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) override;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone
|
||||
|
||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone) const
|
||||
{
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
const auto* pools = dynamic_cast<GameAssetPoolT5*>(zone.m_pools.get());
|
||||
|
||||
assert(pools);
|
||||
@@ -18,7 +19,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
|
||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
||||
if (!pools->m_localize->m_asset_lookup.empty())
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
break;
|
||||
|
||||
default:
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "AssetNameResolverT6.h"
|
||||
|
||||
#include "Game/T6/GameAssetPoolT6.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
using namespace T6;
|
||||
|
||||
AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolT6::AssetTypeNameByType(assetType));
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
{
|
||||
return GameId::T6;
|
||||
}
|
||||
|
||||
std::optional<const char*> AssetNameResolver::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return GameAssetPoolT6::AssetTypeNameByType(assetType);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
namespace T6
|
||||
{
|
||||
class AssetNameResolver final : public HashMapBasedAssetNameResolver
|
||||
{
|
||||
public:
|
||||
AssetNameResolver();
|
||||
[[nodiscard]] GameId GetGameId() const override;
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
};
|
||||
} // namespace T6
|
||||
@@ -3,82 +3,13 @@
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* ASSET_TYPE_NAMES[]{
|
||||
"xmodelpieces",
|
||||
"physpreset",
|
||||
"physconstraints",
|
||||
"destructibledef",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"soundbank",
|
||||
"soundpatch",
|
||||
"clipmap_unused",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"gfxlightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"fonticon",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"weapondef",
|
||||
"weaponvariant",
|
||||
"weaponfull",
|
||||
"attachment",
|
||||
"attachmentunique",
|
||||
"camo",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"fximpacttable",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"mpbody",
|
||||
"mphead",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"xglobals",
|
||||
"ddl",
|
||||
"glasses",
|
||||
"emblemset",
|
||||
"script",
|
||||
"keyvaluepairs",
|
||||
"vehicle",
|
||||
"memoryblock",
|
||||
"addonmapents",
|
||||
"tracer",
|
||||
"skinnedverts",
|
||||
"qdb",
|
||||
"slug",
|
||||
"footsteptable",
|
||||
"footstepfxtable",
|
||||
"zbarrier",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
GameAssetPoolT6::GameAssetPoolT6(Zone* zone, const zone_priority_t priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
|
||||
|
||||
#define INIT_POOL(poolName) (poolName) = std::make_unique<AssetPoolDynamic<decltype(poolName)::element_type::type>>(m_priority)
|
||||
|
||||
INIT_POOL(m_phys_preset);
|
||||
@@ -276,26 +207,3 @@ XAssetInfoGeneric* GameAssetPoolT6::GetAsset(const asset_type_t type, const std:
|
||||
|
||||
#undef CASE_GET_ASSET
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolT6::AssetTypeNameByType(const asset_type_t assetType)
|
||||
{
|
||||
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
|
||||
return ASSET_TYPE_NAMES[assetType];
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<const char*> GameAssetPoolT6::GetAssetTypeName(const asset_type_t assetType) const
|
||||
{
|
||||
return AssetTypeNameByType(assetType);
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolT6::AssetTypeCount()
|
||||
{
|
||||
return ASSET_TYPE_COUNT;
|
||||
}
|
||||
|
||||
asset_type_t GameAssetPoolT6::GetAssetTypeCount() const
|
||||
{
|
||||
return AssetTypeCount();
|
||||
}
|
||||
|
||||
@@ -63,12 +63,6 @@ public:
|
||||
|
||||
[[nodiscard]] XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static std::optional<const char*> AssetTypeNameByType(asset_type_t assetType);
|
||||
[[nodiscard]] std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
||||
static asset_type_t AssetTypeCount();
|
||||
[[nodiscard]] asset_type_t GetAssetTypeCount() const override;
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) override;
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone
|
||||
|
||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone) const
|
||||
{
|
||||
const auto* game = IGame::GetGameById(zone.m_game_id);
|
||||
const auto* pools = dynamic_cast<GameAssetPoolT6*>(zone.m_pools.get());
|
||||
|
||||
assert(pools);
|
||||
@@ -74,7 +75,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
|
||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
||||
if (!pools->m_localize->m_asset_lookup.empty())
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||
|
||||
for (const auto& asset : *pools)
|
||||
{
|
||||
@@ -85,7 +86,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone&
|
||||
break;
|
||||
|
||||
default:
|
||||
stream.WriteEntry(*pools->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,6 @@ public:
|
||||
[[nodiscard]] virtual XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const = 0;
|
||||
[[nodiscard]] virtual XAssetInfoGeneric* GetAssetOrAssetReference(asset_type_t type, const std::string& name) const;
|
||||
|
||||
[[nodiscard]] virtual asset_type_t GetAssetTypeCount() const = 0;
|
||||
[[nodiscard]] virtual std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const = 0;
|
||||
|
||||
[[nodiscard]] size_t GetTotalAssetCount() const;
|
||||
|
||||
[[nodiscard]] iterator begin() const;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
AssetListOutputStream::AssetListOutputStream(std::ostream& stream, const GameId game)
|
||||
: m_stream(stream),
|
||||
m_asset_name_resolver(IAssetNameResolver::GetResolverForGame(game))
|
||||
m_game(IGame::GetGameById(game))
|
||||
{
|
||||
}
|
||||
|
||||
void AssetListOutputStream::WriteEntry(const AssetListEntry& entry)
|
||||
{
|
||||
m_stream.WriteColumn(*m_asset_name_resolver->GetAssetTypeName(entry.m_type));
|
||||
m_stream.WriteColumn(*m_game->GetAssetTypeName(entry.m_type));
|
||||
m_stream.WriteColumn(entry.m_name);
|
||||
m_stream.NextRow();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "AssetList.h"
|
||||
#include "Csv/CsvStream.h"
|
||||
#include "Game/IGame.h"
|
||||
#include "Zone/AssetNameResolver.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -16,5 +15,5 @@ public:
|
||||
|
||||
private:
|
||||
CsvOutputStream m_stream;
|
||||
const IAssetNameResolver* m_asset_name_resolver;
|
||||
const IGame* m_game;
|
||||
};
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace
|
||||
class AssetListInputStream
|
||||
{
|
||||
public:
|
||||
AssetListInputStream(std::istream& stream, GameId game)
|
||||
AssetListInputStream(std::istream& stream, const GameId game)
|
||||
: m_stream(stream),
|
||||
m_asset_name_resolver(IAssetNameResolver::GetResolverForGame(game))
|
||||
m_asset_name_resolver(game)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace
|
||||
continue;
|
||||
|
||||
const auto& typeName = row[0];
|
||||
const auto maybeType = m_asset_name_resolver->GetAssetTypeByName(typeName);
|
||||
const auto maybeType = m_asset_name_resolver.GetAssetTypeByName(typeName);
|
||||
if (!maybeType)
|
||||
{
|
||||
con::error("Unknown asset type name \"{}\"", typeName);
|
||||
@@ -60,7 +60,7 @@ namespace
|
||||
|
||||
private:
|
||||
CsvInputStream m_stream;
|
||||
const IAssetNameResolver* m_asset_name_resolver;
|
||||
AssetNameResolver m_asset_name_resolver;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -1,38 +1,28 @@
|
||||
#include "AssetNameResolver.h"
|
||||
|
||||
#include "Game/IW3/AssetNameResolverIW3.h"
|
||||
#include "Game/IW4/AssetNameResolverIW4.h"
|
||||
#include "Game/IW5/AssetNameResolverIW5.h"
|
||||
#include "Game/T5/AssetNameResolverT5.h"
|
||||
#include "Game/T6/AssetNameResolverT6.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
const IAssetNameResolver* IAssetNameResolver::GetResolverForGame(GameId game)
|
||||
AssetNameResolver::AssetNameResolver(const GameId gameId)
|
||||
{
|
||||
static const IAssetNameResolver* assetNameResolvers[static_cast<unsigned>(GameId::COUNT)]{
|
||||
new IW3::AssetNameResolver(),
|
||||
new IW4::AssetNameResolver(),
|
||||
new IW5::AssetNameResolver(),
|
||||
new T5::AssetNameResolver(),
|
||||
new T6::AssetNameResolver(),
|
||||
};
|
||||
const auto* game = IGame::GetGameById(gameId);
|
||||
const auto assetTypeCount = game->GetAssetTypeCount();
|
||||
|
||||
assert(static_cast<unsigned>(game) < static_cast<unsigned>(GameId::COUNT));
|
||||
const auto* result = assetNameResolvers[static_cast<unsigned>(game)];
|
||||
assert(result);
|
||||
for (asset_type_t assetType = 0; assetType < assetTypeCount; assetType++)
|
||||
{
|
||||
auto maybeAssetTypeName = game->GetAssetTypeName(assetType);
|
||||
assert(maybeAssetTypeName);
|
||||
if (!maybeAssetTypeName)
|
||||
continue;
|
||||
|
||||
return result;
|
||||
std::string lowerCaseName(*maybeAssetTypeName);
|
||||
utils::MakeStringLowerCase(lowerCaseName);
|
||||
m_asset_types_by_name.emplace(lowerCaseName, assetType);
|
||||
}
|
||||
}
|
||||
|
||||
void HashMapBasedAssetNameResolver::AddAssetTypeName(asset_type_t assetType, std::string name)
|
||||
{
|
||||
utils::MakeStringLowerCase(name);
|
||||
m_asset_types_by_name.emplace(std::move(name), assetType);
|
||||
}
|
||||
|
||||
std::optional<asset_type_t> HashMapBasedAssetNameResolver::GetAssetTypeByName(const std::string& assetTypeName) const
|
||||
std::optional<asset_type_t> AssetNameResolver::GetAssetTypeByName(const std::string& assetTypeName) const
|
||||
{
|
||||
std::string lowerCaseName = assetTypeName;
|
||||
utils::MakeStringLowerCase(lowerCaseName);
|
||||
|
||||
@@ -7,30 +7,13 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
class IAssetNameResolver
|
||||
class AssetNameResolver
|
||||
{
|
||||
public:
|
||||
IAssetNameResolver() = default;
|
||||
virtual ~IAssetNameResolver() = default;
|
||||
IAssetNameResolver(const IAssetNameResolver& other) = default;
|
||||
IAssetNameResolver(IAssetNameResolver&& other) noexcept = default;
|
||||
IAssetNameResolver& operator=(const IAssetNameResolver& other) = default;
|
||||
IAssetNameResolver& operator=(IAssetNameResolver&& other) noexcept = default;
|
||||
AssetNameResolver() = default;
|
||||
explicit AssetNameResolver(GameId gameId);
|
||||
|
||||
[[nodiscard]] virtual GameId GetGameId() const = 0;
|
||||
[[nodiscard]] virtual std::optional<asset_type_t> GetAssetTypeByName(const std::string& assetTypeName) const = 0;
|
||||
[[nodiscard]] virtual std::optional<const char*> GetAssetTypeName(asset_type_t assetType) const = 0;
|
||||
|
||||
static const IAssetNameResolver* GetResolverForGame(GameId game);
|
||||
};
|
||||
|
||||
class HashMapBasedAssetNameResolver : public IAssetNameResolver
|
||||
{
|
||||
public:
|
||||
[[nodiscard]] std::optional<asset_type_t> GetAssetTypeByName(const std::string& assetTypeName) const override;
|
||||
|
||||
protected:
|
||||
void AddAssetTypeName(asset_type_t assetType, std::string name);
|
||||
[[nodiscard]] std::optional<asset_type_t> GetAssetTypeByName(const std::string& assetTypeName) const;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, asset_type_t> m_asset_types_by_name;
|
||||
|
||||
@@ -23,10 +23,7 @@ void SequenceZoneDefinitionEntry::ProcessMatch(ZoneDefinitionParserState* state,
|
||||
{
|
||||
const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE_NAME);
|
||||
|
||||
if (!state->m_asset_name_resolver)
|
||||
throw ParsingException(typeNameToken.GetPos(), "Must define game before first asset");
|
||||
|
||||
const auto maybeAssetType = state->m_asset_name_resolver->GetAssetTypeByName(typeNameToken.FieldValue());
|
||||
const auto maybeAssetType = state->m_asset_name_resolver.GetAssetTypeByName(typeNameToken.FieldValue());
|
||||
if (!maybeAssetType)
|
||||
throw ParsingException(typeNameToken.GetPos(), "Unknown asset type");
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
ZoneDefinitionParserState::ZoneDefinitionParserState(std::string targetName, ISearchPath& searchPath, IParserLineStream& underlyingStream)
|
||||
: m_search_path(searchPath),
|
||||
m_underlying_stream(underlyingStream),
|
||||
m_asset_name_resolver(nullptr),
|
||||
m_definition(std::make_unique<ZoneDefinition>())
|
||||
|
||||
{
|
||||
@@ -16,7 +15,7 @@ ZoneDefinitionParserState::ZoneDefinitionParserState(std::string targetName, ISe
|
||||
void ZoneDefinitionParserState::SetGame(const GameId game)
|
||||
{
|
||||
m_definition->m_game = game;
|
||||
m_asset_name_resolver = IAssetNameResolver::GetResolverForGame(game);
|
||||
m_asset_name_resolver = AssetNameResolver(game);
|
||||
}
|
||||
|
||||
namespace
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
IParserLineStream& m_underlying_stream;
|
||||
std::unordered_set<std::string> m_inclusions;
|
||||
|
||||
const IAssetNameResolver* m_asset_name_resolver;
|
||||
AssetNameResolver m_asset_name_resolver;
|
||||
|
||||
std::optional<ZoneDefinitionObjContainer> m_current_ipak;
|
||||
std::optional<ZoneDefinitionObjContainer> m_current_iwd;
|
||||
|
||||
Reference in New Issue
Block a user