Skip to content

Commit cceabf6

Browse files
committed
Formatting review
1 parent cfe9693 commit cceabf6

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/rmodels.c

+13-9
Original file line numberDiff line numberDiff line change
@@ -3879,10 +3879,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector
38793879
}
38803880

38813881
Vector2 texcoords[4];
3882-
texcoords[0] = (Vector2) { (float)source.x/texture.width, (float)(source.y + source.height)/texture.height };
3883-
texcoords[1] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height };
3884-
texcoords[2] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)source.y/texture.height };
3885-
texcoords[3] = (Vector2) { (float)source.x/texture.width, (float)source.y/texture.height };
3882+
texcoords[0] = (Vector2){ (float)source.x/texture.width, (float)(source.y + source.height)/texture.height };
3883+
texcoords[1] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height };
3884+
texcoords[2] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)source.y/texture.height };
3885+
texcoords[3] = (Vector2){ (float)source.x/texture.width, (float)source.y/texture.height };
38863886

38873887
rlSetTexture(texture.id);
38883888
rlBegin(RL_QUADS);
@@ -5141,7 +5141,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
51415141
image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri));
51425142
}
51435143
}
5144-
else if (cgltfImage->buffer_view != NULL && cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer
5144+
else if ((cgltfImage->buffer_view != NULL) && (cgltfImage->buffer_view->buffer->data != NULL)) // Check if image is provided as data buffer
51455145
{
51465146
unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size);
51475147
int offset = (int)cgltfImage->buffer_view->offset;
@@ -5156,10 +5156,14 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
51565156

51575157
// Check mime_type for image: (cgltfImage->mime_type == "image/png")
51585158
// NOTE: Detected that some models define mime_type as "image\\/png"
5159-
if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) ||
5160-
(strcmp(cgltfImage->mime_type, "image/png") == 0)) image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size);
5161-
else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) ||
5162-
(strcmp(cgltfImage->mime_type, "image/jpeg") == 0)) image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size);
5159+
if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) || (strcmp(cgltfImage->mime_type, "image/png") == 0))
5160+
{
5161+
image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size);
5162+
}
5163+
else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) || (strcmp(cgltfImage->mime_type, "image/jpeg") == 0))
5164+
{
5165+
image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size);
5166+
}
51635167
else TRACELOG(LOG_WARNING, "MODEL: glTF image data MIME type not recognized", TextFormat("%s/%s", texPath, cgltfImage->uri));
51645168

51655169
RL_FREE(data);

0 commit comments

Comments
 (0)