From 0b61fc6e81fc28ad8f4e0eebdf2e42d032169435 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 22 Apr 2024 23:14:29 +0200 Subject: [PATCH] chore: add asset structs for all games containing enum entry and type --- src/Common/Game/IAsset.h | 14 +++++++++++ src/Common/Game/IW3/IW3.h | 29 +++++++++++++++++++++++ src/Common/Game/IW4/IW4.h | 39 +++++++++++++++++++++++++++++++ src/Common/Game/IW5/IW5.h | 42 +++++++++++++++++++++++++++++++++ src/Common/Game/T5/T5.h | 35 ++++++++++++++++++++++++++++ src/Common/Game/T6/T6.h | 49 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 208 insertions(+) create mode 100644 src/Common/Game/IAsset.h diff --git a/src/Common/Game/IAsset.h b/src/Common/Game/IAsset.h new file mode 100644 index 00000000..a63c373c --- /dev/null +++ b/src/Common/Game/IAsset.h @@ -0,0 +1,14 @@ +#pragma once + +#include "Zone/ZoneTypes.h" + +struct IAssetBase +{ +}; + +template class Asset : IAssetBase +{ +public: + static constexpr auto EnumEntry = AssetTypeEnum; + using Type = AssetType; +}; diff --git a/src/Common/Game/IW3/IW3.h b/src/Common/Game/IW3/IW3.h index 54f4bf72..5120290f 100644 --- a/src/Common/Game/IW3/IW3.h +++ b/src/Common/Game/IW3/IW3.h @@ -3,6 +3,7 @@ // clang-format off: Order of includes matters here // #include +#include "Game/IAsset.h" #include "Image/Texture.h" #include "IW3_Assets.h" @@ -83,4 +84,32 @@ namespace IW3 WFT_NUM_FIELD_TYPES }; + + using AssetXModelPieces = Asset; + using AssetPhysPreset = Asset; + using AssetXAnim = Asset; + using AssetXModel = Asset; + using AssetMaterial = Asset; + using AssetTechniqueSet = Asset; + using AssetImage = Asset; + using AssetSound = Asset; + using AssetSoundCurve = Asset; + using AssetLoadedSound = Asset; + using AssetClipMap = Asset; + using AssetComWorld = Asset; + using AssetGameWorldSp = Asset; + using AssetGameWorldMp = Asset; + using AssetMapEnts = Asset; + using AssetGfxWorld = Asset; + using AssetLightDef = Asset; + using AssetFont = Asset; + using AssetMenuList = Asset; + using AssetMenu = Asset; + using AssetLocalize = Asset; + using AssetWeapon = Asset; + using AssetSndDriverGlobals = Asset; + using AssetFx = Asset; + using AssetImpactFx = Asset; + using AssetRawFile = Asset; + using AssetStringTable = Asset; } // namespace IW3 diff --git a/src/Common/Game/IW4/IW4.h b/src/Common/Game/IW4/IW4.h index d8add5ca..53f972e2 100644 --- a/src/Common/Game/IW4/IW4.h +++ b/src/Common/Game/IW4/IW4.h @@ -3,6 +3,7 @@ // clang-format off: Order of includes matters here // #include +#include "Game/IAsset.h" #include "Image/Texture.h" #include "IW4_Assets.h" @@ -129,4 +130,42 @@ namespace IW4 VFT_NUM, }; + + using AssetPhysPreset = Asset; + using AssetPhysCollMap = Asset; + using AssetXAnim = Asset; + using AssetXModelSurfs = Asset; + using AssetXModel = Asset; + using AssetMaterial = Asset; + using AssetPixelShader = Asset; + using AssetVertexShader = Asset; + using AssetVertexDecl = Asset; + using AssetTechniqueSet = Asset; + using AssetImage = Asset; + using AssetSound = Asset; + using AssetSoundCurve = Asset; + using AssetLoadedSound = Asset; + using AssetClipMapSp = Asset; + using AssetClipMapMp = Asset; + using AssetComWorld = Asset; + using AssetGameWorldSp = Asset; + using AssetGameWorldMp = Asset; + using AssetMapEnts = Asset; + using AssetFxWorld = Asset; + using AssetGfxWorld = Asset; + using AssetLightDef = Asset; + using AssetFont = Asset; + using AssetMenuList = Asset; + using AssetMenu = Asset; + using AssetLocalize = Asset; + using AssetWeapon = Asset; + using AssetFx = Asset; + using AssetImpactFx = Asset; + using AssetRawFile = Asset; + using AssetStringTable = Asset; + using AssetLeaderBoard = Asset; + using AssetStructuredDataDef = Asset; + using AssetTracer = Asset; + using AssetVehicle = Asset; + using AssetAddonMapEnts = Asset; } // namespace IW4 diff --git a/src/Common/Game/IW5/IW5.h b/src/Common/Game/IW5/IW5.h index 40b98fac..18513576 100644 --- a/src/Common/Game/IW5/IW5.h +++ b/src/Common/Game/IW5/IW5.h @@ -3,6 +3,7 @@ // clang-format off: Order of includes matters here // #include +#include "Game/IAsset.h" #include "Image/Texture.h" #include "IW5_Assets.h" @@ -137,4 +138,45 @@ namespace IW5 WAFT_NUM_FIELD_TYPES, }; + + using AssetPhysPreset = Asset; + using AssetPhysCollMap = Asset; + using AssetXAnim = Asset; + using AssetXModelSurfs = Asset; + using AssetXModel = Asset; + using AssetMaterial = Asset; + using AssetPixelShader = Asset; + using AssetVertexShader = Asset; + using AssetVertexDecl = Asset; + using AssetTechniqueSet = Asset; + using AssetImage = Asset; + using AssetSound = Asset; + using AssetSoundCurve = Asset; + using AssetLoadedSound = Asset; + using AssetClipMap = Asset; + using AssetComWorld = Asset; + using AssetGlassWorld = Asset; + using AssetPathData = Asset; + using AssetVehicleTrack = Asset; + using AssetMapEnts = Asset; + using AssetFxWorld = Asset; + using AssetGfxWorld = Asset; + using AssetLightDef = Asset; + using AssetFont = Asset; + using AssetMenuList = Asset; + using AssetMenu = Asset; + using AssetLocalize = Asset; + using AssetAttachment = Asset; + using AssetWeapon = Asset; + using AssetFx = Asset; + using AssetImpactFx = Asset; + using AssetSurfaceFx = Asset; + using AssetRawFile = Asset; + using AssetScript = Asset; + using AssetStringTable = Asset; + using AssetLeaderBoard = Asset; + using AssetStructuredDataDef = Asset; + using AssetTracer = Asset; + using AssetVehicle = Asset; + using AssetAddonMapEnts = Asset; } // namespace IW5 diff --git a/src/Common/Game/T5/T5.h b/src/Common/Game/T5/T5.h index a6d7328b..7f73a26a 100644 --- a/src/Common/Game/T5/T5.h +++ b/src/Common/Game/T5/T5.h @@ -3,6 +3,7 @@ // clang-format off: Order of includes matters here // #include +#include "Game/IAsset.h" #include "Image/Texture.h" #include "T5_Assets.h" @@ -114,4 +115,38 @@ namespace T5 CFT_NUM_FIELD_TYPES }; + + using AssetPhysPreset = Asset; + using AssetPhysConstraints = Asset; + using AssetDestructibleDef = Asset; + using AssetXAnim = Asset; + using AssetXModel = Asset; + using AssetMaterial = Asset; + using AssetTechniqueSet = Asset; + using AssetImage = Asset; + using AssetSoundBank = Asset; + using AssetSoundPatch = Asset; + using AssetClipMap = Asset; + using AssetComWorld = Asset; + using AssetGameWorldSp = Asset; + using AssetGameWorldMp = Asset; + using AssetMapEnts = Asset; + using AssetGfxWorld = Asset; + using AssetLightDef = Asset; + using AssetFont = Asset; + using AssetMenuList = Asset; + using AssetMenu = Asset; + using AssetLocalize = Asset; + using AssetWeapon = Asset; + using AssetSoundDriverGlobals = Asset; + using AssetFx = Asset; + using AssetImpactFx = Asset; + using AssetRawFile = Asset; + using AssetStringTable = Asset; + using AssetPackIndex = Asset; + using AssetXGlobals = Asset; + using AssetDDL = Asset; + using AssetGlasses = Asset; + using AssetEmblemSet = Asset; + } // namespace T5 diff --git a/src/Common/Game/T6/T6.h b/src/Common/Game/T6/T6.h index d4a12747..9d5a6f80 100644 --- a/src/Common/Game/T6/T6.h +++ b/src/Common/Game/T6/T6.h @@ -3,6 +3,7 @@ // clang-format off: Order of includes matters here // #include +#include "Game/IAsset.h" #include "Image/Texture.h" #include "T6_Assets.h" @@ -159,4 +160,52 @@ namespace T6 AUFT_NUM_FIELD_TYPES, }; + using AssetPhysPreset = Asset; + using AssetPhysConstraints = Asset; + using AssetDestructibleDef = Asset; + using AssetXAnim = Asset; + using AssetXModel = Asset; + using AssetMaterial = Asset; + using AssetTechniqueSet = Asset; + using AssetImage = Asset; + using AssetSoundBank = Asset; + using AssetSoundPatch = Asset; + using AssetClipMap = Asset; + using AssetComWorld = Asset; + using AssetGameWorldSp = Asset; + using AssetGameWorldMp = Asset; + using AssetMapEnts = Asset; + using AssetGfxWorld = Asset; + using AssetLightDef = Asset; + using AssetFont = Asset; + using AssetFontIcon = Asset; + using AssetMenuList = Asset; + using AssetMenu = Asset; + using AssetLocalize = Asset; + using AssetWeapon = Asset; + using AssetAttachment = Asset; + using AssetAttachmentUnique = Asset; + using AssetWeaponCamo = Asset; + using AssetSoundDriverGlobals = Asset; + using AssetFx = Asset; + using AssetImpactFx = Asset; + using AssetRawFile = Asset; + using AssetStringTable = Asset; + using AssetLeaderBoard = Asset; + using AssetXGlobals = Asset; + using AssetDDL = Asset; + using AssetGlasses = Asset; + using AssetEmblemSet = Asset; + using AssetScript = Asset; + using AssetKeyValuePairs = Asset; + using AssetVehicle = Asset; + using AssetMemoryBlock = Asset; + using AssetAddonMapEnts = Asset; + using AssetTracer = Asset; + using AssetSkinnedVerts = Asset; + using AssetQdb = Asset; + using AssetSlug = Asset; + using AssetFootstepTable = Asset; + using AssetFootstepFxTable = Asset; + using AssetZBarrier = Asset; } // namespace T6