mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-18 17:28:15 +00:00
Review some warnings and formatting
This commit is contained in:
16
src/models.c
16
src/models.c
@@ -3904,11 +3904,11 @@ static Model LoadGLTF(const char *fileName)
|
|||||||
short* bones = RL_MALLOC(sizeof(short) * acc->count * 4);
|
short* bones = RL_MALLOC(sizeof(short) * acc->count * 4);
|
||||||
|
|
||||||
LOAD_ACCESSOR(short, 4, acc, bones);
|
LOAD_ACCESSOR(short, 4, acc, bones);
|
||||||
for(int a = 0; a < acc->count * 4; a ++)
|
for (unsigned int a = 0; a < acc->count * 4; a ++)
|
||||||
{
|
{
|
||||||
cgltf_node* skinJoint = data->skins->joints[bones[a]];
|
cgltf_node* skinJoint = data->skins->joints[bones[a]];
|
||||||
|
|
||||||
for(int k = 0; k < data->nodes_count; k++)
|
for (unsigned int k = 0; k < data->nodes_count; k++)
|
||||||
{
|
{
|
||||||
if (&(data->nodes[k]) == skinJoint)
|
if (&(data->nodes[k]) == skinJoint)
|
||||||
{
|
{
|
||||||
@@ -4058,7 +4058,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
float animationDuration = 0.0f;
|
float animationDuration = 0.0f;
|
||||||
|
|
||||||
// Getting the max animation time to consider for animation duration
|
// Getting the max animation time to consider for animation duration
|
||||||
for (int i = 0; i < animation->channels_count; i++)
|
for (unsigned int i = 0; i < animation->channels_count; i++)
|
||||||
{
|
{
|
||||||
cgltf_animation_channel* channel = animation->channels + i;
|
cgltf_animation_channel* channel = animation->channels + i;
|
||||||
int frameCounts = channel->sampler->input->count;
|
int frameCounts = channel->sampler->input->count;
|
||||||
@@ -4069,7 +4069,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output->frameCount = animationDuration / TIMESTEP;
|
output->frameCount = (int)(animationDuration / TIMESTEP);
|
||||||
output->boneCount = data->nodes_count;
|
output->boneCount = data->nodes_count;
|
||||||
output->bones = RL_MALLOC(output->boneCount*sizeof(BoneInfo));
|
output->bones = RL_MALLOC(output->boneCount*sizeof(BoneInfo));
|
||||||
output->framePoses = RL_MALLOC(output->frameCount*sizeof(Transform *));
|
output->framePoses = RL_MALLOC(output->frameCount*sizeof(Transform *));
|
||||||
@@ -4084,7 +4084,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
|
|
||||||
// Allocate data for frames
|
// Allocate data for frames
|
||||||
// Initiate with zero bone translations
|
// Initiate with zero bone translations
|
||||||
for (unsigned int frame = 0; frame < output->frameCount; frame++)
|
for (int frame = 0; frame < output->frameCount; frame++)
|
||||||
{
|
{
|
||||||
output->framePoses[frame] = RL_MALLOC(output->frameCount*data->nodes_count*sizeof(Transform));
|
output->framePoses[frame] = RL_MALLOC(output->frameCount*data->nodes_count*sizeof(Transform));
|
||||||
|
|
||||||
@@ -4098,7 +4098,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for each single transformation type on single bone
|
// for each single transformation type on single bone
|
||||||
for(int channelId = 0; channelId < animation->channels_count; channelId++)
|
for (unsigned int channelId = 0; channelId < animation->channels_count; channelId++)
|
||||||
{
|
{
|
||||||
cgltf_animation_channel* channel = animation->channels + channelId;
|
cgltf_animation_channel* channel = animation->channels + channelId;
|
||||||
cgltf_animation_sampler* sampler = channel->sampler;
|
cgltf_animation_sampler* sampler = channel->sampler;
|
||||||
@@ -4116,7 +4116,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
// For this transformation:
|
// For this transformation:
|
||||||
// getting between which input values the current frame time position
|
// getting between which input values the current frame time position
|
||||||
// and also what is the percent to use in the linear interpolation later
|
// and also what is the percent to use in the linear interpolation later
|
||||||
for(int j = 0; j < sampler->input->count; j++)
|
for (unsigned int j = 0; j < sampler->input->count; j++)
|
||||||
{
|
{
|
||||||
float inputFrameTime;
|
float inputFrameTime;
|
||||||
if (GltfReadFloat(sampler->input, j, (float*)&inputFrameTime, 1))
|
if (GltfReadFloat(sampler->input, j, (float*)&inputFrameTime, 1))
|
||||||
@@ -4186,7 +4186,7 @@ static ModelAnimation* LoadGLTFModelAnimations(const char *fileName, int *animCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build frameposes
|
// Build frameposes
|
||||||
for (unsigned int frame = 0; frame < output->frameCount; frame++)
|
for (int frame = 0; frame < output->frameCount; frame++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < output->boneCount; i++)
|
for (int i = 0; i < output->boneCount; i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user