move first mesh bones calculation under check for its presense
This commit is contained in:
parent
b4f1ff9a00
commit
42a40b3920
1 changed files with 20 additions and 20 deletions
|
@ -2286,6 +2286,8 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame)
|
|||
}
|
||||
}
|
||||
|
||||
if (firstMeshWithBones != -1)
|
||||
{
|
||||
// Update all bones and boneMatrices of first mesh with bones.
|
||||
for (int boneId = 0; boneId < anim.boneCount; boneId++)
|
||||
{
|
||||
|
@ -2306,8 +2308,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame)
|
|||
|
||||
// Update remaining meshes with bones
|
||||
// NOTE: Using deep copy because shallow copy results in double free with 'UnloadModel()'
|
||||
if (firstMeshWithBones != -1)
|
||||
{
|
||||
for (int i = firstMeshWithBones + 1; i < model.meshCount; i++)
|
||||
{
|
||||
if (model.meshes[i].boneMatrices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue