mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-07 11:58:13 +00:00
qoi: Added support for image of channels 3 (#4384)
This commit is contained in:
@@ -506,10 +506,10 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i
|
|||||||
if (fileData != NULL)
|
if (fileData != NULL)
|
||||||
{
|
{
|
||||||
qoi_desc desc = { 0 };
|
qoi_desc desc = { 0 };
|
||||||
image.data = qoi_decode(fileData, dataSize, &desc, 4);
|
image.data = qoi_decode(fileData, dataSize, &desc, (int) fileData[12]);
|
||||||
image.width = desc.width;
|
image.width = desc.width;
|
||||||
image.height = desc.height;
|
image.height = desc.height;
|
||||||
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
|
image.format = desc.channels == 4 ? PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 : PIXELFORMAT_UNCOMPRESSED_R8G8B8;
|
||||||
image.mipmaps = 1;
|
image.mipmaps = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user