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

chore: various minor additions

This commit is contained in:
LJW-Dev
2026-03-29 18:48:44 +08:00
committed by Jan Laupetin
parent 68c9a8df7d
commit 0d7690e8ea
2 changed files with 11 additions and 3 deletions
@@ -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 // any vertex count over the uint16_t max means the vertices above the uint16_t max can't be indexed
if (static_cast<unsigned int>(bsp->colWorld.vertices.size()) > BSPGameConstants::MAX_COLLISION_VERTS) if (static_cast<unsigned int>(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; return false;
} }
@@ -1,5 +1,6 @@
#include "GfxWorldLinker.h" #include "GfxWorldLinker.h"
#include "../BSPCalculation.h"
#include "../BSPUtil.h" #include "../BSPUtil.h"
#include "Utils/Pack.h" #include "Utils/Pack.h"
@@ -463,6 +464,12 @@ namespace BSP
gfxWorld->lightGrid.skyGridVolumes = nullptr; gfxWorld->lightGrid.skyGridVolumes = nullptr;
} }
struct mnode_t
{
unsigned __int16 cellIndex;
unsigned __int16 rightChildOffset;
};
void GfxWorldLinker::loadGfxCells(GfxWorld* gfxWorld) void GfxWorldLinker::loadGfxCells(GfxWorld* gfxWorld)
{ {
// Cells are basically data used to determine what can be seen and what cant be seen // 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 // Nodes mnode_t.cellIndex indexes gfxWorld->cells
// and (mnode_t.cellIndex - (world->dpvsPlanes.cellCount + 1) indexes world->dpvsPlanes.planes // and (mnode_t.cellIndex - (world->dpvsPlanes.cellCount + 1) indexes world->dpvsPlanes.planes
// Use only one node as there is no optimisation in custom maps // Use only one node as there is no optimisation in custom maps
gfxWorld->nodeCount = 1; gfxWorld->nodeCount = 1;
gfxWorld->dpvsPlanes.nodes = m_memory.Alloc<uint16_t>(gfxWorld->nodeCount); gfxWorld->dpvsPlanes.nodes = m_memory.Alloc<uint16_t>(gfxWorld->nodeCount);
gfxWorld->dpvsPlanes.nodes[0] = 1; // nodes reference cells by index + 1 gfxWorld->dpvsPlanes.nodes[0] = 1; // nodes reference cells by index + 1
@@ -703,8 +711,7 @@ namespace BSP
void GfxWorldLinker::loadSkyBox(BSPData* projInfo, GfxWorld* gfxWorld) void GfxWorldLinker::loadSkyBox(BSPData* projInfo, GfxWorld* gfxWorld)
{ {
// std::string skyBoxName = "skybox_" + projInfo->name; std::string skyBoxName = "skybox_" + projInfo->name;
std::string skyBoxName = "skybox_zm_transit";
gfxWorld->skyBoxModel = m_memory.Dup(skyBoxName.c_str()); gfxWorld->skyBoxModel = m_memory.Dup(skyBoxName.c_str());
if (m_context.LoadDependency<AssetXModel>(skyBoxName) == nullptr) if (m_context.LoadDependency<AssetXModel>(skyBoxName) == nullptr)