diff --git a/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.cpp b/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.cpp index ca53435b..047b1c39 100644 --- a/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.cpp +++ b/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.cpp @@ -282,10 +282,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::font_icon { - std::unique_ptr> CreateCsvFontIconLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateCsvLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::font_icon diff --git a/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.h b/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.h index 7bb1e58f..76e623ea 100644 --- a/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.h +++ b/src/ObjLoading/Game/T6/FontIcon/CsvLoaderFontIconT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::font_icon { - std::unique_ptr> CreateCsvFontIconLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateCsvLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::font_icon diff --git a/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.cpp b/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.cpp index 002e778c..5ff32a18 100644 --- a/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.cpp +++ b/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.cpp @@ -141,10 +141,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::font_icon { - std::unique_ptr> CreateJsonFontIconLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::font_icon diff --git a/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.h b/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.h index 7938827a..e770f0d4 100644 --- a/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.h +++ b/src/ObjLoading/Game/T6/FontIcon/JsonLoaderFontIconT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::font_icon { - std::unique_ptr> CreateJsonFontIconLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateJsonLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::font_icon diff --git a/src/ObjLoading/Game/T6/Image/LoaderImageT6.cpp b/src/ObjLoading/Game/T6/Image/LoaderImageT6.cpp index 5c26a32d..1b41701a 100644 --- a/src/ObjLoading/Game/T6/Image/LoaderImageT6.cpp +++ b/src/ObjLoading/Game/T6/Image/LoaderImageT6.cpp @@ -2,6 +2,7 @@ #include "Game/T6/CommonT6.h" #include "Game/T6/T6.h" +#include "Image/ImageCommon.h" #include "Image/IwiLoader.h" #include @@ -11,6 +12,7 @@ #include using namespace T6; +using namespace ::image; namespace { @@ -25,7 +27,7 @@ namespace AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { - const auto fileName = std::format("images/{}.iwi", assetName); + const auto fileName = GetFileNameForAsset(assetName, ".iwi"); const auto file = m_search_path.Open(fileName); if (!file.IsOpen()) return AssetCreationResult::NoAction(); @@ -68,10 +70,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::image { - std::unique_ptr> CreateImageLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::image diff --git a/src/ObjLoading/Game/T6/Image/LoaderImageT6.h b/src/ObjLoading/Game/T6/Image/LoaderImageT6.h index 6c1bfb1f..e77f4591 100644 --- a/src/ObjLoading/Game/T6/Image/LoaderImageT6.h +++ b/src/ObjLoading/Game/T6/Image/LoaderImageT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::image { - std::unique_ptr> CreateImageLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::image diff --git a/src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.h b/src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.h deleted file mode 100644 index 6145d04d..00000000 --- a/src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "Game/T6/T6.h" -#include "Utils/MemoryManager.h" - -#include - -namespace T6 -{ - bool LoadLeaderboardAsJson(std::istream& stream, LeaderboardDef& leaderboard, MemoryManager& memory); -} // namespace T6 diff --git a/src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.cpp b/src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.cpp similarity index 72% rename from src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.cpp rename to src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.cpp index b4f7823f..ffbb5e0b 100644 --- a/src/ObjLoading/Game/T6/Leaderboard/JsonLeaderboardDefLoader.cpp +++ b/src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.cpp @@ -1,14 +1,18 @@ -#include "JsonLeaderboardDefLoader.h" +#include "JsonLoaderLeaderboardT6.h" #include "Game/T6/CommonT6.h" #include "Game/T6/Leaderboard/JsonLeaderboardDef.h" +#include "Game/T6/T6.h" +#include "Leaderboard/LeaderboardCommon.h" +#include #include #include #include using namespace nlohmann; using namespace T6; +using namespace ::leaderboard; namespace { @@ -124,13 +128,45 @@ namespace std::istream& m_stream; MemoryManager& m_memory; }; + + class LeaderboardLoader final : public AssetCreator + { + public: + LeaderboardLoader(MemoryManager& memory, ISearchPath& searchPath) + : m_memory(memory), + m_search_path(searchPath) + { + } + + AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override + { + const auto file = m_search_path.Open(GetJsonFileNameForAsset(assetName)); + if (!file.IsOpen()) + return AssetCreationResult::NoAction(); + + auto* leaderboardDef = m_memory.Alloc(); + leaderboardDef->name = m_memory.Dup(assetName.c_str()); + + const JsonLoader loader(*file.m_stream, m_memory); + if (!loader.Load(*leaderboardDef)) + { + std::cerr << std::format("Failed to load leaderboard \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + return AssetCreationResult::Success(context.AddAsset(assetName, leaderboardDef)); + } + + private: + MemoryManager& m_memory; + ISearchPath& m_search_path; + }; } // namespace -namespace T6 +namespace T6::leaderboard { - bool LoadLeaderboardAsJson(std::istream& stream, LeaderboardDef& leaderboard, MemoryManager& memory) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { - const JsonLoader loader(stream, memory); - return loader.Load(leaderboard); + return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::leaderboard diff --git a/src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.h b/src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.h new file mode 100644 index 00000000..24865730 --- /dev/null +++ b/src/ObjLoading/Game/T6/Leaderboard/JsonLoaderLeaderboardT6.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Asset/IAssetCreator.h" +#include "Game/T6/T6.h" +#include "SearchPath/ISearchPath.h" +#include "Utils/MemoryManager.h" + +#include + +namespace T6::leaderboard +{ + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::leaderboard diff --git a/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.cpp b/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.cpp deleted file mode 100644 index ae08c020..00000000 --- a/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "LoaderLeaderboardT6.h" - -#include "Game/T6/CommonT6.h" -#include "Game/T6/T6.h" -#include "JsonLeaderboardDefLoader.h" - -#include -#include -#include - -using namespace T6; - -namespace -{ - class LeaderboardLoader final : public AssetCreator - { - public: - LeaderboardLoader(MemoryManager& memory, ISearchPath& searchPath) - : m_memory(memory), - m_search_path(searchPath) - { - } - - AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override - { - const auto file = m_search_path.Open(std::format("leaderboards/{}.json", assetName)); - if (!file.IsOpen()) - return AssetCreationResult::NoAction(); - - auto* leaderboardDef = m_memory.Alloc(); - leaderboardDef->name = m_memory.Dup(assetName.c_str()); - - if (!LoadLeaderboardAsJson(*file.m_stream, *leaderboardDef, m_memory)) - { - std::cerr << std::format("Failed to load leaderboard \"{}\"\n", assetName); - return AssetCreationResult::Failure(); - } - - return AssetCreationResult::Success(context.AddAsset(assetName, leaderboardDef)); - } - - private: - MemoryManager& m_memory; - ISearchPath& m_search_path; - }; -} // namespace - -namespace T6 -{ - std::unique_ptr> CreateLeaderboardLoader(MemoryManager& memory, ISearchPath& searchPath) - { - return std::make_unique(memory, searchPath); - } -} // namespace T6 diff --git a/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.h b/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.h deleted file mode 100644 index df060b90..00000000 --- a/src/ObjLoading/Game/T6/Leaderboard/LoaderLeaderboardT6.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "Asset/IAssetCreator.h" -#include "Game/T6/T6.h" -#include "SearchPath/ISearchPath.h" -#include "Utils/MemoryManager.h" - -#include - -namespace T6 -{ - std::unique_ptr> CreateLeaderboardLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 diff --git a/src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.cpp b/src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.cpp similarity index 85% rename from src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.cpp rename to src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.cpp index c4a3b77d..f28fa7d0 100644 --- a/src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.cpp +++ b/src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.cpp @@ -1,4 +1,4 @@ -#include "LoaderLocalizeT6.h" +#include "LocalizeLoaderT6.h" #include "Localize/CommonLocalizeLoader.h" @@ -35,10 +35,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::localize { - std::unique_ptr> CreateLocalizeLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::localize diff --git a/src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.h b/src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.h similarity index 51% rename from src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.h rename to src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.h index 991f53b1..0aecaa98 100644 --- a/src/ObjLoading/Game/T6/Localize/LoaderLocalizeT6.h +++ b/src/ObjLoading/Game/T6/Localize/LocalizeLoaderT6.h @@ -8,7 +8,7 @@ #include -namespace T6 +namespace T6::localize { - std::unique_ptr> CreateLocalizeLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::localize diff --git a/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.cpp b/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.cpp index 5458b96e..eeb7b7fa 100644 --- a/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.cpp +++ b/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.cpp @@ -8,6 +8,7 @@ #include using namespace T6; +using namespace ::material; namespace { @@ -22,7 +23,7 @@ namespace AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { - const auto file = m_search_path.Open(material::GetFileNameForAssetName(assetName)); + const auto file = m_search_path.Open(GetFileNameForAssetName(assetName)); if (!file.IsOpen()) return AssetCreationResult::NoAction(); @@ -45,10 +46,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::material { - std::unique_ptr> CreateMaterialLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::material diff --git a/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.h b/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.h index 22cd78dc..d0dcc461 100644 --- a/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.h +++ b/src/ObjLoading/Game/T6/Material/LoaderMaterialT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::material { - std::unique_ptr> CreateMaterialLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::material diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp index 6aa2d966..3e02b7f6 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp @@ -13,8 +13,8 @@ #include "Image/IwiTypes.h" #include "Image/LoaderImageT6.h" #include "Image/Texture.h" -#include "Leaderboard/LoaderLeaderboardT6.h" -#include "Localize/LoaderLocalizeT6.h" +#include "Leaderboard/JsonLoaderLeaderboardT6.h" +#include "Localize/LocalizeLoaderT6.h" #include "Material/LoaderMaterialT6.h" #include "ObjContainer/IPak/IPak.h" #include "ObjLoading.h" @@ -393,16 +393,16 @@ namespace T6 { auto& memory = zone.Memory(); - collection.AddAssetCreator(CreateRawPhysPresetLoader(memory, searchPath, zone)); - collection.AddAssetCreator(CreateGdtPhysPresetLoader(memory, searchPath, gdt, zone)); - collection.AddAssetCreator(CreateRawPhysConstraintsLoader(memory, searchPath, zone)); - collection.AddAssetCreator(CreateGdtPhysConstraintsLoader(memory, searchPath, gdt, zone)); + collection.AddAssetCreator(phys_preset::CreateRawLoader(memory, searchPath, zone)); + collection.AddAssetCreator(phys_preset::CreateGdtLoader(memory, gdt, zone)); + collection.AddAssetCreator(phys_constraints::CreateRawLoader(memory, searchPath, zone)); + collection.AddAssetCreator(phys_constraints::CreateGdtLoader(memory, searchPath, gdt, zone)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); collection.AddAssetCreator(xmodel::CreateXModelLoader(memory, searchPath, zone)); - collection.AddAssetCreator(CreateMaterialLoader(memory, searchPath)); + collection.AddAssetCreator(material::CreateLoader(memory, searchPath)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateImageLoader(memory, searchPath)); + collection.AddAssetCreator(image::CreateLoader(memory, searchPath)); collection.AddAssetCreator(sound::CreateSoundBankLoader(memory, searchPath)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); @@ -413,11 +413,11 @@ namespace T6 // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateCsvFontIconLoader(memory, searchPath)); - collection.AddAssetCreator(CreateJsonFontIconLoader(memory, searchPath)); + collection.AddAssetCreator(font_icon::CreateCsvLoader(memory, searchPath)); + collection.AddAssetCreator(font_icon::CreateJsonLoader(memory, searchPath)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateLocalizeLoader(memory, searchPath, zone)); + collection.AddAssetCreator(localize::CreateLoader(memory, searchPath, zone)); collection.AddAssetCreator(weapon::CreateRawLoader(memory, searchPath, zone)); collection.AddAssetCreator(weapon::CreateGdtLoader(memory, searchPath, gdt, zone)); collection.AddAssetCreator(attachment::CreateRawLoader(memory, searchPath, zone)); @@ -428,26 +428,26 @@ namespace T6 // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateRawFileLoader(memory, searchPath)); - collection.AddAssetCreator(CreateStringTableLoader(memory, searchPath)); - collection.AddAssetCreator(CreateLeaderboardLoader(memory, searchPath)); + collection.AddAssetCreator(raw_file::CreateLoader(memory, searchPath)); + collection.AddAssetCreator(string_table::CreateLoader(memory, searchPath)); + collection.AddAssetCreator(leaderboard::CreateLoader(memory, searchPath)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateScriptLoader(memory, searchPath)); - collection.AddAssetCreator(CreateRawVehicleLoader(memory, searchPath, zone)); - collection.AddAssetCreator(CreateGdtVehicleLoader(memory, searchPath, gdt, zone)); + collection.AddAssetCreator(script::CreateLoader(memory, searchPath)); + collection.AddAssetCreator(vehicle::CreateRawLoader(memory, searchPath, zone)); + collection.AddAssetCreator(vehicle::CreateGdtLoader(memory, searchPath, gdt, zone)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateQdbLoader(memory, searchPath)); - collection.AddAssetCreator(CreateSlugLoader(memory, searchPath)); + collection.AddAssetCreator(qdb::CreateLoader(memory, searchPath)); + collection.AddAssetCreator(slug::CreateLoader(memory, searchPath)); // collection.AddAssetCreator(std::make_unique(memory)); // collection.AddAssetCreator(std::make_unique(memory)); - collection.AddAssetCreator(CreateRawZBarrierLoader(memory, searchPath, zone)); - collection.AddAssetCreator(CreateGdtZBarrierLoader(memory, searchPath, gdt, zone)); + collection.AddAssetCreator(z_barrier::CreateRawLoader(memory, searchPath, zone)); + collection.AddAssetCreator(z_barrier::CreateGdtLoader(memory, searchPath, gdt, zone)); } } // namespace diff --git a/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.cpp b/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.cpp index d6c35c5d..fae17b92 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.cpp +++ b/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.cpp @@ -40,15 +40,14 @@ namespace private: IGdtQueryable& m_gdt; - InfoStringLoaderPhysConstraints m_info_string_loader; + T6::phys_constraints::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::phys_constraints { - std::unique_ptr> - CreateGdtPhysConstraintsLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) { return std::make_unique(memory, searchPath, gdt, zone); } -} // namespace T6 +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.h b/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.h index 45b70188..c55f8e1a 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.h +++ b/src/ObjLoading/Game/T6/PhysConstraints/GdtLoaderPhysConstraintsT6.h @@ -8,8 +8,7 @@ #include -namespace T6 +namespace T6::phys_constraints { - std::unique_ptr> - CreateGdtPhysConstraintsLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.cpp b/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.cpp index ab29df7e..1242dfe0 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.cpp +++ b/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.cpp @@ -76,35 +76,38 @@ namespace } } // namespace -InfoStringLoaderPhysConstraints::InfoStringLoaderPhysConstraints(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) - : m_memory(memory), - m_search_path(searchPath), - m_zone(zone) +namespace T6::phys_constraints { -} - -AssetCreationResult InfoStringLoaderPhysConstraints::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) -{ - auto* physConstraints = m_memory.Alloc(); - physConstraints->name = m_memory.Dup(assetName.c_str()); - - AssetRegistration registration(assetName, physConstraints); - InfoStringToPhysConstraintsConverter converter(infoString, - *physConstraints, - m_zone.m_script_strings, - m_memory, - context, - registration, - phys_constraints_fields, - std::extent_v); - if (!converter.Convert()) + InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + : m_memory(memory), + m_search_path(searchPath), + m_zone(zone) { - std::cerr << std::format("Failed to parse phys constraints: \"{}\"\n", assetName); - return AssetCreationResult::Failure(); } - CalculatePhysConstraintsFields(*physConstraints, m_zone.m_script_strings); - registration.AddScriptString(m_zone.m_script_strings.AddOrGetScriptString("")); + AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) + { + auto* physConstraints = m_memory.Alloc(); + physConstraints->name = m_memory.Dup(assetName.c_str()); - return AssetCreationResult::Success(context.AddAsset(std::move(registration))); -} + AssetRegistration registration(assetName, physConstraints); + InfoStringToPhysConstraintsConverter converter(infoString, + *physConstraints, + m_zone.m_script_strings, + m_memory, + context, + registration, + phys_constraints_fields, + std::extent_v); + if (!converter.Convert()) + { + std::cerr << std::format("Failed to parse phys constraints: \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + CalculatePhysConstraintsFields(*physConstraints, m_zone.m_script_strings); + registration.AddScriptString(m_zone.m_script_strings.AddOrGetScriptString("")); + + return AssetCreationResult::Success(context.AddAsset(std::move(registration))); + } +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.h b/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.h index dbebb186..14bf7512 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.h +++ b/src/ObjLoading/Game/T6/PhysConstraints/InfoStringLoaderPhysConstraintsT6.h @@ -4,12 +4,12 @@ #include "Asset/AssetCreationResult.h" #include "InfoString/InfoString.h" -namespace T6 +namespace T6::phys_constraints { - class InfoStringLoaderPhysConstraints + class InfoStringLoader { public: - InfoStringLoaderPhysConstraints(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context); @@ -18,4 +18,4 @@ namespace T6 ISearchPath& m_search_path; Zone& m_zone; }; -} // namespace T6 +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.cpp b/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.cpp index 0555c180..8a85fe93 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.cpp +++ b/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.cpp @@ -11,6 +11,7 @@ #include using namespace T6; +using namespace ::phys_constraints; namespace { @@ -25,7 +26,7 @@ namespace AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { - const auto fileName = phys_constraints::GetFileNameForAssetName(assetName); + const auto fileName = GetFileNameForAssetName(assetName); const auto file = m_search_path.Open(fileName); if (!file.IsOpen()) return AssetCreationResult::NoAction(); @@ -42,14 +43,14 @@ namespace private: ISearchPath& m_search_path; - InfoStringLoaderPhysConstraints m_info_string_loader; + T6::phys_constraints::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::phys_constraints { - std::unique_ptr> CreateRawPhysConstraintsLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.h b/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.h index dc88bc45..e347be28 100644 --- a/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.h +++ b/src/ObjLoading/Game/T6/PhysConstraints/RawLoaderPhysConstraintsT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::phys_constraints { - std::unique_ptr> CreateRawPhysConstraintsLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::phys_constraints diff --git a/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.cpp b/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.cpp index 9d7f179f..ed681d4f 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.cpp +++ b/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.cpp @@ -16,15 +16,15 @@ namespace class GdtLoaderPhysPreset final : public AssetCreator { public: - GdtLoaderPhysPreset(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + GdtLoaderPhysPreset(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone) : m_gdt(gdt), - m_info_string_loader(memory, searchPath, zone) + m_info_string_loader(memory, zone) { } AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { - const auto* gdtEntry = m_gdt.GetGdtEntryByGdfAndName(ObjConstants::GDF_FILENAME_WEAPON, assetName); + const auto* gdtEntry = m_gdt.GetGdtEntryByGdfAndName(ObjConstants::GDF_FILENAME_PHYS_PRESET, assetName); if (gdtEntry == nullptr) return AssetCreationResult::NoAction(); @@ -40,14 +40,14 @@ namespace private: IGdtQueryable& m_gdt; - InfoStringLoaderPhysPreset m_info_string_loader; + T6::phys_preset::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::phys_preset { - std::unique_ptr> CreateGdtPhysPresetLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone) { - return std::make_unique(memory, searchPath, gdt, zone); + return std::make_unique(memory, gdt, zone); } -} // namespace T6 +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.h b/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.h index c2fdbe8d..c832e2a7 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.h +++ b/src/ObjLoading/Game/T6/PhysPreset/GdtLoaderPhysPresetT6.h @@ -8,7 +8,7 @@ #include -namespace T6 +namespace T6::phys_preset { - std::unique_ptr> CreateGdtPhysPresetLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, IGdtQueryable& gdt, Zone& zone); +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.cpp b/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.cpp index fbd2b9d2..88e86f90 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.cpp +++ b/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.cpp @@ -60,31 +60,39 @@ namespace } } // namespace -InfoStringLoaderPhysPreset::InfoStringLoaderPhysPreset(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) - : m_memory(memory), - m_search_path(searchPath), - m_zone(zone) +namespace T6::phys_preset { -} - -AssetCreationResult InfoStringLoaderPhysPreset::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) -{ - auto* physPreset = m_memory.Alloc(); - physPreset->name = m_memory.Dup(assetName.c_str()); - - AssetRegistration registration(assetName, physPreset); - - PhysPresetInfo physPresetInfo; - memset(&physPresetInfo, 0, sizeof(physPresetInfo)); - InfoStringToPhysPresetConverter converter( - infoString, physPresetInfo, m_zone.m_script_strings, m_memory, context, registration, phys_preset_fields, std::extent_v); - if (!converter.Convert()) + InfoStringLoader::InfoStringLoader(MemoryManager& memory, Zone& zone) + : m_memory(memory), + m_zone(zone) { - std::cerr << std::format("Failed to parse phys preset: \"{}\"\n", assetName); - return AssetCreationResult::Failure(); } - CopyFromPhysPresetInfo(physPresetInfo, *physPreset); + AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) + { + auto* physPreset = m_memory.Alloc(); + physPreset->name = m_memory.Dup(assetName.c_str()); - return AssetCreationResult::Success(context.AddAsset(std::move(registration))); -} + AssetRegistration registration(assetName, physPreset); + + PhysPresetInfo physPresetInfo; + memset(&physPresetInfo, 0, sizeof(physPresetInfo)); + InfoStringToPhysPresetConverter converter(infoString, + physPresetInfo, + m_zone.m_script_strings, + m_memory, + context, + registration, + phys_preset_fields, + std::extent_v); + if (!converter.Convert()) + { + std::cerr << std::format("Failed to parse phys preset: \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + CopyFromPhysPresetInfo(physPresetInfo, *physPreset); + + return AssetCreationResult::Success(context.AddAsset(std::move(registration))); + } +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.h b/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.h index 3e214d60..99d0d1f5 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.h +++ b/src/ObjLoading/Game/T6/PhysPreset/InfoStringLoaderPhysPresetT6.h @@ -4,18 +4,17 @@ #include "Asset/AssetCreationResult.h" #include "InfoString/InfoString.h" -namespace T6 +namespace T6::phys_preset { - class InfoStringLoaderPhysPreset + class InfoStringLoader { public: - InfoStringLoaderPhysPreset(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + InfoStringLoader(MemoryManager& memory, Zone& zone); AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context); private: MemoryManager& m_memory; - ISearchPath& m_search_path; Zone& m_zone; }; -} // namespace T6 +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.cpp b/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.cpp index 237ccbc8..034f11a7 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.cpp +++ b/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.cpp @@ -11,6 +11,7 @@ #include using namespace T6; +using namespace ::phys_preset; namespace { @@ -19,13 +20,13 @@ namespace public: RawLoaderPhysPreset(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) : m_search_path(searchPath), - m_info_string_loader(memory, searchPath, zone) + m_info_string_loader(memory, zone) { } AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { - const auto fileName = phys_preset::GetFileNameForAssetName(assetName); + const auto fileName = GetFileNameForAssetName(assetName); const auto file = m_search_path.Open(fileName); if (!file.IsOpen()) return AssetCreationResult::NoAction(); @@ -42,14 +43,14 @@ namespace private: ISearchPath& m_search_path; - InfoStringLoaderPhysPreset m_info_string_loader; + T6::phys_preset::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::phys_preset { - std::unique_ptr> CreateRawPhysPresetLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.h b/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.h index 44070d9b..ecc7fa40 100644 --- a/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.h +++ b/src/ObjLoading/Game/T6/PhysPreset/RawLoaderPhysPresetT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::phys_preset { - std::unique_ptr> CreateRawPhysPresetLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::phys_preset diff --git a/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.cpp b/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.cpp index e00e88ac..7c2bed1b 100644 --- a/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.cpp +++ b/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.cpp @@ -44,10 +44,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::qdb { - std::unique_ptr> CreateQdbLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::qdb diff --git a/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.h b/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.h index a8d5f9c9..f769cc85 100644 --- a/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.h +++ b/src/ObjLoading/Game/T6/Qdb/LoaderQdbT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::qdb { - std::unique_ptr> CreateQdbLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::qdb diff --git a/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.cpp b/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.cpp index f3352243..f4644e8c 100644 --- a/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.cpp +++ b/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.cpp @@ -114,10 +114,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::raw_file { - std::unique_ptr> CreateRawFileLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::raw_file diff --git a/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.h b/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.h index db44f9a5..1af4421b 100644 --- a/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.h +++ b/src/ObjLoading/Game/T6/RawFile/LoaderRawFileT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::raw_file { - std::unique_ptr> CreateRawFileLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::raw_file diff --git a/src/ObjLoading/Game/T6/Script/LoaderScriptT6.cpp b/src/ObjLoading/Game/T6/Script/LoaderScriptT6.cpp index 5d30b473..e1b98e8e 100644 --- a/src/ObjLoading/Game/T6/Script/LoaderScriptT6.cpp +++ b/src/ObjLoading/Game/T6/Script/LoaderScriptT6.cpp @@ -44,10 +44,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::script { - std::unique_ptr> CreateScriptLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::script diff --git a/src/ObjLoading/Game/T6/Script/LoaderScriptT6.h b/src/ObjLoading/Game/T6/Script/LoaderScriptT6.h index 754da2ec..88c90948 100644 --- a/src/ObjLoading/Game/T6/Script/LoaderScriptT6.h +++ b/src/ObjLoading/Game/T6/Script/LoaderScriptT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::script { - std::unique_ptr> CreateScriptLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::script diff --git a/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.cpp b/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.cpp index f527a521..407d0fb7 100644 --- a/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.cpp +++ b/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.cpp @@ -44,10 +44,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::slug { - std::unique_ptr> CreateSlugLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::slug diff --git a/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.h b/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.h index 49da9e84..bcf50625 100644 --- a/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.h +++ b/src/ObjLoading/Game/T6/Slug/LoaderSlugT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::slug { - std::unique_ptr> CreateSlugLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::slug diff --git a/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.cpp b/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.cpp index d9560241..a07301e6 100644 --- a/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.cpp +++ b/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.cpp @@ -8,6 +8,7 @@ #include using namespace T6; +using namespace ::string_table; namespace { @@ -26,7 +27,7 @@ namespace if (!file.IsOpen()) return AssetCreationResult::NoAction(); - string_table::StringTableLoaderV3 loader; + StringTableLoaderV3 loader; auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream); return AssetCreationResult::Success(context.AddAsset(assetName, stringTable)); @@ -38,10 +39,10 @@ namespace }; } // namespace -namespace T6 +namespace T6::string_table { - std::unique_ptr> CreateStringTableLoader(MemoryManager& memory, ISearchPath& searchPath) + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } -} // namespace T6 +} // namespace T6::string_table diff --git a/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.h b/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.h index 7db144c6..448c15b8 100644 --- a/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.h +++ b/src/ObjLoading/Game/T6/StringTable/LoaderStringTableT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::string_table { - std::unique_ptr> CreateStringTableLoader(MemoryManager& memory, ISearchPath& searchPath); -} // namespace T6 + std::unique_ptr> CreateLoader(MemoryManager& memory, ISearchPath& searchPath); +} // namespace T6::string_table diff --git a/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.cpp b/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.cpp index ee7376ed..84a2dc3b 100644 --- a/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.cpp +++ b/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.cpp @@ -40,14 +40,14 @@ namespace private: IGdtQueryable& m_gdt; - InfoStringLoaderTracer m_info_string_loader; + T6::tracer::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::tracer { - std::unique_ptr> CreateGdtTracerLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) { return std::make_unique(memory, searchPath, gdt, zone); } -} // namespace T6 +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.h b/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.h index d3059ce3..57108194 100644 --- a/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.h +++ b/src/ObjLoading/Game/T6/Tracer/GdtLoaderTracerT6.h @@ -8,7 +8,7 @@ #include -namespace T6 +namespace T6::tracer { - std::unique_ptr> CreateGdtTracerLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.cpp b/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.cpp index 00c21757..03f3a29c 100644 --- a/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.cpp +++ b/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.cpp @@ -3,6 +3,7 @@ #include "Game/T6/InfoString/InfoStringToStructConverter.h" #include "Game/T6/T6.h" #include "Game/T6/Tracer/TracerFields.h" +#include "Tracer/TracerCommon.h" #include #include @@ -11,6 +12,7 @@ #include using namespace T6; +using namespace ::tracer; namespace { @@ -46,27 +48,31 @@ namespace }; } // namespace -InfoStringLoaderTracer::InfoStringLoaderTracer(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) - : m_memory(memory), - m_search_path(searchPath), - m_zone(zone) +namespace T6::tracer { -} - -AssetCreationResult InfoStringLoaderTracer::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) -{ - auto* tracer = m_memory.Alloc(); - tracer->name = m_memory.Dup(assetName.c_str()); - - AssetRegistration registration(assetName, tracer); - - InfoStringToTracerConverter converter( - infoString, *tracer, m_zone.m_script_strings, m_memory, context, registration, tracer_fields, std::extent_v); - if (!converter.Convert()) + InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + : m_memory(memory), + m_search_path(searchPath), + m_zone(zone) { - std::cerr << std::format("Failed to parse tracer: \"{}\"\n", assetName); - return AssetCreationResult::Failure(); } - return AssetCreationResult::Success(context.AddAsset(std::move(registration))); -} + AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) + { + auto* tracer = m_memory.Alloc(); + tracer->name = m_memory.Dup(assetName.c_str()); + + AssetRegistration registration(assetName, tracer); + + InfoStringToTracerConverter converter( + infoString, *tracer, m_zone.m_script_strings, m_memory, context, registration, tracer_fields, std::extent_v); + if (!converter.Convert()) + { + std::cerr << std::format("Failed to parse tracer: \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + return AssetCreationResult::Success(context.AddAsset(std::move(registration))); + } + +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.h b/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.h index 141c8216..2f3c029d 100644 --- a/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.h +++ b/src/ObjLoading/Game/T6/Tracer/InfoStringLoaderTracerT6.h @@ -4,12 +4,12 @@ #include "Asset/AssetCreationResult.h" #include "InfoString/InfoString.h" -namespace T6 +namespace T6::tracer { - class InfoStringLoaderTracer + class InfoStringLoader { public: - InfoStringLoaderTracer(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context); @@ -18,4 +18,4 @@ namespace T6 ISearchPath& m_search_path; Zone& m_zone; }; -} // namespace T6 +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.cpp b/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.cpp index 2361a4ed..162253b2 100644 --- a/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.cpp +++ b/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.cpp @@ -43,14 +43,14 @@ namespace private: ISearchPath& m_search_path; - InfoStringLoaderTracer m_info_string_loader; + T6::tracer::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::tracer { - std::unique_ptr> CreateRawTracerLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.h b/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.h index a41e74c2..500c992d 100644 --- a/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.h +++ b/src/ObjLoading/Game/T6/Tracer/RawLoaderTracerT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::tracer { - std::unique_ptr> CreateRawTracerLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::tracer diff --git a/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.cpp b/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.cpp index 7b224773..932bc544 100644 --- a/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.cpp +++ b/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.cpp @@ -40,14 +40,14 @@ namespace private: IGdtQueryable& m_gdt; - InfoStringLoaderVehicle m_info_string_loader; + T6::vehicle::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::vehicle { - std::unique_ptr> CreateGdtVehicleLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) { return std::make_unique(memory, searchPath, gdt, zone); } -} // namespace T6 +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.h b/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.h index fee2a56d..b24400df 100644 --- a/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.h +++ b/src/ObjLoading/Game/T6/Vehicle/GdtLoaderVehicleT6.h @@ -8,7 +8,7 @@ #include -namespace T6 +namespace T6::vehicle { - std::unique_ptr> CreateGdtVehicleLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.cpp b/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.cpp index 4999f0bb..b0a6150b 100644 --- a/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.cpp +++ b/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.cpp @@ -107,27 +107,30 @@ namespace }; } // namespace -InfoStringLoaderVehicle::InfoStringLoaderVehicle(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) - : m_memory(memory), - m_search_path(searchPath), - m_zone(zone) +namespace T6::vehicle { -} - -AssetCreationResult InfoStringLoaderVehicle::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) -{ - auto* vehicleDef = m_memory.Alloc(); - vehicleDef->name = m_memory.Dup(assetName.c_str()); - - AssetRegistration registration(assetName, vehicleDef); - - InfoStringToVehicleConverter converter( - infoString, *vehicleDef, m_zone.m_script_strings, m_memory, context, registration, vehicle_fields, std::extent_v); - if (!converter.Convert()) + InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + : m_memory(memory), + m_search_path(searchPath), + m_zone(zone) { - std::cerr << std::format("Failed to parse vehicle: \"{}\"\n", assetName); - return AssetCreationResult::Failure(); } - return AssetCreationResult::Success(context.AddAsset(std::move(registration))); -} + AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) + { + auto* vehicleDef = m_memory.Alloc(); + vehicleDef->name = m_memory.Dup(assetName.c_str()); + + AssetRegistration registration(assetName, vehicleDef); + + InfoStringToVehicleConverter converter( + infoString, *vehicleDef, m_zone.m_script_strings, m_memory, context, registration, vehicle_fields, std::extent_v); + if (!converter.Convert()) + { + std::cerr << std::format("Failed to parse vehicle: \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + return AssetCreationResult::Success(context.AddAsset(std::move(registration))); + } +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.h b/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.h index 9aed730e..f8cacd00 100644 --- a/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.h +++ b/src/ObjLoading/Game/T6/Vehicle/InfoStringLoaderVehicleT6.h @@ -4,12 +4,12 @@ #include "Asset/AssetCreationResult.h" #include "InfoString/InfoString.h" -namespace T6 +namespace T6::vehicle { - class InfoStringLoaderVehicle + class InfoStringLoader { public: - InfoStringLoaderVehicle(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context); @@ -18,4 +18,4 @@ namespace T6 ISearchPath& m_search_path; Zone& m_zone; }; -} // namespace T6 +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.cpp b/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.cpp index 154a9da3..5e829b85 100644 --- a/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.cpp +++ b/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.cpp @@ -43,14 +43,14 @@ namespace private: ISearchPath& m_search_path; - InfoStringLoaderVehicle m_info_string_loader; + T6::vehicle::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::vehicle { - std::unique_ptr> CreateRawVehicleLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.h b/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.h index e88d6909..37a709d6 100644 --- a/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.h +++ b/src/ObjLoading/Game/T6/Vehicle/RawLoaderVehicleT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::vehicle { - std::unique_ptr> CreateRawVehicleLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::vehicle diff --git a/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.cpp b/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.cpp index cba149e6..0f8d5d22 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.cpp +++ b/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.cpp @@ -40,14 +40,14 @@ namespace private: IGdtQueryable& m_gdt; - InfoStringLoaderZBarrier m_info_string_loader; + T6::z_barrier::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::z_barrier { - std::unique_ptr> CreateGdtZBarrierLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone) { return std::make_unique(memory, searchPath, gdt, zone); } -} // namespace T6 +} // namespace T6::z_barrier diff --git a/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.h b/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.h index af3796b9..7631005e 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.h +++ b/src/ObjLoading/Game/T6/ZBarrier/GdtLoaderZBarrierT6.h @@ -8,7 +8,7 @@ #include -namespace T6 +namespace T6::z_barrier { - std::unique_ptr> CreateGdtZBarrierLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone); +} // namespace T6::z_barrier diff --git a/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.cpp b/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.cpp index 23c460b9..43d93ab3 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.cpp +++ b/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.cpp @@ -55,29 +55,32 @@ namespace } } // namespace -InfoStringLoaderZBarrier::InfoStringLoaderZBarrier(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) - : m_memory(memory), - m_search_path(searchPath), - m_zone(zone) +namespace T6::z_barrier { -} - -AssetCreationResult InfoStringLoaderZBarrier::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) -{ - auto* zbarrier = m_memory.Alloc(); - zbarrier->name = m_memory.Dup(assetName.c_str()); - - AssetRegistration registration(assetName, zbarrier); - - InfoStringToZBarrierConverter converter( - infoString, *zbarrier, m_zone.m_script_strings, m_memory, context, registration, zbarrier_fields, std::extent_v); - if (!converter.Convert()) + InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + : m_memory(memory), + m_search_path(searchPath), + m_zone(zone) { - std::cerr << std::format("Failed to parse zbarrier: \"{}\"\n", assetName); - return AssetCreationResult::Failure(); } - CalculateZBarrierFields(*zbarrier); + AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context) + { + auto* zbarrier = m_memory.Alloc(); + zbarrier->name = m_memory.Dup(assetName.c_str()); - return AssetCreationResult::Success(context.AddAsset(std::move(registration))); -} + AssetRegistration registration(assetName, zbarrier); + + InfoStringToZBarrierConverter converter( + infoString, *zbarrier, m_zone.m_script_strings, m_memory, context, registration, zbarrier_fields, std::extent_v); + if (!converter.Convert()) + { + std::cerr << std::format("Failed to parse zbarrier: \"{}\"\n", assetName); + return AssetCreationResult::Failure(); + } + + CalculateZBarrierFields(*zbarrier); + + return AssetCreationResult::Success(context.AddAsset(std::move(registration))); + } +} // namespace T6::z_barrier diff --git a/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.h b/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.h index 5a70ec28..efba4096 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.h +++ b/src/ObjLoading/Game/T6/ZBarrier/InfoStringLoaderZBarrierT6.h @@ -4,12 +4,12 @@ #include "Asset/AssetCreationResult.h" #include "InfoString/InfoString.h" -namespace T6 +namespace T6::z_barrier { - class InfoStringLoaderZBarrier + class InfoStringLoader { public: - InfoStringLoaderZBarrier(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context); @@ -18,4 +18,4 @@ namespace T6 ISearchPath& m_search_path; Zone& m_zone; }; -} // namespace T6 +} // namespace T6::z_barrier diff --git a/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.cpp b/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.cpp index 0d51eca5..9f0b3349 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.cpp +++ b/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.cpp @@ -43,14 +43,14 @@ namespace private: ISearchPath& m_search_path; - InfoStringLoaderZBarrier m_info_string_loader; + T6::z_barrier::InfoStringLoader m_info_string_loader; }; } // namespace -namespace T6 +namespace T6::z_barrier { - std::unique_ptr> CreateRawZBarrierLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) { return std::make_unique(memory, searchPath, zone); } -} // namespace T6 +} // namespace T6::z_barrier diff --git a/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.h b/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.h index 007b2306..0ae04d30 100644 --- a/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.h +++ b/src/ObjLoading/Game/T6/ZBarrier/RawLoaderZBarrierT6.h @@ -7,7 +7,7 @@ #include -namespace T6 +namespace T6::z_barrier { - std::unique_ptr> CreateRawZBarrierLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); -} // namespace T6 + std::unique_ptr> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); +} // namespace T6::z_barrier diff --git a/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp b/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp index 87004412..163a4575 100644 --- a/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp @@ -26,7 +26,7 @@ namespace IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext context(zone, &creatorCollection, &ignoredAssetLookup); - auto loader = CreateStringTableLoader(memory, searchPath); + auto loader = string_table::CreateLoader(memory, searchPath); auto result = loader->CreateAsset("mp/cooltable.csv", context); REQUIRE(result.HasBeenSuccessful()); diff --git a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp index f99d761f..d61e4096 100644 --- a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp @@ -90,7 +90,7 @@ namespace GivenMaterial("ui_button_xenon_lstick_anim_d", context, memory); GivenMaterial("xenonbutton_ls", context, memory); - auto loader = CreateJsonFontIconLoader(memory, searchPath); + auto loader = font_icon::CreateJsonLoader(memory, searchPath); auto result = loader->CreateAsset("fonticon/test.csv", context); REQUIRE(result.HasBeenSuccessful()); diff --git a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp index 454054a6..609c5200 100644 --- a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp @@ -253,7 +253,7 @@ namespace GivenImage("~-gmetal_ac_duct_c", context, memory); GivenTechset("wpc_lit_sm_r0c0n0s0_1zzj1138", context, memory); - auto loader = CreateMaterialLoader(memory, searchPath); + auto loader = material::CreateLoader(memory, searchPath); auto result = loader->CreateAsset("wpc/metal_ac_duct", context); REQUIRE(result.HasBeenSuccessful());