diff --git a/src/Components/Modules/AssetInterfaces/IXModel.cpp b/src/Components/Modules/AssetInterfaces/IXModel.cpp index 5b8a16ec..a89b05e8 100644 --- a/src/Components/Modules/AssetInterfaces/IXModel.cpp +++ b/src/Components/Modules/AssetInterfaces/IXModel.cpp @@ -1,6 +1,6 @@ #include -#define IW4X_MODEL_VERSION 1 +#define IW4X_MODEL_VERSION 2 namespace Assets { @@ -91,12 +91,13 @@ namespace Assets surface->deformed = reader.read(); surface->streamHandle = reader.read(); - surface->flags = reader.read(); - surface->something = reader.read(); - surface->something2 = reader.read(); + surface->partBits[0] = reader.read(); + surface->partBits[1] = reader.read(); + surface->partBits[2] = reader.read(); + surface->partBits[3] = reader.read(); - surface->pad2 = reader.read(); - surface->pad3 = reader.read(); + surface->baseTriIndex = reader.read(); + surface->baseVertIndex = reader.read(); surface->numVertices = reader.read(); surface->numPrimitives = reader.read(); diff --git a/src/Components/Modules/ModelSurfs.cpp b/src/Components/Modules/ModelSurfs.cpp index 8a40d4b4..1167576b 100644 --- a/src/Components/Modules/ModelSurfs.cpp +++ b/src/Components/Modules/ModelSurfs.cpp @@ -132,7 +132,7 @@ namespace Components std::memcpy(&tempSurfaces[i], source, 12); std::memcpy(&tempSurfaces[i].indexBuffer, source + 16, 20); std::memcpy(&tempSurfaces[i].numCT, source + 40, 8); - std::memcpy(&tempSurfaces[i].something, source + 52, 24); + std::memcpy(&tempSurfaces[i].partBits, source + 52, 24); tempSurfaces[i].streamHandle = 0xFF; // Fake handle for buffer interception } @@ -164,7 +164,7 @@ namespace Components surfs->numSurfaces = newSurfs->numSurfaces; model->lods[i].surfs = newSurfs->surfaces; - std::memcpy(&model->lods[i].partBits, newSurfs->pad, 24); + std::memcpy(&model->lods[i].partBits, newSurfs->partBits, 24); short numSurfs = static_cast(newSurfs->numSurfaces); model->lods[i].numSurfs = numSurfs; diff --git a/src/Components/Modules/Zones.cpp b/src/Components/Modules/Zones.cpp index 9bfc5254..34493123 100644 --- a/src/Components/Modules/Zones.cpp +++ b/src/Components/Modules/Zones.cpp @@ -167,7 +167,7 @@ namespace Components std::memcpy(&tempSurfaces[i], source, 12); std::memcpy(&tempSurfaces[i].indexBuffer, source + 16, 20); std::memcpy(&tempSurfaces[i].numCT, source + 40, 8); - std::memcpy(&tempSurfaces[i].something, source + 52, 24); + std::memcpy(&tempSurfaces[i].partBits, source + 52, 24); if (Zones::ZoneVersion >= 332) { diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 182878a5..ee93af09 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -1472,8 +1472,8 @@ namespace Game unsigned short numVertices; // +2 unsigned short numPrimitives; // +4 unsigned char streamHandle; // something to do with buffers, +6 - char pad2; // +7 - int pad3; // +8 + unsigned __int16 baseTriIndex; + unsigned __int16 baseVertIndex; Face* indexBuffer; // +12 short blendNum1; // +16 short blendNum2; // +18 @@ -1483,10 +1483,8 @@ namespace Game GfxPackedVertex* vertexBuffer; // +28 int numCT; // +32 XRigidVertList* ct; // +36 - short something; - unsigned short flags; - int something2; - char pad5[16]; // +40 + int partBits[4]; + char pad5[8]; // +40 // pad5 matches XModelSurfaces pad // total size, 64 }; @@ -1496,7 +1494,8 @@ namespace Game const char* name; XSurface* surfaces; int numSurfaces; - char pad[24]; + int partBits[4]; + char pad[8]; }; struct XModelLodInfo