2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

chorse: groundwork for implementing zombies maps

This commit is contained in:
LJW-Dev
2026-03-23 13:28:28 +08:00
committed by Jan Laupetin
parent 4e3e0a8ca0
commit 98cd833206
6 changed files with 14 additions and 9 deletions
+1
View File
@@ -117,6 +117,7 @@ namespace BSP
{ {
std::string name; std::string name;
std::string bspName; std::string bspName;
bool isZombiesMap;
BSPWorld gfxWorld; BSPWorld gfxWorld;
BSPWorld colWorld; BSPWorld colWorld;
+2 -1
View File
@@ -1038,7 +1038,7 @@ namespace
namespace BSP namespace BSP
{ {
std::unique_ptr<BSPData> createBSPData(std::string& mapName, ISearchPath& searchPath) std::unique_ptr<BSPData> createBSPData(std::string& mapName, ISearchPath& searchPath, bool isZombiesMap)
{ {
bool seperateColFile = true; bool seperateColFile = true;
bool isGfxFileGltf = true; bool isGfxFileGltf = true;
@@ -1075,6 +1075,7 @@ namespace BSP
std::unique_ptr<BSPData> bsp = std::make_unique<BSPData>(); std::unique_ptr<BSPData> bsp = std::make_unique<BSPData>();
bsp->name = mapName; bsp->name = mapName;
bsp->bspName = "maps/mp/" + mapName + ".d3dbsp"; bsp->bspName = "maps/mp/" + mapName + ".d3dbsp";
bsp->isZombiesMap = isZombiesMap;
BSPLoader loader(bsp.get()); BSPLoader loader(bsp.get());
if (isGfxFileGltf) if (isGfxFileGltf)
+1 -1
View File
@@ -5,5 +5,5 @@
namespace BSP namespace BSP
{ {
std::unique_ptr<BSPData> createBSPData(std::string& mapName, ISearchPath& searchPath); std::unique_ptr<BSPData> createBSPData(std::string& mapName, ISearchPath& searchPath, bool isZombiesMap);
}; // namespace BSP }; // namespace BSP
+7 -5
View File
@@ -11,10 +11,11 @@ namespace
class BSPLoader final : public IAssetCreator class BSPLoader final : public IAssetCreator
{ {
public: public:
BSPLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) BSPLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType)
: m_memory(memory), : m_memory(memory),
m_search_path(searchPath), m_search_path(searchPath),
m_zone(zone) m_zone(zone),
m_mapType(mapType)
{ {
} }
@@ -32,7 +33,7 @@ namespace
bool FinalizeZone(AssetCreationContext& context) override bool FinalizeZone(AssetCreationContext& context) override
{ {
std::unique_ptr<BSPData> bsp = BSP::createBSPData(m_zone.m_name, m_search_path); std::unique_ptr<BSPData> bsp = BSP::createBSPData(m_zone.m_name, m_search_path, m_mapType == ZoneDefinitionMapType::ZM);
if (bsp == nullptr) if (bsp == nullptr)
return false; return false;
@@ -48,13 +49,14 @@ namespace
MemoryManager& m_memory; MemoryManager& m_memory;
ISearchPath& m_search_path; ISearchPath& m_search_path;
Zone& m_zone; Zone& m_zone;
ZoneDefinitionMapType m_mapType;
}; };
} // namespace } // namespace
namespace BSP namespace BSP
{ {
std::unique_ptr<IAssetCreator> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) std::unique_ptr<IAssetCreator> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType)
{ {
return std::make_unique<BSPLoader>(memory, searchPath, zone); return std::make_unique<BSPLoader>(memory, searchPath, zone, mapType);
} }
} // namespace BSP } // namespace BSP
+2 -1
View File
@@ -4,10 +4,11 @@
#include "Game/T6/T6.h" #include "Game/T6/T6.h"
#include "SearchPath/ISearchPath.h" #include "SearchPath/ISearchPath.h"
#include "Utils/MemoryManager.h" #include "Utils/MemoryManager.h"
#include "Zone/Definition/ZoneDefinition.h"
#include <memory> #include <memory>
namespace BSP namespace BSP
{ {
std::unique_ptr<IAssetCreator> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone); std::unique_ptr<IAssetCreator> CreateLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone, ZoneDefinitionMapType mapType);
} // namespace BSP } // namespace BSP
+1 -1
View File
@@ -446,7 +446,7 @@ namespace T6
collection.AddSubAssetCreator(techset::CreatePixelShaderLoaderT6(memory, searchPath)); collection.AddSubAssetCreator(techset::CreatePixelShaderLoaderT6(memory, searchPath));
if (definition.m_map_type != ZoneDefinitionMapType::NONE) 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 } // namespace