diff --git a/src/ZoneCode.lua b/src/ZoneCode.lua index d1aa9200..29c9a75d 100644 --- a/src/ZoneCode.lua +++ b/src/ZoneCode.lua @@ -229,11 +229,16 @@ function ZoneCode:allMarkFiles() result = {} for game, assets in pairs(self.Assets) do + + -- PerAsset for i, assetName in ipairs(assets) do local assetNameLower = string.lower(assetName) table.insert(result, "%{wks.location}/src/ZoneCode/Game/" .. game .. "/XAssets/" .. assetNameLower .. "/" .. assetNameLower .. "_mark_db.cpp") table.insert(result, "%{wks.location}/src/ZoneCode/Game/" .. game .. "/XAssets/" .. assetNameLower .. "/" .. assetNameLower .. "_mark_db.h") end + + -- PerTemplate + table.insert(result, "%{wks.location}/src/ZoneCode/Game/" .. game .. "/AssetMarker" .. game .. ".h") end return result @@ -320,11 +325,11 @@ function ZoneCode:project() .. ' --no-color' .. ' -h "' .. path.join(path.getabsolute(ProjectFolder()), 'ZoneCode/Game/%{file.basename}/%{file.basename}_ZoneCode.h') .. '"' .. ' -c "' .. path.join(path.getabsolute(ProjectFolder()), 'ZoneCode/Game/%{file.basename}/%{file.basename}_Commands.txt') .. '"' - .. ' -o "%{wks.location}/src/ZoneCode/Game/%{file.basename}/XAssets"' - .. ' -g "*" ZoneLoad' - .. ' -g "*" ZoneMark' - .. ' -g "*" ZoneWrite' - .. ' -g "*" AssetStructTests' + .. ' -o "%{wks.location}/src/ZoneCode/Game/%{file.basename}"' + .. ' -g ZoneLoad' + .. ' -g ZoneMark' + .. ' -g ZoneWrite' + .. ' -g AssetStructTests' } buildinputs { path.join(ProjectFolder(), "ZoneCode/Game/%{file.basename}/%{file.basename}_ZoneCode.h"), diff --git a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp index 38064100..00439e85 100644 --- a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.cpp @@ -6,11 +6,11 @@ #include "Templates/ZoneMarkTemplate.h" #include "Templates/ZoneWriteTemplate.h" #include "Utils/Logging/Log.h" +#include "Utils/StringUtils.h" #include #include #include -#include namespace fs = std::filesystem; @@ -28,9 +28,9 @@ void CodeGenerator::SetupTemplates() m_template_mapping["assetstructtests"] = std::make_unique(); } -bool CodeGenerator::GenerateCodeForTemplate(const RenderingContext& context, ICodeTemplate* codeTemplate) const +bool CodeGenerator::GenerateCodeOncePerTemplate(const OncePerTemplateRenderingContext& context, ICodeTemplate* codeTemplate) const { - for (const auto& codeFile : codeTemplate->GetFilesToRender(context)) + for (const auto& codeFile : codeTemplate->GetFilesToRenderOncePerTemplate(context)) { fs::path p(m_args->m_output_directory); p.append(codeFile.m_file_name); @@ -47,7 +47,7 @@ bool CodeGenerator::GenerateCodeForTemplate(const RenderingContext& context, ICo return false; } - codeTemplate->RenderFile(stream, codeFile.m_tag, context); + codeTemplate->RenderOncePerTemplateFile(stream, codeFile.m_tag, context); stream.close(); } @@ -55,7 +55,34 @@ bool CodeGenerator::GenerateCodeForTemplate(const RenderingContext& context, ICo return true; } -bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::string& name, StructureInformation*& asset) +bool CodeGenerator::GenerateCodeOncePerAsset(const OncePerAssetRenderingContext& context, ICodeTemplate* codeTemplate) const +{ + for (const auto& codeFile : codeTemplate->GetFilesToRenderOncePerAsset(context)) + { + fs::path p(m_args->m_output_directory); + p.append(codeFile.m_file_name); + + auto parentFolder(p); + parentFolder.remove_filename(); + create_directories(parentFolder); + + std::ofstream stream(p, std::fstream::out | std::fstream::binary); + + if (!stream.is_open()) + { + con::error("Failed to open file '{}'", p.string()); + return false; + } + + codeTemplate->RenderOncePerAssetFile(stream, codeFile.m_tag, context); + + stream.close(); + } + + return true; +} + +bool CodeGenerator::GetAssetWithName(const IDataRepository* repository, const std::string& name, StructureInformation*& asset) { auto* def = repository->GetDataDefinitionByName(name); if (def == nullptr) @@ -64,7 +91,7 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str return false; } - auto* defWithMembers = dynamic_cast(def); + const auto* defWithMembers = dynamic_cast(def); asset = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr; if (asset == nullptr) { @@ -81,7 +108,7 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str return true; } -bool CodeGenerator::GenerateCode(IDataRepository* repository) +bool CodeGenerator::GenerateCode(const IDataRepository* repository) { std::vector assets; @@ -93,42 +120,39 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository) } const auto start = std::chrono::steady_clock::now(); - for (const auto& generationTask : m_args->m_generation_tasks) + for (const auto& templateName : m_args->m_template_names) { - auto templateName = generationTask.m_template_name; - for (auto& c : templateName) - c = static_cast(tolower(c)); + std::string lowerTemplateName(templateName); + utils::MakeStringLowerCase(lowerTemplateName); - const auto foundTemplate = m_template_mapping.find(templateName); + const auto foundTemplate = m_template_mapping.find(lowerTemplateName); if (foundTemplate == m_template_mapping.end()) { - con::error("Unknown template '{}'.", generationTask.m_template_name); + con::error("Unknown template '{}'", templateName); return false; } - if (generationTask.m_all_assets) + for (auto* asset : assets) { - for (auto* asset : assets) + auto context = OncePerAssetRenderingContext::BuildContext(repository, asset); + if (!GenerateCodeOncePerAsset(*context, foundTemplate->second.get())) { - auto context = RenderingContext::BuildContext(repository, asset); - if (!GenerateCodeForTemplate(*context, foundTemplate->second.get())) - { - con::error("Failed to generate code for asset '{}' with preset '{}'", asset->m_definition->GetFullName(), foundTemplate->first); - return false; - } - - con::info("Successfully generated code for asset '{}' with preset '{}'", asset->m_definition->GetFullName(), foundTemplate->first); + con::error("Failed to generate code for asset '{}' with preset '{}'", asset->m_definition->GetFullName(), foundTemplate->first); + return false; } - } - else - { - StructureInformation* asset; - if (!GetAssetWithName(repository, generationTask.m_asset_name, asset)) - return false; - auto context = RenderingContext::BuildContext(repository, asset); - if (!GenerateCodeForTemplate(*context, foundTemplate->second.get())) + con::info("Successfully generated code for asset '{}' with preset '{}'", asset->m_definition->GetFullName(), foundTemplate->first); + } + + { + auto context = OncePerTemplateRenderingContext::BuildContext(repository); + if (!GenerateCodeOncePerTemplate(*context, foundTemplate->second.get())) + { + con::error("Failed to generate code with preset '{}'", foundTemplate->first); return false; + } + + con::info("Successfully generated code with preset '{}'", foundTemplate->first); } } const auto end = std::chrono::steady_clock::now(); diff --git a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h index c1b45b7d..727f12e6 100644 --- a/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h +++ b/src/ZoneCodeGeneratorLib/Generating/CodeGenerator.h @@ -12,13 +12,15 @@ class CodeGenerator public: explicit CodeGenerator(const ZoneCodeGeneratorArguments* args); - bool GenerateCode(IDataRepository* repository); + bool GenerateCode(const IDataRepository* repository); private: void SetupTemplates(); - bool GenerateCodeForTemplate(const RenderingContext& context, ICodeTemplate* codeTemplate) const; - static bool GetAssetWithName(IDataRepository* repository, const std::string& name, StructureInformation*& asset); + bool GenerateCodeOncePerTemplate(const OncePerTemplateRenderingContext& context, ICodeTemplate* codeTemplate) const; + bool GenerateCodeOncePerAsset(const OncePerAssetRenderingContext& context, ICodeTemplate* codeTemplate) const; + + static bool GetAssetWithName(const IDataRepository* repository, const std::string& name, StructureInformation*& asset); const ZoneCodeGeneratorArguments* m_args; std::unordered_map> m_template_mapping; diff --git a/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h b/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h index 4c1c9992..37be54d6 100644 --- a/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/ICodeTemplate.h @@ -1,22 +1,25 @@ #pragma once -#include "RenderingContext.h" +#include "OncePerAssetRenderingContext.h" +#include "OncePerTemplateRenderingContext.h" #include #include #include +typedef unsigned CodeTemplateFileTag; + class CodeTemplateFile { public: - CodeTemplateFile(std::string fileName, const int tag) + CodeTemplateFile(std::string fileName, const CodeTemplateFileTag tag) : m_file_name(std::move(fileName)), m_tag(tag) { } std::string m_file_name; - int m_tag; + CodeTemplateFileTag m_tag; }; class ICodeTemplate @@ -29,6 +32,17 @@ public: ICodeTemplate& operator=(const ICodeTemplate& other) = default; ICodeTemplate& operator=(ICodeTemplate&& other) noexcept = default; - virtual std::vector GetFilesToRender(const RenderingContext& context) = 0; - virtual void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) = 0; + virtual std::vector GetFilesToRenderOncePerTemplate(const OncePerTemplateRenderingContext& context) + { + return {}; + } + + virtual void RenderOncePerTemplateFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerTemplateRenderingContext& context) {} + + virtual std::vector GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) + { + return {}; + } + + virtual void RenderOncePerAssetFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) {} }; diff --git a/src/ZoneCodeGeneratorLib/Generating/RenderingContext.cpp b/src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.cpp similarity index 80% rename from src/ZoneCodeGeneratorLib/Generating/RenderingContext.cpp rename to src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.cpp index 189c53c9..1eed2adf 100644 --- a/src/ZoneCodeGeneratorLib/Generating/RenderingContext.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.cpp @@ -1,4 +1,4 @@ -#include "RenderingContext.h" +#include "OncePerAssetRenderingContext.h" #include "Domain/Computations/MemberComputations.h" #include "Domain/Computations/StructureComputations.h" @@ -18,7 +18,9 @@ RenderingUsedType::RenderingUsedType(const DataDefinition* type, StructureInform { } -RenderingContext::RenderingContext(std::string game, const Architecture gameArchitecture, std::vector fastFileBlocks) +OncePerAssetRenderingContext::OncePerAssetRenderingContext(std::string game, + const Architecture gameArchitecture, + std::vector fastFileBlocks) : m_game(std::move(game)), m_architecture_mismatch(gameArchitecture != OWN_ARCHITECTURE), m_pointer_size(GetPointerSizeForArchitecture(gameArchitecture)), @@ -40,7 +42,7 @@ RenderingContext::RenderingContext(std::string game, const Architecture gameArch } } -RenderingUsedType* RenderingContext::AddUsedType(std::unique_ptr usedType) +RenderingUsedType* OncePerAssetRenderingContext::AddUsedType(std::unique_ptr usedType) { auto* result = usedType.get(); m_used_types.push_back(usedType.get()); @@ -49,7 +51,7 @@ RenderingUsedType* RenderingContext::AddUsedType(std::unique_ptrm_type->GetType() == DataDefinitionType::TYPEDEF) { @@ -77,7 +79,7 @@ RenderingUsedType* RenderingContext::GetBaseType(const IDataRepository* reposito return nullptr; } -void RenderingContext::AddMembersToContext(const IDataRepository* repository, StructureInformation* info) +void OncePerAssetRenderingContext::AddMembersToContext(const IDataRepository* repository, StructureInformation* info) { for (const auto& member : info->m_ordered_members) { @@ -121,7 +123,7 @@ void RenderingContext::AddMembersToContext(const IDataRepository* repository, St } } -void RenderingContext::ScanUsedTypeIfNeeded(const IDataRepository* repository, MemberComputations* computations, RenderingUsedType* usedType) +void OncePerAssetRenderingContext::ScanUsedTypeIfNeeded(const IDataRepository* repository, MemberComputations* computations, RenderingUsedType* usedType) { if (usedType->m_info != nullptr && !StructureComputations(usedType->m_info).IsAsset() && !computations->IsInRuntimeBlock() && !usedType->m_members_loaded) { @@ -130,7 +132,7 @@ void RenderingContext::ScanUsedTypeIfNeeded(const IDataRepository* repository, M } } -void RenderingContext::MakeAsset(const IDataRepository* repository, StructureInformation* asset) +void OncePerAssetRenderingContext::MakeAsset(const IDataRepository* repository, StructureInformation* asset) { m_asset = asset; AddUsedType(std::make_unique(asset->m_definition, asset)); @@ -138,7 +140,7 @@ void RenderingContext::MakeAsset(const IDataRepository* repository, StructureInf AddMembersToContext(repository, asset); } -void RenderingContext::CreateUsedTypeCollections() +void OncePerAssetRenderingContext::CreateUsedTypeCollections() { for (auto* usedType : m_used_types) { @@ -165,7 +167,7 @@ void RenderingContext::CreateUsedTypeCollections() } } -bool RenderingContext::UsedTypeHasActions(const RenderingUsedType* usedType) const +bool OncePerAssetRenderingContext::UsedTypeHasActions(const RenderingUsedType* usedType) const { const StructureComputations computations(usedType->m_info); @@ -190,10 +192,10 @@ bool RenderingContext::UsedTypeHasActions(const RenderingUsedType* usedType) con return false; } -std::unique_ptr RenderingContext::BuildContext(const IDataRepository* repository, StructureInformation* asset) +std::unique_ptr OncePerAssetRenderingContext::BuildContext(const IDataRepository* repository, StructureInformation* asset) { - auto context = - std::make_unique(RenderingContext(repository->GetGameName(), repository->GetArchitecture(), repository->GetAllFastFileBlocks())); + auto context = std::make_unique( + OncePerAssetRenderingContext(repository->GetGameName(), repository->GetArchitecture(), repository->GetAllFastFileBlocks())); context->MakeAsset(repository, asset); context->CreateUsedTypeCollections(); diff --git a/src/ZoneCodeGeneratorLib/Generating/RenderingContext.h b/src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.h similarity index 86% rename from src/ZoneCodeGeneratorLib/Generating/RenderingContext.h rename to src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.h index d6587718..62bb914a 100644 --- a/src/ZoneCodeGeneratorLib/Generating/RenderingContext.h +++ b/src/ZoneCodeGeneratorLib/Generating/OncePerAssetRenderingContext.h @@ -24,10 +24,10 @@ public: bool m_pointer_array_reference_is_reusable; }; -class RenderingContext +class OncePerAssetRenderingContext { public: - static std::unique_ptr BuildContext(const IDataRepository* repository, StructureInformation* asset); + static std::unique_ptr BuildContext(const IDataRepository* repository, StructureInformation* asset); std::string m_game; bool m_architecture_mismatch; @@ -45,7 +45,7 @@ public: const FastFileBlock* m_default_temp_block; private: - RenderingContext(std::string game, Architecture gameArchitecture, std::vector fastFileBlocks); + OncePerAssetRenderingContext(std::string game, Architecture gameArchitecture, std::vector fastFileBlocks); RenderingUsedType* AddUsedType(std::unique_ptr usedType); RenderingUsedType* GetBaseType(const IDataRepository* repository, MemberComputations* computations, RenderingUsedType* usedType); diff --git a/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.cpp b/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.cpp new file mode 100644 index 00000000..bbc2c17b --- /dev/null +++ b/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.cpp @@ -0,0 +1,44 @@ +#include "OncePerTemplateRenderingContext.h" + +#include "Domain/Computations/StructureComputations.h" + +#include + +OncePerTemplateRenderingContext::OncePerTemplateRenderingContext(std::string game, + const Architecture gameArchitecture, + std::vector fastFileBlocks, + std::vector assets) + : m_game(std::move(game)), + m_architecture_mismatch(gameArchitecture != OWN_ARCHITECTURE), + m_pointer_size(GetPointerSizeForArchitecture(gameArchitecture)), + m_blocks(std::move(fastFileBlocks)), + m_assets(std::move(assets)), + m_default_normal_block(nullptr), + m_default_temp_block(nullptr) +{ + for (const auto* block : m_blocks) + { + if (block->m_is_default) + { + if (block->m_type == FastFileBlockType::NORMAL && m_default_normal_block == nullptr) + m_default_normal_block = block; + else if (block->m_type == FastFileBlockType::TEMP && m_default_temp_block == nullptr) + m_default_temp_block = block; + } + } +} + +std::unique_ptr OncePerTemplateRenderingContext::BuildContext(const IDataRepository* repository) +{ + std::vector assetInformation; + for (auto* info : repository->GetAllStructureInformation()) + { + if (!StructureComputations(info).IsAsset()) + continue; + + assetInformation.emplace_back(info); + } + + return std::make_unique( + OncePerTemplateRenderingContext(repository->GetGameName(), repository->GetArchitecture(), repository->GetAllFastFileBlocks(), assetInformation)); +} diff --git a/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.h b/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.h new file mode 100644 index 00000000..8f619916 --- /dev/null +++ b/src/ZoneCodeGeneratorLib/Generating/OncePerTemplateRenderingContext.h @@ -0,0 +1,27 @@ +#pragma once + +#include "Persistence/IDataRepository.h" + +#include +#include + +class OncePerTemplateRenderingContext +{ +public: + static std::unique_ptr BuildContext(const IDataRepository* repository); + + std::string m_game; + bool m_architecture_mismatch; + unsigned m_pointer_size; + std::vector m_blocks; + std::vector m_assets; + + const FastFileBlock* m_default_normal_block; + const FastFileBlock* m_default_temp_block; + +private: + OncePerTemplateRenderingContext(std::string game, + Architecture gameArchitecture, + std::vector fastFileBlocks, + std::vector assets); +}; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp index 3237a9f6..f908d324 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.cpp @@ -11,22 +11,19 @@ namespace { constexpr int TAG_SOURCE = 1; - class Template final : BaseTemplate + class PerAsset final : BaseTemplate { public: - Template(std::ostream& stream, const RenderingContext& context) - : BaseTemplate(stream, context) + PerAsset(std::ostream& stream, const OncePerAssetRenderingContext& context) + : BaseTemplate(stream), + m_env(context) { } void Source() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINEF("#include \"Game/{0}/{0}.h\"", m_env.m_game) LINE("") LINE("#include ") @@ -78,24 +75,26 @@ namespace m_intendation--; LINE("}") } + + const OncePerAssetRenderingContext& m_env; }; } // namespace -std::vector AssetStructTestsTemplate::GetFilesToRender(const RenderingContext& context) +std::vector AssetStructTestsTemplate::GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) { std::vector files; auto assetName = context.m_asset->m_definition->m_name; utils::MakeStringLowerCase(assetName); - files.emplace_back(std::format("{0}/{0}_struct_test.cpp", assetName), TAG_SOURCE); + files.emplace_back(std::format("XAssets/{0}/{0}_struct_test.cpp", assetName), TAG_SOURCE); return files; } -void AssetStructTestsTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) +void AssetStructTestsTemplate::RenderOncePerAssetFile(std::ostream& stream, const CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) { - Template t(stream, context); + PerAsset t(stream, context); assert(fileTag == TAG_SOURCE); if (fileTag == TAG_SOURCE) diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h index 9713927a..9814cce9 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/AssetStructTestsTemplate.h @@ -1,9 +1,10 @@ #pragma once + #include "Generating/ICodeTemplate.h" class AssetStructTestsTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(const RenderingContext& context) override; - void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; + std::vector GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) override; + void RenderOncePerAssetFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp index 1a8ce438..89b535cb 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.cpp @@ -5,9 +5,8 @@ #include -BaseTemplate::BaseTemplate(std::ostream& stream, const RenderingContext& context) +BaseTemplate::BaseTemplate(std::ostream& stream) : m_out(stream), - m_env(context), m_intendation(0u) { } @@ -18,6 +17,17 @@ void BaseTemplate::DoIntendation() const m_out << INTENDATION; } +// clang-format off +void BaseTemplate::AddGeneratedHint() const +{ + LINE("// ====================================================================") + LINE("// This file has been generated by ZoneCodeGenerator.") + LINE("// Do not modify.") + LINE("// Any changes will be discarded when regenerating.") + LINE("// ====================================================================") + LINE("") +} // clang-format on + std::string BaseTemplate::Upper(std::string str) { for (auto& c : str) diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h index e9b8622a..fb01b398 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/Internal/BaseTemplate.h @@ -5,7 +5,6 @@ #include "Domain/Evaluation/OperandDynamic.h" #include "Domain/Evaluation/OperandStatic.h" #include "Domain/Evaluation/Operation.h" -#include "Generating/RenderingContext.h" #include #include @@ -15,10 +14,12 @@ class BaseTemplate protected: static constexpr auto INTENDATION = " "; - BaseTemplate(std::ostream& stream, const RenderingContext& context); + explicit BaseTemplate(std::ostream& stream); void DoIntendation() const; + void AddGeneratedHint() const; + static std::string Upper(std::string str); static std::string Lower(std::string str); static std::string MakeTypeVarName(const DataDefinition* def); @@ -37,7 +38,6 @@ protected: static std::string MakeEvaluation(const IEvaluation* evaluation); std::ostream& m_out; - const RenderingContext& m_env; unsigned m_intendation; private: diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp index d0283505..9a0f58ba 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp @@ -6,7 +6,6 @@ #include "Utils/StringUtils.h" #include -#include #include namespace @@ -14,22 +13,19 @@ namespace constexpr int TAG_HEADER = 1; constexpr int TAG_SOURCE = 2; - class Template final : BaseTemplate + class PerAsset final : BaseTemplate { public: - Template(std::ostream& stream, const RenderingContext& context) - : BaseTemplate(stream, context) + PerAsset(std::ostream& stream, const OncePerAssetRenderingContext& context) + : BaseTemplate(stream), + m_env(context) { } void Header() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINE("#pragma once") LINE("") LINEF("#include \"Game/{0}/{0}.h\"", m_env.m_game) @@ -137,12 +133,8 @@ namespace void Source() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINEF("#include \"{0}_load_db.h\"", Lower(m_env.m_asset->m_definition->m_name)) LINE("") LINEF("#include \"Game/{0}/AssetMarker{0}.h\"", m_env.m_game) @@ -2195,25 +2187,27 @@ namespace m_intendation--; LINE("}") } + + const OncePerAssetRenderingContext& m_env; }; } // namespace -std::vector ZoneLoadTemplate::GetFilesToRender(const RenderingContext& context) +std::vector ZoneLoadTemplate::GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) { std::vector files; auto assetName = context.m_asset->m_definition->m_name; utils::MakeStringLowerCase(assetName); - files.emplace_back(std::format("{0}/{0}_load_db.h", assetName), TAG_HEADER); - files.emplace_back(std::format("{0}/{0}_load_db.cpp", assetName), TAG_SOURCE); + files.emplace_back(std::format("XAssets/{0}/{0}_load_db.h", assetName), TAG_HEADER); + files.emplace_back(std::format("XAssets/{0}/{0}_load_db.cpp", assetName), TAG_SOURCE); return files; } -void ZoneLoadTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) +void ZoneLoadTemplate::RenderOncePerAssetFile(std::ostream& stream, const CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) { - Template t(stream, context); + PerAsset t(stream, context); if (fileTag == TAG_HEADER) { diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h index f44aa382..d269b57c 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.h @@ -1,9 +1,10 @@ #pragma once + #include "Generating/ICodeTemplate.h" class ZoneLoadTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(const RenderingContext& context) override; - void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; + std::vector GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) override; + void RenderOncePerAssetFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp index d43dafc2..4c29fcfc 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp @@ -12,23 +12,50 @@ namespace { constexpr int TAG_HEADER = 1; constexpr int TAG_SOURCE = 2; + constexpr int TAG_ALL_MARKERS = 3; - class Template final : BaseTemplate + class PerTemplate final : BaseTemplate { public: - Template(std::ostream& stream, const RenderingContext& context) - : BaseTemplate(stream, context) + PerTemplate(std::ostream& stream, const OncePerTemplateRenderingContext& context) + : BaseTemplate(stream), + m_env(context) + { + } + + void AllMarkers() const + { + AddGeneratedHint(); + + LINE("#pragma once") + LINE("") + + for (const auto* asset : m_env.m_assets) + { + auto lowerAssetName = asset->m_definition->m_name; + utils::MakeStringLowerCase(lowerAssetName); + + LINEF("#include \"Game/{0}/XAssets/{1}/{1}_mark_db.h\"", m_env.m_game, lowerAssetName) + } + } + + private: + const OncePerTemplateRenderingContext& m_env; + }; + + class PerAsset final : BaseTemplate + { + public: + PerAsset(std::ostream& stream, const OncePerAssetRenderingContext& context) + : BaseTemplate(stream), + m_env(context) { } void Header() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINE("#pragma once") LINE("") LINEF("#include \"Game/{0}/{0}.h\"", m_env.m_game) @@ -113,12 +140,8 @@ namespace void Source() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINEF("#include \"{0}_mark_db.h\"", Lower(m_env.m_asset->m_definition->m_name)) if (!m_env.m_referenced_assets.empty()) @@ -761,25 +784,44 @@ namespace m_intendation--; LINE("}") } + + const OncePerAssetRenderingContext& m_env; }; } // namespace -std::vector ZoneMarkTemplate::GetFilesToRender(const RenderingContext& context) +std::vector ZoneMarkTemplate::GetFilesToRenderOncePerTemplate(const OncePerTemplateRenderingContext& context) +{ + std::vector files; + + files.emplace_back(std::format("AssetMarker{0}.h", context.m_game), TAG_ALL_MARKERS); + + return files; +} + +void ZoneMarkTemplate::RenderOncePerTemplateFile(std::ostream& stream, const CodeTemplateFileTag fileTag, const OncePerTemplateRenderingContext& context) +{ + assert(fileTag == TAG_ALL_MARKERS); + + PerTemplate t(stream, context); + t.AllMarkers(); +} + +std::vector ZoneMarkTemplate::GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) { std::vector files; auto assetName = context.m_asset->m_definition->m_name; utils::MakeStringLowerCase(assetName); - files.emplace_back(std::format("{0}/{0}_mark_db.h", assetName), TAG_HEADER); - files.emplace_back(std::format("{0}/{0}_mark_db.cpp", assetName), TAG_SOURCE); + files.emplace_back(std::format("XAssets/{0}/{0}_mark_db.h", assetName), TAG_HEADER); + files.emplace_back(std::format("XAssets/{0}/{0}_mark_db.cpp", assetName), TAG_SOURCE); return files; } -void ZoneMarkTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) +void ZoneMarkTemplate::RenderOncePerAssetFile(std::ostream& stream, const CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) { - Template t(stream, context); + PerAsset t(stream, context); if (fileTag == TAG_HEADER) { diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h index f430c9d4..36b6ee8c 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.h @@ -1,9 +1,13 @@ #pragma once + #include "Generating/ICodeTemplate.h" class ZoneMarkTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(const RenderingContext& context) override; - void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; + std::vector GetFilesToRenderOncePerTemplate(const OncePerTemplateRenderingContext& context) override; + void RenderOncePerTemplateFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerTemplateRenderingContext& context) override; + + std::vector GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) override; + void RenderOncePerAssetFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp index 64848e49..69b016c8 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp @@ -9,25 +9,22 @@ namespace { - constexpr int TAG_HEADER = 1; - constexpr int TAG_SOURCE = 2; + constexpr CodeTemplateFileTag TAG_HEADER = 1; + constexpr CodeTemplateFileTag TAG_SOURCE = 2; - class Template final : BaseTemplate + class PerAsset final : BaseTemplate { public: - Template(std::ostream& stream, const RenderingContext& context) - : BaseTemplate(stream, context) + PerAsset(std::ostream& stream, const OncePerAssetRenderingContext& context) + : BaseTemplate(stream), + m_env(context) { } void Header() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINE("#pragma once") LINE("") LINEF("#include \"Game/{0}/{0}.h\"", m_env.m_game) @@ -112,12 +109,8 @@ namespace void Source() { - LINE("// ====================================================================") - LINE("// This file has been generated by ZoneCodeGenerator.") - LINE("// Do not modify.") - LINE("// Any changes will be discarded when regenerating.") - LINE("// ====================================================================") - LINE("") + AddGeneratedHint(); + LINEF("#include \"{0}_write_db.h\"", Lower(m_env.m_asset->m_definition->m_name)) if (!m_env.m_referenced_assets.empty()) @@ -1230,10 +1223,12 @@ namespace m_intendation--; LINE("}") } + + const OncePerAssetRenderingContext& m_env; }; } // namespace -std::vector ZoneWriteTemplate::GetFilesToRender(const RenderingContext& context) +std::vector ZoneWriteTemplate::GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) { std::vector files; @@ -1241,15 +1236,15 @@ std::vector ZoneWriteTemplate::GetFilesToRender(const Renderin for (auto& c : assetName) c = static_cast(tolower(c)); - files.emplace_back(std::format("{0}/{0}_write_db.h", assetName), TAG_HEADER); - files.emplace_back(std::format("{0}/{0}_write_db.cpp", assetName), TAG_SOURCE); + files.emplace_back(std::format("XAssets/{0}/{0}_write_db.h", assetName), TAG_HEADER); + files.emplace_back(std::format("XAssets/{0}/{0}_write_db.cpp", assetName), TAG_SOURCE); return files; } -void ZoneWriteTemplate::RenderFile(std::ostream& stream, const int fileTag, const RenderingContext& context) +void ZoneWriteTemplate::RenderOncePerAssetFile(std::ostream& stream, const CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) { - Template t(stream, context); + PerAsset t(stream, context); if (fileTag == TAG_HEADER) { diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h index e2211212..84b1bfd4 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.h @@ -1,9 +1,10 @@ #pragma once + #include "Generating/ICodeTemplate.h" class ZoneWriteTemplate final : public ICodeTemplate { public: - std::vector GetFilesToRender(const RenderingContext& context) override; - void RenderFile(std::ostream& stream, int fileTag, const RenderingContext& context) override; + std::vector GetFilesToRenderOncePerAsset(const OncePerAssetRenderingContext& context) override; + void RenderOncePerAssetFile(std::ostream& stream, CodeTemplateFileTag fileTag, const OncePerAssetRenderingContext& context) override; }; diff --git a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp index 05d8d93d..fb5c354f 100644 --- a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp +++ b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp @@ -6,7 +6,6 @@ #include "Utils/Logging/Log.h" #include -#include #include // clang-format off @@ -81,9 +80,8 @@ const CommandLineOption* const OPTION_GENERATE = CommandLineOption::Builder::Create() .WithShortName("g") .WithLongName("generate") - .WithDescription("Generates a specified asset/preset combination. Can be used multiple times. Available presets: ZoneLoad, ZoneWrite, AssetStructTests") + .WithDescription("Generates a specified preset. Can be used multiple times. Available presets: ZoneLoad, ZoneWrite, AssetStructTests") .WithCategory(CATEGORY_OUTPUT) - .WithParameter("assetName") .WithParameter("preset") .Reusable() .Build(); @@ -103,28 +101,10 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ namespace { - static constexpr unsigned FLAG_TASK_GENERATE = 1 << 0; - static constexpr unsigned FLAG_TASK_PRINT = 1 << 1; + constexpr unsigned FLAG_TASK_GENERATE = 1 << 0; + constexpr unsigned FLAG_TASK_PRINT = 1 << 1; } // namespace -GenerationTask::GenerationTask() - : m_all_assets(false) -{ -} - -GenerationTask::GenerationTask(std::string templateName) - : m_all_assets(true), - m_template_name(std::move(templateName)) -{ -} - -GenerationTask::GenerationTask(std::string assetName, std::string templateName) - : m_all_assets(false), - m_asset_name(std::move(assetName)), - m_template_name(std::move(templateName)) -{ -} - ZoneCodeGeneratorArguments::ZoneCodeGeneratorArguments() : m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v), m_task_flags(0u) @@ -217,17 +197,7 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo if (m_argument_parser.IsOptionSpecified(OPTION_GENERATE)) { m_task_flags |= FLAG_TASK_GENERATE; - const auto generateParameterValues = m_argument_parser.GetParametersForOption(OPTION_GENERATE); - for (auto i = 0u; i < generateParameterValues.size(); i += 2) - { - const auto& assetName = generateParameterValues[i]; - const auto& templateName = generateParameterValues[i + 1]; - - if (assetName == "*") - m_generation_tasks.emplace_back(templateName); - else - m_generation_tasks.emplace_back(assetName, templateName); - } + m_template_names = m_argument_parser.GetParametersForOption(OPTION_GENERATE); } if (m_task_flags == 0) diff --git a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.h b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.h index fa93a7f2..f4b21dfb 100644 --- a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.h +++ b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.h @@ -5,18 +5,6 @@ #include #include -class GenerationTask -{ -public: - bool m_all_assets; - std::string m_asset_name; - std::string m_template_name; - - GenerationTask(); - explicit GenerationTask(std::string templateName); - GenerationTask(std::string assetName, std::string templateName); -}; - class ZoneCodeGeneratorArguments { public: @@ -30,7 +18,7 @@ public: std::vector m_command_paths; std::string m_output_directory; - std::vector m_generation_tasks; + std::vector m_template_names; private: void PrintUsage() const; diff --git a/src/ZoneCommon/Game/IW3/AssetMarkerIW3.h b/src/ZoneCommon/Game/IW3/AssetMarkerIW3.h deleted file mode 100644 index e2d0217a..00000000 --- a/src/ZoneCommon/Game/IW3/AssetMarkerIW3.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "Game/IW3/XAssets/clipmap_t/clipmap_t_mark_db.h" -#include "Game/IW3/XAssets/comworld/comworld_mark_db.h" -#include "Game/IW3/XAssets/font_s/font_s_mark_db.h" -#include "Game/IW3/XAssets/fxeffectdef/fxeffectdef_mark_db.h" -#include "Game/IW3/XAssets/fximpacttable/fximpacttable_mark_db.h" -#include "Game/IW3/XAssets/gameworldmp/gameworldmp_mark_db.h" -#include "Game/IW3/XAssets/gameworldsp/gameworldsp_mark_db.h" -#include "Game/IW3/XAssets/gfximage/gfximage_mark_db.h" -#include "Game/IW3/XAssets/gfxlightdef/gfxlightdef_mark_db.h" -#include "Game/IW3/XAssets/gfxworld/gfxworld_mark_db.h" -#include "Game/IW3/XAssets/loadedsound/loadedsound_mark_db.h" -#include "Game/IW3/XAssets/localizeentry/localizeentry_mark_db.h" -#include "Game/IW3/XAssets/mapents/mapents_mark_db.h" -#include "Game/IW3/XAssets/material/material_mark_db.h" -#include "Game/IW3/XAssets/materialtechniqueset/materialtechniqueset_mark_db.h" -#include "Game/IW3/XAssets/menudef_t/menudef_t_mark_db.h" -#include "Game/IW3/XAssets/menulist/menulist_mark_db.h" -#include "Game/IW3/XAssets/physpreset/physpreset_mark_db.h" -#include "Game/IW3/XAssets/rawfile/rawfile_mark_db.h" -#include "Game/IW3/XAssets/snd_alias_list_t/snd_alias_list_t_mark_db.h" -#include "Game/IW3/XAssets/sndcurve/sndcurve_mark_db.h" -#include "Game/IW3/XAssets/stringtable/stringtable_mark_db.h" -#include "Game/IW3/XAssets/weapondef/weapondef_mark_db.h" -#include "Game/IW3/XAssets/xanimparts/xanimparts_mark_db.h" -#include "Game/IW3/XAssets/xmodel/xmodel_mark_db.h" diff --git a/src/ZoneCommon/Game/IW4/AssetMarkerIW4.h b/src/ZoneCommon/Game/IW4/AssetMarkerIW4.h deleted file mode 100644 index 73122e2a..00000000 --- a/src/ZoneCommon/Game/IW4/AssetMarkerIW4.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "Game/IW4/XAssets/addonmapents/addonmapents_mark_db.h" -#include "Game/IW4/XAssets/clipmap_t/clipmap_t_mark_db.h" -#include "Game/IW4/XAssets/comworld/comworld_mark_db.h" -#include "Game/IW4/XAssets/font_s/font_s_mark_db.h" -#include "Game/IW4/XAssets/fxeffectdef/fxeffectdef_mark_db.h" -#include "Game/IW4/XAssets/fximpacttable/fximpacttable_mark_db.h" -#include "Game/IW4/XAssets/fxworld/fxworld_mark_db.h" -#include "Game/IW4/XAssets/gameworldmp/gameworldmp_mark_db.h" -#include "Game/IW4/XAssets/gameworldsp/gameworldsp_mark_db.h" -#include "Game/IW4/XAssets/gfximage/gfximage_mark_db.h" -#include "Game/IW4/XAssets/gfxlightdef/gfxlightdef_mark_db.h" -#include "Game/IW4/XAssets/gfxworld/gfxworld_mark_db.h" -#include "Game/IW4/XAssets/leaderboarddef/leaderboarddef_mark_db.h" -#include "Game/IW4/XAssets/loadedsound/loadedsound_mark_db.h" -#include "Game/IW4/XAssets/localizeentry/localizeentry_mark_db.h" -#include "Game/IW4/XAssets/mapents/mapents_mark_db.h" -#include "Game/IW4/XAssets/material/material_mark_db.h" -#include "Game/IW4/XAssets/materialpixelshader/materialpixelshader_mark_db.h" -#include "Game/IW4/XAssets/materialtechniqueset/materialtechniqueset_mark_db.h" -#include "Game/IW4/XAssets/materialvertexdeclaration/materialvertexdeclaration_mark_db.h" -#include "Game/IW4/XAssets/materialvertexshader/materialvertexshader_mark_db.h" -#include "Game/IW4/XAssets/menudef_t/menudef_t_mark_db.h" -#include "Game/IW4/XAssets/menulist/menulist_mark_db.h" -#include "Game/IW4/XAssets/physcollmap/physcollmap_mark_db.h" -#include "Game/IW4/XAssets/physpreset/physpreset_mark_db.h" -#include "Game/IW4/XAssets/rawfile/rawfile_mark_db.h" -#include "Game/IW4/XAssets/snd_alias_list_t/snd_alias_list_t_mark_db.h" -#include "Game/IW4/XAssets/sndcurve/sndcurve_mark_db.h" -#include "Game/IW4/XAssets/stringtable/stringtable_mark_db.h" -#include "Game/IW4/XAssets/structureddatadefset/structureddatadefset_mark_db.h" -#include "Game/IW4/XAssets/tracerdef/tracerdef_mark_db.h" -#include "Game/IW4/XAssets/vehicledef/vehicledef_mark_db.h" -#include "Game/IW4/XAssets/weaponcompletedef/weaponcompletedef_mark_db.h" -#include "Game/IW4/XAssets/xanimparts/xanimparts_mark_db.h" -#include "Game/IW4/XAssets/xmodel/xmodel_mark_db.h" diff --git a/src/ZoneCommon/Game/IW5/AssetMarkerIW5.h b/src/ZoneCommon/Game/IW5/AssetMarkerIW5.h deleted file mode 100644 index 3518e239..00000000 --- a/src/ZoneCommon/Game/IW5/AssetMarkerIW5.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "Game/IW5/XAssets/addonmapents/addonmapents_mark_db.h" -#include "Game/IW5/XAssets/clipmap_t/clipmap_t_mark_db.h" -#include "Game/IW5/XAssets/comworld/comworld_mark_db.h" -#include "Game/IW5/XAssets/font_s/font_s_mark_db.h" -#include "Game/IW5/XAssets/fxeffectdef/fxeffectdef_mark_db.h" -#include "Game/IW5/XAssets/fximpacttable/fximpacttable_mark_db.h" -#include "Game/IW5/XAssets/fxworld/fxworld_mark_db.h" -#include "Game/IW5/XAssets/gfximage/gfximage_mark_db.h" -#include "Game/IW5/XAssets/gfxlightdef/gfxlightdef_mark_db.h" -#include "Game/IW5/XAssets/gfxworld/gfxworld_mark_db.h" -#include "Game/IW5/XAssets/glassworld/glassworld_mark_db.h" -#include "Game/IW5/XAssets/leaderboarddef/leaderboarddef_mark_db.h" -#include "Game/IW5/XAssets/loadedsound/loadedsound_mark_db.h" -#include "Game/IW5/XAssets/localizeentry/localizeentry_mark_db.h" -#include "Game/IW5/XAssets/mapents/mapents_mark_db.h" -#include "Game/IW5/XAssets/material/material_mark_db.h" -#include "Game/IW5/XAssets/materialpixelshader/materialpixelshader_mark_db.h" -#include "Game/IW5/XAssets/materialtechniqueset/materialtechniqueset_mark_db.h" -#include "Game/IW5/XAssets/materialvertexdeclaration/materialvertexdeclaration_mark_db.h" -#include "Game/IW5/XAssets/materialvertexshader/materialvertexshader_mark_db.h" -#include "Game/IW5/XAssets/menudef_t/menudef_t_mark_db.h" -#include "Game/IW5/XAssets/menulist/menulist_mark_db.h" -#include "Game/IW5/XAssets/pathdata/pathdata_mark_db.h" -#include "Game/IW5/XAssets/physcollmap/physcollmap_mark_db.h" -#include "Game/IW5/XAssets/physpreset/physpreset_mark_db.h" -#include "Game/IW5/XAssets/rawfile/rawfile_mark_db.h" -#include "Game/IW5/XAssets/scriptfile/scriptfile_mark_db.h" -#include "Game/IW5/XAssets/snd_alias_list_t/snd_alias_list_t_mark_db.h" -#include "Game/IW5/XAssets/sndcurve/sndcurve_mark_db.h" -#include "Game/IW5/XAssets/stringtable/stringtable_mark_db.h" -#include "Game/IW5/XAssets/structureddatadefset/structureddatadefset_mark_db.h" -#include "Game/IW5/XAssets/surfacefxtable/surfacefxtable_mark_db.h" -#include "Game/IW5/XAssets/tracerdef/tracerdef_mark_db.h" -#include "Game/IW5/XAssets/vehicledef/vehicledef_mark_db.h" -#include "Game/IW5/XAssets/vehicletrack/vehicletrack_mark_db.h" -#include "Game/IW5/XAssets/weaponattachment/weaponattachment_mark_db.h" -#include "Game/IW5/XAssets/weaponcompletedef/weaponcompletedef_mark_db.h" -#include "Game/IW5/XAssets/xanimparts/xanimparts_mark_db.h" -#include "Game/IW5/XAssets/xmodel/xmodel_mark_db.h" -#include "Game/IW5/XAssets/xmodelsurfs/xmodelsurfs_mark_db.h" diff --git a/src/ZoneCommon/Game/T5/AssetMarkerT5.h b/src/ZoneCommon/Game/T5/AssetMarkerT5.h deleted file mode 100644 index 10bba7f8..00000000 --- a/src/ZoneCommon/Game/T5/AssetMarkerT5.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "Game/T5/XAssets/clipmap_t/clipmap_t_mark_db.h" -#include "Game/T5/XAssets/comworld/comworld_mark_db.h" -#include "Game/T5/XAssets/ddlroot_t/ddlroot_t_mark_db.h" -#include "Game/T5/XAssets/destructibledef/destructibledef_mark_db.h" -#include "Game/T5/XAssets/emblemset/emblemset_mark_db.h" -#include "Game/T5/XAssets/font_s/font_s_mark_db.h" -#include "Game/T5/XAssets/fxeffectdef/fxeffectdef_mark_db.h" -#include "Game/T5/XAssets/fximpacttable/fximpacttable_mark_db.h" -#include "Game/T5/XAssets/gameworldmp/gameworldmp_mark_db.h" -#include "Game/T5/XAssets/gameworldsp/gameworldsp_mark_db.h" -#include "Game/T5/XAssets/gfximage/gfximage_mark_db.h" -#include "Game/T5/XAssets/gfxlightdef/gfxlightdef_mark_db.h" -#include "Game/T5/XAssets/gfxworld/gfxworld_mark_db.h" -#include "Game/T5/XAssets/glasses/glasses_mark_db.h" -#include "Game/T5/XAssets/localizeentry/localizeentry_mark_db.h" -#include "Game/T5/XAssets/mapents/mapents_mark_db.h" -#include "Game/T5/XAssets/material/material_mark_db.h" -#include "Game/T5/XAssets/materialtechniqueset/materialtechniqueset_mark_db.h" -#include "Game/T5/XAssets/menudef_t/menudef_t_mark_db.h" -#include "Game/T5/XAssets/menulist/menulist_mark_db.h" -#include "Game/T5/XAssets/packindex/packindex_mark_db.h" -#include "Game/T5/XAssets/physconstraints/physconstraints_mark_db.h" -#include "Game/T5/XAssets/physpreset/physpreset_mark_db.h" -#include "Game/T5/XAssets/rawfile/rawfile_mark_db.h" -#include "Game/T5/XAssets/sndbank/sndbank_mark_db.h" -#include "Game/T5/XAssets/snddriverglobals/snddriverglobals_mark_db.h" -#include "Game/T5/XAssets/sndpatch/sndpatch_mark_db.h" -#include "Game/T5/XAssets/stringtable/stringtable_mark_db.h" -#include "Game/T5/XAssets/weaponvariantdef/weaponvariantdef_mark_db.h" -#include "Game/T5/XAssets/xanimparts/xanimparts_mark_db.h" -#include "Game/T5/XAssets/xglobals/xglobals_mark_db.h" -#include "Game/T5/XAssets/xmodel/xmodel_mark_db.h" diff --git a/src/ZoneCommon/Game/T6/AssetMarkerT6.h b/src/ZoneCommon/Game/T6/AssetMarkerT6.h deleted file mode 100644 index 5c2557dc..00000000 --- a/src/ZoneCommon/Game/T6/AssetMarkerT6.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "Game/T6/XAssets/addonmapents/addonmapents_mark_db.h" -#include "Game/T6/XAssets/clipmap_t/clipmap_t_mark_db.h" -#include "Game/T6/XAssets/comworld/comworld_mark_db.h" -#include "Game/T6/XAssets/ddlroot_t/ddlroot_t_mark_db.h" -#include "Game/T6/XAssets/destructibledef/destructibledef_mark_db.h" -#include "Game/T6/XAssets/emblemset/emblemset_mark_db.h" -#include "Game/T6/XAssets/font_s/font_s_mark_db.h" -#include "Game/T6/XAssets/fonticon/fonticon_mark_db.h" -#include "Game/T6/XAssets/footstepfxtabledef/footstepfxtabledef_mark_db.h" -#include "Game/T6/XAssets/footsteptabledef/footsteptabledef_mark_db.h" -#include "Game/T6/XAssets/fxeffectdef/fxeffectdef_mark_db.h" -#include "Game/T6/XAssets/fximpacttable/fximpacttable_mark_db.h" -#include "Game/T6/XAssets/gameworldmp/gameworldmp_mark_db.h" -#include "Game/T6/XAssets/gameworldsp/gameworldsp_mark_db.h" -#include "Game/T6/XAssets/gfximage/gfximage_mark_db.h" -#include "Game/T6/XAssets/gfxlightdef/gfxlightdef_mark_db.h" -#include "Game/T6/XAssets/gfxworld/gfxworld_mark_db.h" -#include "Game/T6/XAssets/glasses/glasses_mark_db.h" -#include "Game/T6/XAssets/keyvaluepairs/keyvaluepairs_mark_db.h" -#include "Game/T6/XAssets/leaderboarddef/leaderboarddef_mark_db.h" -#include "Game/T6/XAssets/localizeentry/localizeentry_mark_db.h" -#include "Game/T6/XAssets/mapents/mapents_mark_db.h" -#include "Game/T6/XAssets/material/material_mark_db.h" -#include "Game/T6/XAssets/materialtechniqueset/materialtechniqueset_mark_db.h" -#include "Game/T6/XAssets/memoryblock/memoryblock_mark_db.h" -#include "Game/T6/XAssets/menudef_t/menudef_t_mark_db.h" -#include "Game/T6/XAssets/menulist/menulist_mark_db.h" -#include "Game/T6/XAssets/physconstraints/physconstraints_mark_db.h" -#include "Game/T6/XAssets/physpreset/physpreset_mark_db.h" -#include "Game/T6/XAssets/qdb/qdb_mark_db.h" -#include "Game/T6/XAssets/rawfile/rawfile_mark_db.h" -#include "Game/T6/XAssets/scriptparsetree/scriptparsetree_mark_db.h" -#include "Game/T6/XAssets/skinnedvertsdef/skinnedvertsdef_mark_db.h" -#include "Game/T6/XAssets/slug/slug_mark_db.h" -#include "Game/T6/XAssets/sndbank/sndbank_mark_db.h" -#include "Game/T6/XAssets/snddriverglobals/snddriverglobals_mark_db.h" -#include "Game/T6/XAssets/sndpatch/sndpatch_mark_db.h" -#include "Game/T6/XAssets/stringtable/stringtable_mark_db.h" -#include "Game/T6/XAssets/tracerdef/tracerdef_mark_db.h" -#include "Game/T6/XAssets/vehicledef/vehicledef_mark_db.h" -#include "Game/T6/XAssets/weaponattachment/weaponattachment_mark_db.h" -#include "Game/T6/XAssets/weaponattachmentunique/weaponattachmentunique_mark_db.h" -#include "Game/T6/XAssets/weaponcamo/weaponcamo_mark_db.h" -#include "Game/T6/XAssets/weaponvariantdef/weaponvariantdef_mark_db.h" -#include "Game/T6/XAssets/xanimparts/xanimparts_mark_db.h" -#include "Game/T6/XAssets/xglobals/xglobals_mark_db.h" -#include "Game/T6/XAssets/xmodel/xmodel_mark_db.h" -#include "Game/T6/XAssets/zbarrierdef/zbarrierdef_mark_db.h"