Skip to content

Commit

Permalink
fix: expose more mdl fields
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Dec 4, 2023
1 parent 8107af2 commit cb2f081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/studiomodelpp/structs/MDL.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct Model {
// These do not map to raw memory
int verticesCount;
int verticesOffset;
int tangentsOffset;
//int tangentsOffset;

//int attachmentsCount;
//int attachmentsOffset;
Expand Down
3 changes: 3 additions & 0 deletions src/structs/MDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ bool MDL::open(const std::byte* data, std::size_t size) {
int meshesCount = stream.read<int>();
int meshesOffset = stream.read<int>();

stream.read(model.verticesCount);
stream.read(model.verticesOffset);

for (int k = 0; k < meshesCount; k++) {
auto meshPos = meshesOffset + k * (sizeof(int) * (18 + MAX_LOD_COUNT) + sizeof(Vector3));
stream.seek(bodyPartPos + modelPos + meshPos);
Expand Down

0 comments on commit cb2f081

Please sign in to comment.