mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-20 10:18:14 +00:00
Update rmodels.c
This commit is contained in:
@@ -4382,16 +4382,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co
|
|||||||
int size = 0;
|
int size = 0;
|
||||||
unsigned char *data = DecodeBase64(image->uri + i + 1, &size);
|
unsigned char *data = DecodeBase64(image->uri + i + 1, &size);
|
||||||
|
|
||||||
int width, height;
|
rimage = LoadImageFromMemory(".png", data, size);
|
||||||
unsigned char *raw = LoadImageFromMemory(".png", data, size, &width, &height, NULL, 4);
|
|
||||||
RL_FREE(data);
|
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!
|
// TODO: Tint shouldn't be applied here!
|
||||||
ImageColorTint(&rimage, tint);
|
ImageColorTint(&rimage, tint);
|
||||||
}
|
}
|
||||||
@@ -4416,16 +4409,9 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co
|
|||||||
n += stride;
|
n += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
int width, height;
|
rimage = LoadImageFromMemory(".png", data, size);
|
||||||
unsigned char *raw = LoadImageFromMemory(".png", data, (int)image->buffer_view->size, &width, &height, NULL, 4);
|
|
||||||
RL_FREE(data);
|
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!
|
// TODO: Tint shouldn't be applied here!
|
||||||
ImageColorTint(&rimage, tint);
|
ImageColorTint(&rimage, tint);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user