2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-03-05 12:33:02 +00:00

fix: constraint on asset name arrays

This commit is contained in:
Jan Laupetin
2026-02-27 21:09:06 +01:00
parent e749514972
commit a6d63e9b31
6 changed files with 21 additions and 11 deletions

View File

@@ -8,18 +8,20 @@ using namespace IW3;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
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",
};
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
constexpr const char* SUB_ASSET_TYPE_NAMES[SUB_ASSET_TYPE_COUNT]{
constexpr const char* SUB_ASSET_TYPE_NAMES[]{
"technique",
"vertexshader",
"pixelshader",
};
static_assert(std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)> == SUB_ASSET_TYPE_COUNT);
} // namespace
namespace IW3

View File

@@ -8,7 +8,7 @@ using namespace IW4;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
constexpr const char* ASSET_TYPE_NAMES[]{
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel",
"material", "pixelshader", "vertexshader", "vertexdecl", "techniqueset",
"image", "sound", "soundcurve", "loadedsound", "clipmap_unused",
@@ -19,10 +19,12 @@ namespace
"xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
"tracer", "vehicle", "addonmapents",
};
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
constexpr const char* SUB_ASSET_TYPE_NAMES[SUB_ASSET_TYPE_COUNT]{
constexpr const char* SUB_ASSET_TYPE_NAMES[]{
"technique",
};
static_assert(std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)> == SUB_ASSET_TYPE_COUNT);
} // namespace
namespace IW4

View File

@@ -8,7 +8,7 @@ using namespace IW5;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
constexpr const char* ASSET_TYPE_NAMES[]{
"physpreset",
"physcollmap",
"xanim",
@@ -56,10 +56,12 @@ namespace
"vehicle",
"addonmapents",
};
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
constexpr const char* SUB_ASSET_TYPE_NAMES[SUB_ASSET_TYPE_COUNT]{
constexpr const char* SUB_ASSET_TYPE_NAMES[]{
"technique",
};
static_assert(std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)> == SUB_ASSET_TYPE_COUNT);
} // namespace
namespace IW5

View File

@@ -8,7 +8,7 @@ using namespace T5;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
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",
@@ -17,12 +17,14 @@ namespace
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
"emblemset",
};
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
constexpr const char* SUB_ASSET_TYPE_NAMES[SUB_ASSET_TYPE_COUNT]{
constexpr const char* SUB_ASSET_TYPE_NAMES[]{
"technique",
"vertexshader",
"pixelshader",
};
static_assert(std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)> == SUB_ASSET_TYPE_COUNT);
} // namespace
namespace T5

View File

@@ -62,7 +62,7 @@ namespace T5
enum SubAssetType
{
SUB_ASSET_TYPE_TECHNIQUE = ASSET_TYPE_COUNT,
SUB_ASSET_TYPE_TECHNIQUE,
SUB_ASSET_TYPE_VERTEX_SHADER,
SUB_ASSET_TYPE_PIXEL_SHADER,

View File

@@ -8,7 +8,7 @@ using namespace T6;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
constexpr const char* ASSET_TYPE_NAMES[]{
"xmodelpieces",
"physpreset",
"physconstraints",
@@ -70,12 +70,14 @@ namespace
"footstepfxtable",
"zbarrier",
};
static_assert(std::extent_v<decltype(ASSET_TYPE_NAMES)> == ASSET_TYPE_COUNT);
constexpr const char* SUB_ASSET_TYPE_NAMES[SUB_ASSET_TYPE_COUNT]{
constexpr const char* SUB_ASSET_TYPE_NAMES[]{
"technique",
"vertexshader",
"pixelshader",
};
static_assert(std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)> == SUB_ASSET_TYPE_COUNT);
} // namespace
namespace T6