diff --git a/deps/fmt b/deps/fmt index 49ccb2e4..d8867a2b 160000 --- a/deps/fmt +++ b/deps/fmt @@ -1 +1 @@ -Subproject commit 49ccb2e4497ce3d2acae9c0cca81756aa341627d +Subproject commit d8867a2b07b8be2adf5d503ecc9d9e65dcc59ec2 diff --git a/src/Components/Modules/AssetInterfaces/IXModel.cpp b/src/Components/Modules/AssetInterfaces/IXModel.cpp index bd509e9c..55abc41b 100644 --- a/src/Components/Modules/AssetInterfaces/IXModel.cpp +++ b/src/Components/Modules/AssetInterfaces/IXModel.cpp @@ -44,18 +44,19 @@ namespace Assets Game::XModelSurfs* surf = builder->GetAllocator()->Allocate(); std::memcpy(surf, baseModel->lods[0].surfaces, sizeof(Game::XModelSurfs)); - surf->name = builder->GetAllocator()->DuplicateString(fmt::sprintf("%s1", model->name)); + surf->name = builder->GetAllocator()->DuplicateString(fmt::sprintf("%s_lod1", model->name)); surf->surfaces = builder->GetAllocator()->AllocateArray(model->numSurfaces); surf->numSurfaces = model->numSurfaces; + ZeroMemory(&model->lods[0], sizeof(Game::XModelLodInfo)); model->lods[0].numSurfs = model->numSurfaces; model->lods[0].surfaces = surf; + model->numLods = 1; // Reset surfaces in remaining lods for (unsigned int i = 1; i < 4; ++i) { - model->lods[i].numSurfs = 0; - model->lods[i].surfaces = nullptr; + ZeroMemory(&model->lods[i], sizeof(Game::XModelLodInfo)); } // Read surfaces @@ -64,10 +65,16 @@ namespace Assets Game::XSurface* surface = &surf->surfaces[i]; std::memcpy(surface, baseSurface, sizeof(Game::XSurface)); + surface->tileMode = reader.Read(); + surface->deformed = reader.Read(); + surface->streamHandle = reader.Read(); surface->something = reader.Read(); surface->something2 = reader.Read(); + surface->pad2 = reader.Read(); + surface->pad3 = reader.Read(); + surface->numVertices = reader.Read(); surface->numPrimitives = reader.Read(); surface->numCT = reader.Read(); diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 72069472..1e636b4f 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -1386,7 +1386,8 @@ namespace Game struct XSurface { - short pad; // +0 + char tileMode; + char deformed; unsigned short numVertices; // +2 unsigned short numPrimitives; // +4 unsigned char streamHandle; // something to do with buffers, +6