diff --git a/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp b/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp index d957d0f8..43390e00 100644 --- a/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp +++ b/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp @@ -758,7 +758,8 @@ namespace BSP // any vertex count over the uint16_t max means the vertices above the uint16_t max can't be indexed if (static_cast(bsp->colWorld.vertices.size()) > BSPGameConstants::MAX_COLLISION_VERTS) { - con::error("ERROR: collision vertex count %i exceeds the maximum number: %i!\n", clipMap->vertCount, BSPGameConstants::MAX_COLLISION_VERTS); + con::error( + "ERROR: collision vertex count {} exceeds the maximum number: {}!\n", bsp->colWorld.vertices.size(), BSPGameConstants::MAX_COLLISION_VERTS); return false; } diff --git a/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp b/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp index 03e10c02..51b00f78 100644 --- a/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp +++ b/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp @@ -1,5 +1,6 @@ #include "GfxWorldLinker.h" +#include "../BSPCalculation.h" #include "../BSPUtil.h" #include "Utils/Pack.h" @@ -463,6 +464,12 @@ namespace BSP gfxWorld->lightGrid.skyGridVolumes = nullptr; } + struct mnode_t + { + unsigned __int16 cellIndex; + unsigned __int16 rightChildOffset; + }; + void GfxWorldLinker::loadGfxCells(GfxWorld* gfxWorld) { // Cells are basically data used to determine what can be seen and what cant be seen @@ -518,6 +525,7 @@ namespace BSP // Nodes mnode_t.cellIndex indexes gfxWorld->cells // and (mnode_t.cellIndex - (world->dpvsPlanes.cellCount + 1) indexes world->dpvsPlanes.planes // Use only one node as there is no optimisation in custom maps + gfxWorld->nodeCount = 1; gfxWorld->dpvsPlanes.nodes = m_memory.Alloc(gfxWorld->nodeCount); gfxWorld->dpvsPlanes.nodes[0] = 1; // nodes reference cells by index + 1 @@ -703,8 +711,7 @@ namespace BSP void GfxWorldLinker::loadSkyBox(BSPData* projInfo, GfxWorld* gfxWorld) { - // std::string skyBoxName = "skybox_" + projInfo->name; - std::string skyBoxName = "skybox_zm_transit"; + std::string skyBoxName = "skybox_" + projInfo->name; gfxWorld->skyBoxModel = m_memory.Dup(skyBoxName.c_str()); if (m_context.LoadDependency(skyBoxName) == nullptr)