Formatting review
This commit is contained in:
parent
cfe96931f5
commit
cceabf6961
1 changed files with 13 additions and 9 deletions
|
@ -3879,10 +3879,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 texcoords[4];
|
Vector2 texcoords[4];
|
||||||
texcoords[0] = (Vector2) { (float)source.x/texture.width, (float)(source.y + source.height)/texture.height };
|
texcoords[0] = (Vector2){ (float)source.x/texture.width, (float)(source.y + source.height)/texture.height };
|
||||||
texcoords[1] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height };
|
texcoords[1] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height };
|
||||||
texcoords[2] = (Vector2) { (float)(source.x + source.width)/texture.width, (float)source.y/texture.height };
|
texcoords[2] = (Vector2){ (float)(source.x + source.width)/texture.width, (float)source.y/texture.height };
|
||||||
texcoords[3] = (Vector2) { (float)source.x/texture.width, (float)source.y/texture.height };
|
texcoords[3] = (Vector2){ (float)source.x/texture.width, (float)source.y/texture.height };
|
||||||
|
|
||||||
rlSetTexture(texture.id);
|
rlSetTexture(texture.id);
|
||||||
rlBegin(RL_QUADS);
|
rlBegin(RL_QUADS);
|
||||||
|
@ -5141,7 +5141,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
|
||||||
image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri));
|
image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cgltfImage->buffer_view != NULL && cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer
|
else if ((cgltfImage->buffer_view != NULL) && (cgltfImage->buffer_view->buffer->data != NULL)) // Check if image is provided as data buffer
|
||||||
{
|
{
|
||||||
unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size);
|
unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size);
|
||||||
int offset = (int)cgltfImage->buffer_view->offset;
|
int offset = (int)cgltfImage->buffer_view->offset;
|
||||||
|
@ -5156,10 +5156,14 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
|
||||||
|
|
||||||
// Check mime_type for image: (cgltfImage->mime_type == "image/png")
|
// Check mime_type for image: (cgltfImage->mime_type == "image/png")
|
||||||
// NOTE: Detected that some models define mime_type as "image\\/png"
|
// NOTE: Detected that some models define mime_type as "image\\/png"
|
||||||
if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) ||
|
if ((strcmp(cgltfImage->mime_type, "image\\/png") == 0) || (strcmp(cgltfImage->mime_type, "image/png") == 0))
|
||||||
(strcmp(cgltfImage->mime_type, "image/png") == 0)) image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size);
|
{
|
||||||
else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) ||
|
image = LoadImageFromMemory(".png", data, (int)cgltfImage->buffer_view->size);
|
||||||
(strcmp(cgltfImage->mime_type, "image/jpeg") == 0)) image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size);
|
}
|
||||||
|
else if ((strcmp(cgltfImage->mime_type, "image\\/jpeg") == 0) || (strcmp(cgltfImage->mime_type, "image/jpeg") == 0))
|
||||||
|
{
|
||||||
|
image = LoadImageFromMemory(".jpg", data, (int)cgltfImage->buffer_view->size);
|
||||||
|
}
|
||||||
else TRACELOG(LOG_WARNING, "MODEL: glTF image data MIME type not recognized", TextFormat("%s/%s", texPath, cgltfImage->uri));
|
else TRACELOG(LOG_WARNING, "MODEL: glTF image data MIME type not recognized", TextFormat("%s/%s", texPath, cgltfImage->uri));
|
||||||
|
|
||||||
RL_FREE(data);
|
RL_FREE(data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue