summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-03-22 12:45:46 -0700
committerGitHub <[email protected]>2021-03-22 20:45:46 +0100
commitc6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (patch)
tree999a710d7ee4d0392920aceb00bdd12fd43181dc /src/models.c
parent2ce28f75addd22a5b56dc68738e6a72af74f125d (diff)
downloadraylib-c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53.tar.gz
raylib-c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53.zip
typecast warning fixes. (#1667)
Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/models.c b/src/models.c
index 86c5d56d..cecc169e 100644
--- a/src/models.c
+++ b/src/models.c
@@ -1108,7 +1108,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
// Unload animation array data
void UnloadModelAnimations(ModelAnimation* animations, unsigned int count)
{
- for (int i = 0; i < count; i++) UnloadModelAnimation(animations[i]);
+ for (unsigned int i = 0; i < count; i++) UnloadModelAnimation(animations[i]);
RL_FREE(animations);
}
@@ -3773,9 +3773,9 @@ static Model LoadGLTF(const char *fileName)
for(int a = 0; a < acc->count; a++)
{
GLTFReadValue(acc, a, readValue, 3, sizeof(int));
- model.meshes[primitiveIndex].vertices[(a * 3) + 0] = readValue[0];
- model.meshes[primitiveIndex].vertices[(a * 3) + 1] = readValue[1];
- model.meshes[primitiveIndex].vertices[(a * 3) + 2] = readValue[2];
+ model.meshes[primitiveIndex].vertices[(a * 3) + 0] = (float)readValue[0];
+ model.meshes[primitiveIndex].vertices[(a * 3) + 1] = (float)readValue[1];
+ model.meshes[primitiveIndex].vertices[(a * 3) + 2] = (float)readValue[2];
}
}
else
@@ -3807,9 +3807,9 @@ static Model LoadGLTF(const char *fileName)
for(int a = 0; a < acc->count; a++)
{
GLTFReadValue(acc, a, readValue, 3, sizeof(int));
- model.meshes[primitiveIndex].normals[(a * 3) + 0] = readValue[0];
- model.meshes[primitiveIndex].normals[(a * 3) + 1] = readValue[1];
- model.meshes[primitiveIndex].normals[(a * 3) + 2] = readValue[2];
+ model.meshes[primitiveIndex].normals[(a * 3) + 0] = (float)readValue[0];
+ model.meshes[primitiveIndex].normals[(a * 3) + 1] = (float)readValue[1];
+ model.meshes[primitiveIndex].normals[(a * 3) + 2] = (float)readValue[2];
}
}
else
@@ -3863,10 +3863,10 @@ static Model LoadGLTF(const char *fileName)
for(int a = 0; a < acc->count; a++)
{
GLTFReadValue(acc, a, readValue, 4, sizeof(unsigned int));
- model.meshes[primitiveIndex].normals[(a * 4) + 0] = readValue[0];
- model.meshes[primitiveIndex].normals[(a * 4) + 1] = readValue[1];
- model.meshes[primitiveIndex].normals[(a * 4) + 2] = readValue[2];
- model.meshes[primitiveIndex].normals[(a * 4) + 3] = readValue[3];
+ model.meshes[primitiveIndex].normals[(a * 4) + 0] = (float)readValue[0];
+ model.meshes[primitiveIndex].normals[(a * 4) + 1] = (float)readValue[1];
+ model.meshes[primitiveIndex].normals[(a * 4) + 2] = (float)readValue[2];
+ model.meshes[primitiveIndex].normals[(a * 4) + 3] = (float)readValue[3];
}
}
else
@@ -3911,7 +3911,7 @@ static void InitGLTFBones(Model* model, const cgltf_data* data)
for (unsigned int j = 0; j < data->nodes_count; j++)
{
strcpy(model->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name);
- model->bones[j].parent = (data->nodes[j].parent != NULL) ? data->nodes[j].parent - data->nodes : -1;
+ model->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1;
}
for (unsigned int i = 0; i < data->nodes_count; i++)
@@ -4250,7 +4250,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
result = cgltf_load_buffers(&options, data, fileName);
if (result != cgltf_result_success) TRACELOG(LOG_WARNING, "MODEL: [%s] unable to load glTF animations data", fileName);
animations = RL_MALLOC(data->animations_count*sizeof(ModelAnimation));
- *animCount = data->animations_count;
+ *animCount = (int)data->animations_count;
for (unsigned int a = 0; a < data->animations_count; a++)
{