From ae3c0df2060ac0df13e4e95ece5b3fc9be464d6f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 24 Dec 2024 20:14:54 +0100 Subject: [PATCH] Reviewed formating, removed assert() #4635 --- src/rmodels.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 3fcd5cea7..0455ced27 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2277,7 +2277,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { if (model.meshes[i].boneMatrices) { - assert(model.meshes[i].boneCount == anim.boneCount); if (firstMeshWithBones == -1) { firstMeshWithBones = i; @@ -2286,7 +2285,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } - // Update all bones and boneMatrices of first mesh with bones. for (int boneId = 0; boneId < anim.boneCount; boneId++) { @@ -2351,7 +2349,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) bool updated = false; // Flag to check when anim vertex information is updated const int vValues = mesh.vertexCount*3; - if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models + // Skip if missing bone data, causes segfault without on some models + if ((mesh.boneWeights == NULL) || (mesh.boneIds == NULL)) continue; for (int vCounter = 0; vCounter < vValues; vCounter += 3) { @@ -2364,7 +2363,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) mesh.animNormals[vCounter + 1] = 0; mesh.animNormals[vCounter + 2] = 0; } - // Iterates over 4 bones per vertex + + // Iterates over 4 bones per vertex for (int j = 0; j < 4; j++, boneCounter++) { boneWeight = mesh.boneWeights[boneCounter]; @@ -2395,8 +2395,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) if (updated) { rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position - if (mesh.normals != NULL) - rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals + if (mesh.normals != NULL) rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals } } }