Review code formatting

This commit is contained in:
raysan5 2021-03-31 17:55:46 +02:00
parent 3d1a05d588
commit 8f1d81df0f
4 changed files with 101 additions and 106 deletions

View file

@ -4961,8 +4961,7 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
CORE.Window.currentFbo.height = height; CORE.Window.currentFbo.height = height;
CORE.Window.resizedLastFrame = true; CORE.Window.resizedLastFrame = true;
if(IsWindowFullscreen()) if (IsWindowFullscreen()) return;
return;
// Set current screen size // Set current screen size
CORE.Window.screen.width = width; CORE.Window.screen.width = width;

View file

@ -4025,10 +4025,7 @@ static bool GLTFReadValue(cgltf_accessor* acc, unsigned int index, void* variabl
{ {
if (acc->count == 2) if (acc->count == 2)
{ {
if (index > 1) if (index > 1) return false;
{
return false;
}
memcpy(variable, index == 0 ? acc->min : acc->max, elements*size); memcpy(variable, index == 0 ? acc->min : acc->max, elements*size);
return true; return true;
@ -4037,8 +4034,7 @@ static bool GLTFReadValue(cgltf_accessor* acc, unsigned int index, void* variabl
unsigned int stride = size*elements; unsigned int stride = size*elements;
memset(variable, 0, stride); memset(variable, 0, stride);
if(acc->buffer_view == NULL || acc->buffer_view->buffer == NULL || acc->buffer_view->buffer->data == NULL) if (acc->buffer_view == NULL || acc->buffer_view->buffer == NULL || acc->buffer_view->buffer->data == NULL) return false;
return false;
void* readPosition = ((char *)acc->buffer_view->buffer->data) + (index*stride) + acc->buffer_view->offset + acc->offset; void* readPosition = ((char *)acc->buffer_view->buffer->data) + (index*stride) + acc->buffer_view->offset + acc->offset;
memcpy(variable, readPosition, stride); memcpy(variable, readPosition, stride);
@ -4631,7 +4627,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
ModelAnimation *output = animations + a; ModelAnimation *output = animations + a;
// 30 frames sampled per second // 30 frames sampled per second
const float TIMESTEP = (1.0f / 30.0f); const float timeStep = (1.0f/30.0f);
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
@ -4647,7 +4643,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
} }
} }
output->frameCount = (int)(animationDuration / TIMESTEP); output->frameCount = (int)(animationDuration / timeStep);
output->boneCount = (int)data->nodes_count; output->boneCount = (int)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 *));
@ -4688,7 +4684,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
bool shouldSkipFurtherTransformation = true; bool shouldSkipFurtherTransformation = true;
int outputMin = 0; int outputMin = 0;
int outputMax = 0; int outputMax = 0;
float frameTime = frame * TIMESTEP; float frameTime = frame*timeStep;
float lerpPercent = 0.0f; float lerpPercent = 0.0f;
// For this transformation: // For this transformation: