Skip to content

Commit

Permalink
fix: forgot to parse those fields
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Dec 4, 2023
1 parent 2584e37 commit 90d8b1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/studiomodelpp/structs/MDL.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ struct Mesh {
//int flexesCount;
//int flexesOffset;

//int materialType;
//int materialParam;
int materialType;
int materialParam;

//int meshID;
int meshID;

Vector3 center;

Expand Down
8 changes: 7 additions & 1 deletion src/structs/MDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ bool MDL::open(const std::byte* data, std::size_t size) {
auto& mesh = model.meshes.emplace_back();

stream.read(mesh.material);
stream.skip<int, 8>();
stream.skip<int>();
stream.read(mesh.verticesCount);
stream.read(mesh.verticesOffset);
stream.skip<int, 2>();
stream.read(mesh.materialType);
stream.read(mesh.materialParam);
stream.read(mesh.meshID);
stream.read(mesh.center);
}
}
Expand Down

0 comments on commit 90d8b1a

Please sign in to comment.