Skip to content

Commit

Permalink
chore: unhide the strip offset from the start of the strip group
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Dec 4, 2023
1 parent 5b6f40d commit a7e1dff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/studiomodelpp/structs/VTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ struct Strip {
};

//int indicesCount;
//int indicesOffset;
int indicesOffset = 0; // Offset from the start of the strip group indices
std::span<unsigned short> indices;

//int verticesCount;
//int verticesOffset;
int verticesOffset = 0; // Offset from the start of the strip group vertices
std::span<Vertex> vertices;

short boneCount = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/structs/VTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
int indicesOffset = stream.read<int>();
stream.read(strip.indicesOffset);
// todo: check if offset is in bytes
strip.indices = std::span<unsigned short>(stripGroup.indices.begin() + indicesOffset, indicesCount);
strip.indices = std::span<unsigned short>(stripGroup.indices.begin() + strip.indicesOffset, indicesCount);

int verticesCount = stream.read<int>();
int verticesOffset = stream.read<int>();
stream.read(strip.verticesOffset);
// todo: check if offset is in bytes
strip.vertices = std::span<Vertex>(stripGroup.vertices.begin() + verticesOffset, verticesCount);
strip.vertices = std::span<Vertex>(stripGroup.vertices.begin() + strip.verticesOffset, verticesCount);

stream.read(strip.boneCount);
stream.read(strip.flags);
Expand Down

0 comments on commit a7e1dff

Please sign in to comment.