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 bspName;
bool isZombiesMap;
BSPWorld gfxWorld;
BSPWorld colWorld;
+2 -1
View File
@@ -1038,7 +1038,7 @@ namespace
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 isGfxFileGltf = true;
@@ -1075,6 +1075,7 @@ namespace BSP
std::unique_ptr<BSPData> bsp = std::make_unique<BSPData>();
bsp->name = mapName;
bsp->bspName = "maps/mp/" + mapName + ".d3dbsp";
bsp->isZombiesMap = isZombiesMap;
BSPLoader loader(bsp.get());
if (isGfxFileGltf)
+1 -1
View File
@@ -5,5 +5,5 @@
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
+7 -5
View File
@@ -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<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)
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<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
+2 -1
View File
@@ -4,10 +4,11 @@
#include "Game/T6/T6.h"
#include "SearchPath/ISearchPath.h"
#include "Utils/MemoryManager.h"
#include "Zone/Definition/ZoneDefinition.h"
#include <memory>
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
+1 -1
View File
@@ -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