chore: make XModelCommon use offset instead of pointer

This commit is contained in:
Jan
2024-07-28 20:46:06 +02:00
parent d45f0ffab7
commit f8b5734f86
8 changed files with 41 additions and 36 deletions

View File

@ -18,12 +18,16 @@ protected:
auto vertexOffset = 0u;
for (const auto& vertex : xmodel.m_vertices)
{
XModelVertexBoneWeights weights{nullptr, 0};
XModelVertexBoneWeights weights{0, 0};
if (vertexOffset < xmodel.m_vertex_bone_weights.size())
weights = xmodel.m_vertex_bone_weights[vertexOffset];
m_vertex_merger.Add(VertexMergerPos{vertex.coordinates[0], vertex.coordinates[1], vertex.coordinates[2], weights.weights, weights.weightCount});
m_vertex_merger.Add(VertexMergerPos{vertex.coordinates[0],
vertex.coordinates[1],
vertex.coordinates[2],
&xmodel.m_bone_weight_data.weights[weights.weightOffset],
weights.weightCount});
vertexOffset++;
}