From de173a93c86fbda92b7d93a5fc202e80d4a16f24 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 22 Sep 2021 12:19:25 +0200 Subject: [PATCH] Update rmodels.c --- src/rmodels.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index c97a20047..a4c0e9e56 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4382,16 +4382,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co int size = 0; unsigned char *data = DecodeBase64(image->uri + i + 1, &size); - int width, height; - unsigned char *raw = LoadImageFromMemory(".png", data, size, &width, &height, NULL, 4); + rimage = LoadImageFromMemory(".png", data, size); RL_FREE(data); - rimage.data = raw; - rimage.width = width; - rimage.height = height; - rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; - rimage.mipmaps = 1; - // TODO: Tint shouldn't be applied here! ImageColorTint(&rimage, tint); } @@ -4416,16 +4409,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co n += stride; } - int width, height; - unsigned char *raw = LoadImageFromMemory(".png", data, (int)image->buffer_view->size, &width, &height, NULL, 4); + rimage = LoadImageFromMemory(".png", data, size); RL_FREE(data); - rimage.data = raw; - rimage.width = width; - rimage.height = height; - rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; - rimage.mipmaps = 1; - // TODO: Tint shouldn't be applied here! ImageColorTint(&rimage, tint); }