Skip to content

Commit 8805ab3

Browse files
committed
Update rmodels.c
1 parent ebec978 commit 8805ab3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/rmodels.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
23202320
Matrix currentPoseMatrix = { 0 };
23212321

23222322
// Update all bones and bone matrices of model
2323-
for (int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++)
2323+
for (unsigned int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++)
23242324
{
23252325
// Compute interpolated pose between current and next frame
23262326
// NOTE: Storing animation frame data in model.currentPose
@@ -2390,7 +2390,7 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod
23902390
Matrix bindPoseMatrix = { 0 };
23912391
Matrix currentPoseMatrix = { 0 };
23922392

2393-
for (int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++)
2393+
for (unsigned int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++)
23942394
{
23952395
// Get frame-interpolation for first animation
23962396
Vector3 frameATranslation = Vector3Lerp(
@@ -5013,7 +5013,7 @@ static Model LoadIQM(const char *fileName)
50135013
// Initialize runtime animation data: current pose and bone matrices
50145014
model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform));
50155015
model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix));
5016-
for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
5016+
for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
50175017

50185018
UnloadFileData(fileData);
50195019

@@ -5241,7 +5241,7 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, int *animCou
52415241
// Build frameposes
52425242
for (unsigned int frame = 0; frame < anim[a].num_frames; frame++)
52435243
{
5244-
for (int i = 0; i < animations[a].boneCount; i++)
5244+
for (unsigned int i = 0; i < animations[a].boneCount; i++)
52455245
{
52465246
if (bones[i].parent >= 0)
52475247
{
@@ -5371,7 +5371,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
53715371
// Load bone info from GLTF skin data
53725372
static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, unsigned int *boneCount)
53735373
{
5374-
*boneCount = skin.joints_count;
5374+
*boneCount = (unsigned int)skin.joints_count;
53755375
BoneInfo *bones = (BoneInfo *)RL_CALLOC(skin.joints_count, sizeof(BoneInfo));
53765376

53775377
for (unsigned int i = 0; i < skin.joints_count; i++)
@@ -6144,7 +6144,7 @@ static Model LoadGLTF(const char *fileName)
61446144
model.skeleton.bones = LoadBoneInfoGLTF(skin, &model.skeleton.boneCount);
61456145
model.skeleton.bindPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform));
61466146

6147-
for (int i = 0; i < model.skeleton.boneCount; i++)
6147+
for (unsigned int i = 0; i < model.skeleton.boneCount; i++)
61486148
{
61496149
Matrix bindMatrix = { 0 };
61506150
cgltf_float inverseBindTransform[16] = { 0 };
@@ -6309,7 +6309,7 @@ static Model LoadGLTF(const char *fileName)
63096309
if ((data->skins_count > 0) && !hasJoints && (node->parent != NULL) && (node->parent->mesh == NULL))
63106310
{
63116311
int parentBoneId = -1;
6312-
for (int joint = 0; joint < model.skeleton.boneCount; joint++)
6312+
for (unsigned int joint = 0; joint < model.skeleton.boneCount; joint++)
63136313
{
63146314
if (data->skins[0].joints[joint] == node->parent)
63156315
{
@@ -6347,7 +6347,7 @@ static Model LoadGLTF(const char *fileName)
63476347
// Initialize runtime animation data: current pose and bone matrices
63486348
model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform));
63496349
model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix));
6350-
for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
6350+
for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
63516351
//----------------------------------------------------------------------------------------------------
63526352

63536353
// Free unused allocated memory in case of no bones defined
@@ -6670,7 +6670,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo
66706670
animations[a].keyframePoses[j] = (Transform *)RL_CALLOC(animations[a].boneCount, sizeof(Transform));
66716671
float time = (float)j / GLTF_FRAMERATE;
66726672

6673-
for (int k = 0; k < animations[a].boneCount; k++)
6673+
for (unsigned int k = 0; k < animations[a].boneCount; k++)
66746674
{
66756675
Vector3 translation = {skin.joints[k]->translation[0], skin.joints[k]->translation[1], skin.joints[k]->translation[2]};
66766676
Quaternion rotation = {skin.joints[k]->rotation[0], skin.joints[k]->rotation[1], skin.joints[k]->rotation[2], skin.joints[k]->rotation[3]};
@@ -7204,7 +7204,7 @@ static Model LoadM3D(const char *fileName)
72047204
// Initialize runtime animation data: current pose and bone matrices
72057205
model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform));
72067206
model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix));
7207-
for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
7207+
for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity();
72087208
}
72097209

72107210
m3d_free(m3d);

0 commit comments

Comments
 (0)