diff --git a/include/studiomodelpp/structs/VTX.h b/include/studiomodelpp/structs/VTX.h index 2dee9f189..f2801a4e3 100644 --- a/include/studiomodelpp/structs/VTX.h +++ b/include/studiomodelpp/structs/VTX.h @@ -25,11 +25,11 @@ struct Strip { }; //int indicesCount; - //int indicesOffset; + int indicesOffset = 0; // Offset from the start of the strip group indices std::span indices; //int verticesCount; - //int verticesOffset; + int verticesOffset = 0; // Offset from the start of the strip group vertices std::span vertices; short boneCount = 0; diff --git a/src/structs/VTX.cpp b/src/structs/VTX.cpp index bd88d5ba0..3938f86c8 100644 --- a/src/structs/VTX.cpp +++ b/src/structs/VTX.cpp @@ -121,14 +121,14 @@ bool VTX::open(const std::byte* data, std::size_t size, const MDL::MDL& mdl) { auto& strip = stripGroup.strips.emplace_back(); int indicesCount = stream.read(); - int indicesOffset = stream.read(); + stream.read(strip.indicesOffset); // todo: check if offset is in bytes - strip.indices = std::span(stripGroup.indices.begin() + indicesOffset, indicesCount); + strip.indices = std::span(stripGroup.indices.begin() + strip.indicesOffset, indicesCount); int verticesCount = stream.read(); - int verticesOffset = stream.read(); + stream.read(strip.verticesOffset); // todo: check if offset is in bytes - strip.vertices = std::span(stripGroup.vertices.begin() + verticesOffset, verticesCount); + strip.vertices = std::span(stripGroup.vertices.begin() + strip.verticesOffset, verticesCount); stream.read(strip.boneCount); stream.read(strip.flags);