diff --git a/src/Linking/ZoneCreation/ZoneCreator.cpp b/src/Linking/ZoneCreation/ZoneCreator.cpp index c7cb4d5c..269b6a4c 100644 --- a/src/Linking/ZoneCreation/ZoneCreator.cpp +++ b/src/Linking/ZoneCreation/ZoneCreator.cpp @@ -72,7 +72,7 @@ namespace zone_creator OutputPathFilesystem cacheDir(context.m_cache_dir); objCompiler->ConfigureCreatorCollection( creatorCollection, *zone, zoneDefinitionContext, *context.m_asset_search_path, lookup, creationContext, outDir, cacheDir); - objLoader->ConfigureCreatorCollection(creatorCollection, *zone, *context.m_asset_search_path, lookup); + objLoader->ConfigureCreatorCollection(creatorCollection, *zone, *context.m_asset_search_path, lookup, *context.m_definition); for (const auto& assetEntry : context.m_definition->m_assets) { diff --git a/src/ObjLoading/Game/IW3/ObjLoaderIW3.cpp b/src/ObjLoading/Game/IW3/ObjLoaderIW3.cpp index f7532754..95a7a431 100644 --- a/src/ObjLoading/Game/IW3/ObjLoaderIW3.cpp +++ b/src/ObjLoading/Game/IW3/ObjLoaderIW3.cpp @@ -130,7 +130,8 @@ namespace } } // namespace -void ObjLoader::ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const +void ObjLoader::ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const { ConfigureDefaultCreators(collection, zone); ConfigureLoaders(collection, zone, searchPath, gdt); diff --git a/src/ObjLoading/Game/IW3/ObjLoaderIW3.h b/src/ObjLoading/Game/IW3/ObjLoaderIW3.h index a11c9d51..b2cde58c 100644 --- a/src/ObjLoading/Game/IW3/ObjLoaderIW3.h +++ b/src/ObjLoading/Game/IW3/ObjLoaderIW3.h @@ -11,6 +11,7 @@ namespace IW3 void LoadReferencedContainersForZone(ISearchPath& searchPath, Zone& zone) const override; void UnloadContainersOfZone(Zone& zone) const override; - void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const override; + void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const override; }; } // namespace IW3 diff --git a/src/ObjLoading/Game/IW4/ObjLoaderIW4.cpp b/src/ObjLoading/Game/IW4/ObjLoaderIW4.cpp index 1bc7f913..8f6970b2 100644 --- a/src/ObjLoading/Game/IW4/ObjLoaderIW4.cpp +++ b/src/ObjLoading/Game/IW4/ObjLoaderIW4.cpp @@ -163,7 +163,8 @@ namespace } } // namespace -void ObjLoader::ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const +void ObjLoader::ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const { ConfigureDefaultCreators(collection, zone); ConfigureLoaders(collection, zone, searchPath, gdt); diff --git a/src/ObjLoading/Game/IW4/ObjLoaderIW4.h b/src/ObjLoading/Game/IW4/ObjLoaderIW4.h index 4d080914..7f9b5cad 100644 --- a/src/ObjLoading/Game/IW4/ObjLoaderIW4.h +++ b/src/ObjLoading/Game/IW4/ObjLoaderIW4.h @@ -12,6 +12,7 @@ namespace IW4 void LoadReferencedContainersForZone(ISearchPath& searchPath, Zone& zone) const override; void UnloadContainersOfZone(Zone& zone) const override; - void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const override; + void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const override; }; } // namespace IW4 diff --git a/src/ObjLoading/Game/IW5/ObjLoaderIW5.cpp b/src/ObjLoading/Game/IW5/ObjLoaderIW5.cpp index a015ee7d..96add9d3 100644 --- a/src/ObjLoading/Game/IW5/ObjLoaderIW5.cpp +++ b/src/ObjLoading/Game/IW5/ObjLoaderIW5.cpp @@ -173,7 +173,8 @@ namespace } } // namespace -void ObjLoader::ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const +void ObjLoader::ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const { ConfigureDefaultCreators(collection, zone); ConfigureLoaders(collection, zone, searchPath, gdt); diff --git a/src/ObjLoading/Game/IW5/ObjLoaderIW5.h b/src/ObjLoading/Game/IW5/ObjLoaderIW5.h index 2b882ecb..3337c4bc 100644 --- a/src/ObjLoading/Game/IW5/ObjLoaderIW5.h +++ b/src/ObjLoading/Game/IW5/ObjLoaderIW5.h @@ -11,6 +11,7 @@ namespace IW5 void LoadReferencedContainersForZone(ISearchPath& searchPath, Zone& zone) const override; void UnloadContainersOfZone(Zone& zone) const override; - void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const override; + void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const override; }; } // namespace IW5 diff --git a/src/ObjLoading/Game/T5/ObjLoaderT5.cpp b/src/ObjLoading/Game/T5/ObjLoaderT5.cpp index 2c72f5c1..673b34a1 100644 --- a/src/ObjLoading/Game/T5/ObjLoaderT5.cpp +++ b/src/ObjLoading/Game/T5/ObjLoaderT5.cpp @@ -147,7 +147,8 @@ namespace } } // namespace -void ObjLoader::ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const +void ObjLoader::ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const { ConfigureDefaultCreators(collection, zone); ConfigureLoaders(collection, zone, searchPath, gdt); diff --git a/src/ObjLoading/Game/T5/ObjLoaderT5.h b/src/ObjLoading/Game/T5/ObjLoaderT5.h index 99fc99c8..3da8ab8d 100644 --- a/src/ObjLoading/Game/T5/ObjLoaderT5.h +++ b/src/ObjLoading/Game/T5/ObjLoaderT5.h @@ -11,6 +11,7 @@ namespace T5 void LoadReferencedContainersForZone(ISearchPath& searchPath, Zone& zone) const override; void UnloadContainersOfZone(Zone& zone) const override; - void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const override; + void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const override; }; } // namespace T5 diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp index d534d9b0..a8545702 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp @@ -1,3 +1,5 @@ +#include "ObjLoaderT6.h" + #include "Asset/GlobalAssetPoolsLoader.h" #include "BSP/LoaderBSP_T6.h" #include "FontIcon/CsvLoaderFontIconT6.h" @@ -20,7 +22,6 @@ #include "Localize/LocalizeLoaderT6.h" #include "Material/LoaderMaterialT6.h" #include "ObjContainer/IPak/IPak.h" -#include "ObjLoaderT6.h" #include "ObjLoading.h" #include "PhysConstraints/GdtLoaderPhysConstraintsT6.h" #include "PhysConstraints/RawLoaderPhysConstraintsT6.h" @@ -379,7 +380,7 @@ namespace T6 // collection.AddAssetCreator(std::make_unique>(zone)); } - void ConfigureLoaders(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) + void ConfigureLoaders(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) { auto& memory = zone.Memory(); @@ -444,14 +445,16 @@ namespace T6 collection.AddSubAssetCreator(techset::CreateVertexShaderLoaderT6(memory, searchPath)); collection.AddSubAssetCreator(techset::CreatePixelShaderLoaderT6(memory, searchPath)); - collection.AddAssetCreator(BSP::CreateLoaderT6(memory, searchPath, zone)); + if (definition.m_map_type != ZoneDefinitionMapType::NONE) + collection.AddAssetCreator(BSP::CreateLoaderT6(memory, searchPath, zone)); } } // namespace - void ObjLoader::ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const + void ObjLoader::ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const { ConfigureDefaultCreators(collection, zone); - ConfigureLoaders(collection, zone, searchPath, gdt); + ConfigureLoaders(collection, zone, searchPath, gdt, definition); ConfigureGlobalAssetPoolsLoaders(collection, zone); } } // namespace T6 diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.h b/src/ObjLoading/Game/T6/ObjLoaderT6.h index 6e210b85..f373ef2b 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.h +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.h @@ -18,7 +18,8 @@ namespace T6 void LoadReferencedContainersForZone(ISearchPath& searchPath, Zone& zone) const override; void UnloadContainersOfZone(Zone& zone) const override; - void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const override; + void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const override; private: static bool VerifySoundBankChecksum(const SoundBank& soundBank, const SndRuntimeAssetBank& sndRuntimeAssetBank); diff --git a/src/ObjLoading/IObjLoader.h b/src/ObjLoading/IObjLoader.h index b534cac6..15aa8278 100644 --- a/src/ObjLoading/IObjLoader.h +++ b/src/ObjLoading/IObjLoader.h @@ -3,6 +3,7 @@ #include "Asset/AssetCreatorCollection.h" #include "Gdt/IGdtQueryable.h" #include "SearchPath/ISearchPath.h" +#include "Zone/Definition/ZoneDefinition.h" #include "Zone/Zone.h" class IObjLoader @@ -28,7 +29,8 @@ public: */ virtual void UnloadContainersOfZone(Zone& zone) const = 0; - virtual void ConfigureCreatorCollection(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) const = 0; + virtual void ConfigureCreatorCollection( + AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt, ZoneDefinition& definition) const = 0; static const IObjLoader* GetObjLoaderForGame(GameId game); };