diff --git a/src/ObjLoading/Game/T6/BSP/BSP.h b/src/ObjLoading/Game/T6/BSP/BSP.h index c545c69a..8e49b62e 100644 --- a/src/ObjLoading/Game/T6/BSP/BSP.h +++ b/src/ObjLoading/Game/T6/BSP/BSP.h @@ -117,6 +117,7 @@ namespace BSP { std::string name; std::string bspName; + bool isZombiesMap; BSPWorld gfxWorld; BSPWorld colWorld; diff --git a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp index e8d82426..e801fae6 100644 --- a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp +++ b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp @@ -1038,7 +1038,7 @@ namespace namespace BSP { - std::unique_ptr createBSPData(std::string& mapName, ISearchPath& searchPath) + std::unique_ptr createBSPData(std::string& mapName, ISearchPath& searchPath, bool isZombiesMap) { bool seperateColFile = true; bool isGfxFileGltf = true; @@ -1075,6 +1075,7 @@ namespace BSP std::unique_ptr bsp = std::make_unique(); bsp->name = mapName; bsp->bspName = "maps/mp/" + mapName + ".d3dbsp"; + bsp->isZombiesMap = isZombiesMap; BSPLoader loader(bsp.get()); if (isGfxFileGltf) diff --git a/src/ObjLoading/Game/T6/BSP/BSPCreator.h b/src/ObjLoading/Game/T6/BSP/BSPCreator.h index 8ab85e61..bdd0a20c 100644 --- a/src/ObjLoading/Game/T6/BSP/BSPCreator.h +++ b/src/ObjLoading/Game/T6/BSP/BSPCreator.h @@ -5,5 +5,5 @@ namespace BSP { - std::unique_ptr createBSPData(std::string& mapName, ISearchPath& searchPath); + std::unique_ptr createBSPData(std::string& mapName, ISearchPath& searchPath, bool isZombiesMap); }; // namespace BSP diff --git a/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.cpp b/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.cpp index a1399c8e..ec5ac271 100644 --- a/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.cpp +++ b/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.cpp @@ -11,10 +11,11 @@ namespace class BSPLoader final : public IAssetCreator { public: - BSPLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + BSPLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType) : m_memory(memory), m_search_path(searchPath), - m_zone(zone) + m_zone(zone), + m_mapType(mapType) { } @@ -32,7 +33,7 @@ namespace bool FinalizeZone(AssetCreationContext& context) override { - std::unique_ptr bsp = BSP::createBSPData(m_zone.m_name, m_search_path); + std::unique_ptr bsp = BSP::createBSPData(m_zone.m_name, m_search_path, m_mapType == ZoneDefinitionMapType::ZM); if (bsp == nullptr) return false; @@ -48,13 +49,14 @@ namespace MemoryManager& m_memory; ISearchPath& m_search_path; Zone& m_zone; + ZoneDefinitionMapType m_mapType; }; } // namespace namespace BSP { - std::unique_ptr CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) + std::unique_ptr CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType) { - return std::make_unique(memory, searchPath, zone); + return std::make_unique(memory, searchPath, zone, mapType); } } // namespace BSP diff --git a/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.h b/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.h index 25ca4f8a..9d0d0405 100644 --- a/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.h +++ b/src/ObjLoading/Game/T6/BSP/LoaderBSP_T6.h @@ -4,10 +4,11 @@ #include "Game/T6/T6.h" #include "SearchPath/ISearchPath.h" #include "Utils/MemoryManager.h" +#include "Zone/Definition/ZoneDefinition.h" #include namespace BSP { - std::unique_ptr CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); + std::unique_ptr CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType); } // namespace BSP diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp index a8545702..b83d3eff 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp @@ -446,7 +446,7 @@ namespace T6 collection.AddSubAssetCreator(techset::CreatePixelShaderLoaderT6(memory, searchPath)); if (definition.m_map_type != ZoneDefinitionMapType::NONE) - collection.AddAssetCreator(BSP::CreateLoaderT6(memory, searchPath, zone)); + collection.AddAssetCreator(BSP::CreateLoaderT6(memory, searchPath, zone, definition.m_map_type)); } } // namespace