diff options
| author | Ray <[email protected]> | 2021-09-22 12:19:25 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-09-22 12:19:25 +0200 |
| commit | de173a93c86fbda92b7d93a5fc202e80d4a16f24 (patch) | |
| tree | 7eb2577a158723dcf510afcab567f377ae8a5611 /src | |
| parent | 37c047eabcb7a13b159ef0a995897cc46947ad17 (diff) | |
| download | raylib-de173a93c86fbda92b7d93a5fc202e80d4a16f24.tar.gz raylib-de173a93c86fbda92b7d93a5fc202e80d4a16f24.zip | |
Update rmodels.c
Diffstat (limited to 'src')
| -rw-r--r-- | src/rmodels.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/rmodels.c b/src/rmodels.c index c97a2004..a4c0e9e5 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); } |
