diff --git a/src/ZoneCode/Game/IW3/IW3_Commands.txt b/src/ZoneCode/Game/IW3/IW3_Commands.txt index cf9d42f0..4ac4a98f 100644 --- a/src/ZoneCode/Game/IW3/IW3_Commands.txt +++ b/src/ZoneCode/Game/IW3/IW3_Commands.txt @@ -3,31 +3,31 @@ game IW3; architecture x86; // Game Assets -asset PhysPreset ASSET_TYPE_PHYSPRESET; -asset XAnimParts ASSET_TYPE_XANIMPARTS; -asset XModel ASSET_TYPE_XMODEL; -asset Material ASSET_TYPE_MATERIAL; -asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET; -asset GfxImage ASSET_TYPE_IMAGE; -asset snd_alias_list_t ASSET_TYPE_SOUND; -asset SndCurve ASSET_TYPE_SOUND_CURVE; -asset LoadedSound ASSET_TYPE_LOADED_SOUND; -asset clipMap_t ASSET_TYPE_CLIPMAP_PVS; -asset ComWorld ASSET_TYPE_COMWORLD; -asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP; -asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP; -asset MapEnts ASSET_TYPE_MAP_ENTS; -asset GfxWorld ASSET_TYPE_GFXWORLD; -asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -asset Font_s ASSET_TYPE_FONT; -asset MenuList ASSET_TYPE_MENULIST; -asset menuDef_t ASSET_TYPE_MENU; -asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; -asset WeaponDef ASSET_TYPE_WEAPON; -asset FxEffectDef ASSET_TYPE_FX; -asset FxImpactTable ASSET_TYPE_IMPACT_FX; -asset RawFile ASSET_TYPE_RAWFILE; -asset StringTable ASSET_TYPE_STRINGTABLE; +asset PhysPreset AssetPhysPreset; +asset XAnimParts AssetXAnim; +asset XModel AssetXModel; +asset Material AssetMaterial; +asset MaterialTechniqueSet AssetTechniqueSet; +asset GfxImage AssetImage; +asset snd_alias_list_t AssetSound; +asset SndCurve AssetSoundCurve; +asset LoadedSound AssetLoadedSound; +asset clipMap_t AssetClipMapPvs; +asset ComWorld AssetComWorld; +asset GameWorldSp AssetGameWorldSp; +asset GameWorldMp AssetGameWorldMp; +asset MapEnts AssetMapEnts; +asset GfxWorld AssetGfxWorld; +asset GfxLightDef AssetLightDef; +asset Font_s AssetFont; +asset MenuList AssetMenuList; +asset menuDef_t AssetMenu; +asset LocalizeEntry AssetLocalize; +asset WeaponDef AssetWeapon; +asset FxEffectDef AssetFx; +asset FxImpactTable AssetImpactFx; +asset RawFile AssetRawFile; +asset StringTable AssetStringTable; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -66,4 +66,3 @@ block normal XFILE_BLOCK_INDEX; #include "XAssets/RawFile.txt" #include "XAssets/StringTable.txt" -// EOF \ No newline at end of file diff --git a/src/ZoneCode/Game/IW4/IW4_Commands.txt b/src/ZoneCode/Game/IW4/IW4_Commands.txt index 52eacd84..cf62d97c 100644 --- a/src/ZoneCode/Game/IW4/IW4_Commands.txt +++ b/src/ZoneCode/Game/IW4/IW4_Commands.txt @@ -3,41 +3,41 @@ game IW4; architecture x86; // Game Assets -asset PhysPreset ASSET_TYPE_PHYSPRESET; -asset PhysCollmap ASSET_TYPE_PHYSCOLLMAP; -asset XAnimParts ASSET_TYPE_XANIMPARTS; -asset XModel ASSET_TYPE_XMODEL; -asset Material ASSET_TYPE_MATERIAL; -asset MaterialPixelShader ASSET_TYPE_PIXELSHADER; -asset MaterialVertexShader ASSET_TYPE_VERTEXSHADER; -asset MaterialVertexDeclaration ASSET_TYPE_VERTEXDECL; -asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET; -asset GfxImage ASSET_TYPE_IMAGE; -asset snd_alias_list_t ASSET_TYPE_SOUND; -asset SndCurve ASSET_TYPE_SOUND_CURVE; -asset LoadedSound ASSET_TYPE_LOADED_SOUND; -asset clipMap_t ASSET_TYPE_CLIPMAP_MP; -asset ComWorld ASSET_TYPE_COMWORLD; -asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP; -asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP; -asset MapEnts ASSET_TYPE_MAP_ENTS; -asset FxWorld ASSET_TYPE_FXWORLD; -asset GfxWorld ASSET_TYPE_GFXWORLD; -asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -asset Font_s ASSET_TYPE_FONT; -asset MenuList ASSET_TYPE_MENULIST; -asset menuDef_t ASSET_TYPE_MENU; -asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; -asset WeaponCompleteDef ASSET_TYPE_WEAPON; -asset FxEffectDef ASSET_TYPE_FX; -asset FxImpactTable ASSET_TYPE_IMPACT_FX; -asset RawFile ASSET_TYPE_RAWFILE; -asset StringTable ASSET_TYPE_STRINGTABLE; -asset LeaderboardDef ASSET_TYPE_LEADERBOARD; -asset StructuredDataDefSet ASSET_TYPE_STRUCTURED_DATA_DEF; -asset TracerDef ASSET_TYPE_TRACER; -asset VehicleDef ASSET_TYPE_VEHICLE; -asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS; +asset PhysPreset AssetPhysPreset; +asset PhysCollmap AssetPhysCollMap; +asset XAnimParts AssetXAnim; +asset XModel AssetXModel; +asset Material AssetMaterial; +asset MaterialPixelShader AssetPixelShader; +asset MaterialVertexShader AssetVertexShader; +asset MaterialVertexDeclaration AssetVertexDecl; +asset MaterialTechniqueSet AssetTechniqueSet; +asset GfxImage AssetImage; +asset snd_alias_list_t AssetSound; +asset SndCurve AssetSoundCurve; +asset LoadedSound AssetLoadedSound; +asset clipMap_t AssetClipMapMp; +asset ComWorld AssetComWorld; +asset GameWorldSp AssetGameWorldSp; +asset GameWorldMp AssetGameWorldMp; +asset MapEnts AssetMapEnts; +asset FxWorld AssetFxWorld; +asset GfxWorld AssetGfxWorld; +asset GfxLightDef AssetLightDef; +asset Font_s AssetFont; +asset MenuList AssetMenuList; +asset menuDef_t AssetMenu; +asset LocalizeEntry AssetLocalize; +asset WeaponCompleteDef AssetWeapon; +asset FxEffectDef AssetFx; +asset FxImpactTable AssetImpactFx; +asset RawFile AssetRawFile; +asset StringTable AssetStringTable; +asset LeaderboardDef AssetLeaderboard; +asset StructuredDataDefSet AssetStructuredDataDef; +asset TracerDef AssetTracer; +asset VehicleDef AssetVehicle; +asset AddonMapEnts AssetAddonMapEnts; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -85,4 +85,3 @@ block normal XFILE_BLOCK_INDEX; #include "XAssets/VehicleDef.txt" #include "XAssets/AddonMapEnts.txt" -// EOF \ No newline at end of file diff --git a/src/ZoneCode/Game/IW5/IW5_Commands.txt b/src/ZoneCode/Game/IW5/IW5_Commands.txt index eb5fae8a..e523ce91 100644 --- a/src/ZoneCode/Game/IW5/IW5_Commands.txt +++ b/src/ZoneCode/Game/IW5/IW5_Commands.txt @@ -3,46 +3,46 @@ game IW5; architecture x86; // Game Assets -asset PhysPreset ASSET_TYPE_PHYSPRESET; -asset PhysCollmap ASSET_TYPE_PHYSCOLLMAP; -asset XAnimParts ASSET_TYPE_XANIMPARTS; -asset XModelSurfs ASSET_TYPE_XMODEL_SURFS; -asset XModel ASSET_TYPE_XMODEL; -asset Material ASSET_TYPE_MATERIAL; -asset MaterialPixelShader ASSET_TYPE_PIXELSHADER; -asset MaterialVertexShader ASSET_TYPE_VERTEXSHADER; -asset MaterialVertexDeclaration ASSET_TYPE_VERTEXDECL; -asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET; -asset GfxImage ASSET_TYPE_IMAGE; -asset snd_alias_list_t ASSET_TYPE_SOUND; -asset SndCurve ASSET_TYPE_SOUND_CURVE; -asset LoadedSound ASSET_TYPE_LOADED_SOUND; -asset clipMap_t ASSET_TYPE_CLIPMAP; -asset ComWorld ASSET_TYPE_COMWORLD; -asset GlassWorld ASSET_TYPE_GLASSWORLD; -asset PathData ASSET_TYPE_PATHDATA; -asset VehicleTrack ASSET_TYPE_VEHICLE_TRACK; -asset MapEnts ASSET_TYPE_MAP_ENTS; -asset FxWorld ASSET_TYPE_FXWORLD; -asset GfxWorld ASSET_TYPE_GFXWORLD; -asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -asset Font_s ASSET_TYPE_FONT; -asset MenuList ASSET_TYPE_MENULIST; -asset menuDef_t ASSET_TYPE_MENU; -asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; -asset WeaponAttachment ASSET_TYPE_ATTACHMENT; -asset WeaponCompleteDef ASSET_TYPE_WEAPON; -asset FxEffectDef ASSET_TYPE_FX; -asset FxImpactTable ASSET_TYPE_IMPACT_FX; -asset SurfaceFxTable ASSET_TYPE_SURFACE_FX; -asset RawFile ASSET_TYPE_RAWFILE; -asset ScriptFile ASSET_TYPE_SCRIPTFILE; -asset StringTable ASSET_TYPE_STRINGTABLE; -asset LeaderboardDef ASSET_TYPE_LEADERBOARD; -asset StructuredDataDefSet ASSET_TYPE_STRUCTURED_DATA_DEF; -asset TracerDef ASSET_TYPE_TRACER; -asset VehicleDef ASSET_TYPE_VEHICLE; -asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS; +asset PhysPreset AssetPhysPreset; +asset PhysCollmap AssetPhysCollMap; +asset XAnimParts AssetXAnim; +asset XModelSurfs AssetXModelSurfs; +asset XModel AssetXModel; +asset Material AssetMaterial; +asset MaterialPixelShader AssetPixelShader; +asset MaterialVertexShader AssetVertexShader; +asset MaterialVertexDeclaration AssetVertexDecl; +asset MaterialTechniqueSet AssetTechniqueSet; +asset GfxImage AssetImage; +asset snd_alias_list_t AssetSound; +asset SndCurve AssetSoundCurve; +asset LoadedSound AssetLoadedSound; +asset clipMap_t AssetClipMap; +asset ComWorld AssetComWorld; +asset GlassWorld AssetGlassWorld; +asset PathData AssetPathData; +asset VehicleTrack AssetVehicleTrack; +asset MapEnts AssetMapEnts; +asset FxWorld AssetFxWorld; +asset GfxWorld AssetGfxWorld; +asset GfxLightDef AssetLightDef; +asset Font_s AssetFont; +asset MenuList AssetMenuList; +asset menuDef_t AssetMenu; +asset LocalizeEntry AssetLocalize; +asset WeaponAttachment AssetAttachment; +asset WeaponCompleteDef AssetWeapon; +asset FxEffectDef AssetFx; +asset FxImpactTable AssetImpactFx; +asset SurfaceFxTable AssetSurfaceFx; +asset RawFile AssetRawFile; +asset ScriptFile AssetScript; +asset StringTable AssetStringTable; +asset LeaderboardDef AssetLeaderboard; +asset StructuredDataDefSet AssetStructuredDataDef; +asset TracerDef AssetTracer; +asset VehicleDef AssetVehicle; +asset AddonMapEnts AssetAddonMapEnts; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -96,4 +96,3 @@ block normal XFILE_BLOCK_SCRIPT; #include "XAssets/VehicleDef.txt" #include "XAssets/AddonMapEnts.txt" -// EOF \ No newline at end of file diff --git a/src/ZoneCode/Game/T5/T5_Commands.txt b/src/ZoneCode/Game/T5/T5_Commands.txt index 0613abc4..977e4b0b 100644 --- a/src/ZoneCode/Game/T5/T5_Commands.txt +++ b/src/ZoneCode/Game/T5/T5_Commands.txt @@ -3,38 +3,38 @@ game T5; architecture x86; // Game Assets -asset PhysPreset ASSET_TYPE_PHYSPRESET; -asset PhysConstraints ASSET_TYPE_PHYSCONSTRAINTS; -asset DestructibleDef ASSET_TYPE_DESTRUCTIBLEDEF; -asset XAnimParts ASSET_TYPE_XANIMPARTS; -asset XModel ASSET_TYPE_XMODEL; -asset Material ASSET_TYPE_MATERIAL; -asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET; -asset GfxImage ASSET_TYPE_IMAGE; -asset SndBank ASSET_TYPE_SOUND; -asset SndPatch ASSET_TYPE_SOUND_PATCH; -asset clipMap_t ASSET_TYPE_CLIPMAP_PVS; -asset ComWorld ASSET_TYPE_COMWORLD; -asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP; -asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP; -asset MapEnts ASSET_TYPE_MAP_ENTS; -asset GfxWorld ASSET_TYPE_GFXWORLD; -asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -asset Font_s ASSET_TYPE_FONT; -asset MenuList ASSET_TYPE_MENULIST; -asset menuDef_t ASSET_TYPE_MENU; -asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; -asset WeaponVariantDef ASSET_TYPE_WEAPON; -asset SndDriverGlobals ASSET_TYPE_SNDDRIVER_GLOBALS; -asset FxEffectDef ASSET_TYPE_FX; -asset FxImpactTable ASSET_TYPE_IMPACT_FX; -asset RawFile ASSET_TYPE_RAWFILE; -asset StringTable ASSET_TYPE_STRINGTABLE; -asset PackIndex ASSET_TYPE_PACK_INDEX; -asset XGlobals ASSET_TYPE_XGLOBALS; -asset ddlRoot_t ASSET_TYPE_DDL; -asset Glasses ASSET_TYPE_GLASSES; -asset EmblemSet ASSET_TYPE_EMBLEMSET; +asset PhysPreset AssetPhysPreset; +asset PhysConstraints AssetPhysConstraints; +asset DestructibleDef AssetDestructibleDef; +asset XAnimParts AssetXAnim; +asset XModel AssetXModel; +asset Material AssetMaterial; +asset MaterialTechniqueSet AssetTechniqueSet; +asset GfxImage AssetImage; +asset SndBank AssetSoundBank; +asset SndPatch AssetSoundPatch; +asset clipMap_t AssetClipMapPvs; +asset ComWorld AssetComWorld; +asset GameWorldSp AssetGameWorldSp; +asset GameWorldMp AssetGameWorldMp; +asset MapEnts AssetMapEnts; +asset GfxWorld AssetGfxWorld; +asset GfxLightDef AssetLightDef; +asset Font_s AssetFont; +asset MenuList AssetMenuList; +asset menuDef_t AssetMenu; +asset LocalizeEntry AssetLocalize; +asset WeaponVariantDef AssetWeapon; +asset SndDriverGlobals AssetSoundDriverGlobals; +asset FxEffectDef AssetFx; +asset FxImpactTable AssetImpactFx; +asset RawFile AssetRawFile; +asset StringTable AssetStringTable; +asset PackIndex AssetPackIndex; +asset XGlobals AssetXGlobals; +asset ddlRoot_t AssetDDL; +asset Glasses AssetGlasses; +asset EmblemSet AssetEmblemSet; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -79,4 +79,3 @@ block normal XFILE_BLOCK_PHYSICAL; #include "XAssets/Glasses.txt" #include "XAssets/EmblemSet.txt" -// EOF \ No newline at end of file diff --git a/src/ZoneCode/Game/T6/T6_Commands.txt b/src/ZoneCode/Game/T6/T6_Commands.txt index 3bd115d1..80edd659 100644 --- a/src/ZoneCode/Game/T6/T6_Commands.txt +++ b/src/ZoneCode/Game/T6/T6_Commands.txt @@ -3,54 +3,54 @@ game T6; architecture x86; // Game Assets -asset PhysPreset ASSET_TYPE_PHYSPRESET; -asset PhysConstraints ASSET_TYPE_PHYSCONSTRAINTS; -asset DestructibleDef ASSET_TYPE_DESTRUCTIBLEDEF; -asset XAnimParts ASSET_TYPE_XANIMPARTS; -asset XModel ASSET_TYPE_XMODEL; -asset Material ASSET_TYPE_MATERIAL; -asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET; -asset GfxImage ASSET_TYPE_IMAGE; -asset SndBank ASSET_TYPE_SOUND; -asset SndPatch ASSET_TYPE_SOUND_PATCH; -asset clipMap_t ASSET_TYPE_CLIPMAP_PVS; -asset ComWorld ASSET_TYPE_COMWORLD; -asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP; -asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP; -asset MapEnts ASSET_TYPE_MAP_ENTS; -asset GfxWorld ASSET_TYPE_GFXWORLD; -asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -asset Font_s ASSET_TYPE_FONT; -asset FontIcon ASSET_TYPE_FONTICON; -asset MenuList ASSET_TYPE_MENULIST; -asset menuDef_t ASSET_TYPE_MENU; -asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; -asset WeaponVariantDef ASSET_TYPE_WEAPON; -asset WeaponAttachment ASSET_TYPE_ATTACHMENT; -asset WeaponAttachmentUnique ASSET_TYPE_ATTACHMENT_UNIQUE; -asset WeaponCamo ASSET_TYPE_WEAPON_CAMO; -asset SndDriverGlobals ASSET_TYPE_SNDDRIVER_GLOBALS; -asset FxEffectDef ASSET_TYPE_FX; -asset FxImpactTable ASSET_TYPE_IMPACT_FX; -asset RawFile ASSET_TYPE_RAWFILE; -asset StringTable ASSET_TYPE_STRINGTABLE; -asset LeaderboardDef ASSET_TYPE_LEADERBOARD; -asset XGlobals ASSET_TYPE_XGLOBALS; -asset ddlRoot_t ASSET_TYPE_DDL; -asset Glasses ASSET_TYPE_GLASSES; -asset EmblemSet ASSET_TYPE_EMBLEMSET; -asset ScriptParseTree ASSET_TYPE_SCRIPTPARSETREE; -asset KeyValuePairs ASSET_TYPE_KEYVALUEPAIRS; -asset VehicleDef ASSET_TYPE_VEHICLEDEF; -asset MemoryBlock ASSET_TYPE_MEMORYBLOCK; -asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS; -asset TracerDef ASSET_TYPE_TRACER; -asset SkinnedVertsDef ASSET_TYPE_SKINNEDVERTS; -asset Qdb ASSET_TYPE_QDB; -asset Slug ASSET_TYPE_SLUG; -asset FootstepTableDef ASSET_TYPE_FOOTSTEP_TABLE; -asset FootstepFXTableDef ASSET_TYPE_FOOTSTEPFX_TABLE; -asset ZBarrierDef ASSET_TYPE_ZBARRIER; +asset PhysPreset AssetPhysPreset; +asset PhysConstraints AssetPhysConstraints; +asset DestructibleDef AssetDestructibleDef; +asset XAnimParts AssetXAnim; +asset XModel AssetXModel; +asset Material AssetMaterial; +asset MaterialTechniqueSet AssetTechniqueSet; +asset GfxImage AssetImage; +asset SndBank AssetSoundBank; +asset SndPatch AssetSoundPatch; +asset clipMap_t AssetClipMapPvs; +asset ComWorld AssetComWorld; +asset GameWorldSp AssetGameWorldSp; +asset GameWorldMp AssetGameWorldMp; +asset MapEnts AssetMapEnts; +asset GfxWorld AssetGfxWorld; +asset GfxLightDef AssetLightDef; +asset Font_s AssetFont; +asset FontIcon AssetFontIcon; +asset MenuList AssetMenuList; +asset menuDef_t AssetMenu; +asset LocalizeEntry AssetLocalize; +asset WeaponVariantDef AssetWeapon; +asset WeaponAttachment AssetAttachment; +asset WeaponAttachmentUnique AssetAttachmentUnique; +asset WeaponCamo AssetWeaponCamo; +asset SndDriverGlobals AssetSoundDriverGlobals; +asset FxEffectDef AssetFx; +asset FxImpactTable AssetImpactFx; +asset RawFile AssetRawFile; +asset StringTable AssetStringTable; +asset LeaderboardDef AssetLeaderboard; +asset XGlobals AssetXGlobals; +asset ddlRoot_t AssetDDL; +asset Glasses AssetGlasses; +asset EmblemSet AssetEmblemSet; +asset ScriptParseTree AssetScript; +asset KeyValuePairs AssetKeyValuePairs; +asset VehicleDef AssetVehicle; +asset MemoryBlock AssetMemoryBlock; +asset AddonMapEnts AssetAddonMapEnts; +asset TracerDef AssetTracer; +asset SkinnedVertsDef AssetSkinnedVerts; +asset Qdb AssetQdb; +asset Slug AssetSlug; +asset FootstepTableDef AssetFootstepTable; +asset FootstepFXTableDef AssetFootstepFxTable; +asset ZBarrierDef AssetZBarrier; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -112,4 +112,3 @@ block normal XFILE_BLOCK_STREAMER_RESERVE; #include "XAssets/FootstepFXTableDef.txt" #include "XAssets/ZBarrierDef.txt" -// EOF \ No newline at end of file diff --git a/src/ZoneCodeGeneratorLib/Domain/Computations/StructureComputations.cpp b/src/ZoneCodeGeneratorLib/Domain/Computations/StructureComputations.cpp index 60dae011..2d732aaf 100644 --- a/src/ZoneCodeGeneratorLib/Domain/Computations/StructureComputations.cpp +++ b/src/ZoneCodeGeneratorLib/Domain/Computations/StructureComputations.cpp @@ -12,7 +12,7 @@ StructureComputations::StructureComputations(const StructureInformation* structu bool StructureComputations::IsAsset() const { - return m_info->m_asset_enum_entry != nullptr; + return !m_info->m_asset_name.empty(); } MemberInformation* StructureComputations::GetDynamicMember() const diff --git a/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.cpp b/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.cpp index da546082..9959c1be 100644 --- a/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.cpp +++ b/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.cpp @@ -2,7 +2,6 @@ StructureInformation::StructureInformation(DefinitionWithMembers* definition) : m_definition(definition), - m_asset_enum_entry(nullptr), m_is_leaf(false), m_requires_marking(false), m_has_matching_cross_platform_structure(false), diff --git a/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.h b/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.h index 2abb0b76..5761e3d2 100644 --- a/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.h +++ b/src/ZoneCodeGeneratorLib/Domain/Information/StructureInformation.h @@ -16,8 +16,8 @@ class StructureInformation public: explicit StructureInformation(DefinitionWithMembers* definition); - DefinitionWithMembers* const m_definition; - EnumMember* m_asset_enum_entry; + DefinitionWithMembers* m_definition; + std::string m_asset_name; std::vector m_usages; std::vector> m_ordered_members; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp index 6493a0cd..90d48527 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp @@ -262,7 +262,7 @@ namespace LINEF("{0}::{0}(Zone* zone, IZoneInputStream* stream)", LoaderClassName(m_env.m_asset)) m_intendation++; - LINE_STARTF(": AssetLoader({0}, zone, stream)", m_env.m_asset->m_asset_enum_entry->m_name) + LINE_STARTF(": AssetLoader({0}::EnumEntry, zone, stream)", m_env.m_asset->m_asset_name) if (m_env.m_has_actions) { LINE_MIDDLE(", m_actions(zone)") diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp index 688c44ee..28d4d21d 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp @@ -245,7 +245,7 @@ namespace LINEF("{0}::{0}(Zone* zone)", MarkerClassName(m_env.m_asset)) m_intendation++; - LINEF(": AssetMarker({0}, zone)", m_env.m_asset->m_asset_enum_entry->m_name) + LINEF(": AssetMarker({0}::EnumEntry, zone)", m_env.m_asset->m_asset_name) m_intendation--; LINE("{") diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp index 0cc2a1cf..96155c89 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp @@ -261,7 +261,7 @@ namespace "{0}::{0}({1}* asset, const Zone& zone, IZoneOutputStream& stream)", WriterClassName(m_env.m_asset), m_env.m_asset->m_definition->GetFullName()) m_intendation++; - LINEF(": AssetWriter(zone.m_pools->GetAssetOrAssetReference({0}, GetAssetName(asset)), zone, stream)", m_env.m_asset->m_asset_enum_entry->m_name) + LINEF(": AssetWriter(zone.m_pools->GetAssetOrAssetReference({0}::EnumEntry, GetAssetName(asset)), zone, stream)", m_env.m_asset->m_asset_name) m_intendation--; LINE("{") diff --git a/src/ZoneCodeGeneratorLib/Parsing/Commands/Sequence/SequenceAsset.cpp b/src/ZoneCodeGeneratorLib/Parsing/Commands/Sequence/SequenceAsset.cpp index ae856fca..84e78363 100644 --- a/src/ZoneCodeGeneratorLib/Parsing/Commands/Sequence/SequenceAsset.cpp +++ b/src/ZoneCodeGeneratorLib/Parsing/Commands/Sequence/SequenceAsset.cpp @@ -6,7 +6,7 @@ namespace { static constexpr auto CAPTURE_TYPE = 1; - static constexpr auto CAPTURE_ENUM_ENTRY = 2; + static constexpr auto CAPTURE_ASSET_NAME = 2; } // namespace SequenceAsset::SequenceAsset() @@ -17,7 +17,7 @@ SequenceAsset::SequenceAsset() AddMatchers({ create.Keyword("asset"), create.Label(CommandsCommonMatchers::LABEL_TYPENAME).Capture(CAPTURE_TYPE), - create.Identifier().Capture(CAPTURE_ENUM_ENTRY), + create.Identifier().Capture(CAPTURE_ASSET_NAME), create.Char(';'), }); } @@ -25,7 +25,7 @@ SequenceAsset::SequenceAsset() void SequenceAsset::ProcessMatch(CommandsParserState* state, SequenceResult& result) const { const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE); - const auto& enumEntryToken = result.NextCapture(CAPTURE_ENUM_ENTRY); + const auto& assetNameToken = result.NextCapture(CAPTURE_ASSET_NAME); auto* definition = state->GetRepository()->GetDataDefinitionByName(typeNameToken.TypeNameValue()); if (definition == nullptr) @@ -39,9 +39,7 @@ void SequenceAsset::ProcessMatch(CommandsParserState* state, SequenceResultGetRepository()->GetEnumMemberByName(enumEntryToken.IdentifierValue()); - if (enumMember == nullptr) - throw ParsingException(enumEntryToken.GetPos(), "Unknown enum entry"); - - information->m_asset_enum_entry = enumMember; + information->m_asset_name = assetNameToken.IdentifierValue(); + if (information->m_asset_name.empty()) + throw ParsingException(assetNameToken.GetPos(), "Asset name is empty"); } diff --git a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp index 1c964928..137beb7a 100644 --- a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp +++ b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp @@ -10,12 +10,12 @@ namespace { bool CalculateRequiresMarking(std::unordered_set& visitedStructures, StructureInformation* info) { - if (visitedStructures.find(info) != visitedStructures.end()) + if (visitedStructures.contains(info)) return info->m_requires_marking; visitedStructures.emplace(info); - if (info->m_asset_enum_entry) + if (StructureComputations(info).IsAsset()) { info->m_requires_marking = true; return true; @@ -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 && member->m_type->m_asset_enum_entry) + if (member->m_is_script_string || member->m_asset_ref || member->m_type && StructureComputations(member->m_type).IsAsset()) { info->m_requires_marking = true; return true;