mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
move first mesh bones calculation under check for its presense
This commit is contained in:
@@ -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.
|
// Update all bones and boneMatrices of first mesh with bones.
|
||||||
for (int boneId = 0; boneId < anim.boneCount; boneId++)
|
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
|
// Update remaining meshes with bones
|
||||||
// NOTE: Using deep copy because shallow copy results in double free with 'UnloadModel()'
|
// 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++)
|
for (int i = firstMeshWithBones + 1; i < model.meshCount; i++)
|
||||||
{
|
{
|
||||||
if (model.meshes[i].boneMatrices)
|
if (model.meshes[i].boneMatrices)
|
||||||
|
Reference in New Issue
Block a user