mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 08:28:30 +00:00
[rtexture] Cubemap mipmap loading improvements (#4721)
* [rtextures] Only build cubemap mipmaps when necessary * [rtextures] Assign correct mipmap count to cubemaps
This commit is contained in:
@@ -4208,8 +4208,11 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
|
|||||||
|
|
||||||
Image mipmapped = ImageCopy(image);
|
Image mipmapped = ImageCopy(image);
|
||||||
#if defined(SUPPORT_IMAGE_MANIPULATION)
|
#if defined(SUPPORT_IMAGE_MANIPULATION)
|
||||||
ImageMipmaps(&mipmapped);
|
if (image.mipmaps > 1)
|
||||||
ImageMipmaps(&faces);
|
{
|
||||||
|
ImageMipmaps(&mipmapped);
|
||||||
|
ImageMipmaps(&faces);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE: Image formatting does not work with compressed textures
|
// NOTE: Image formatting does not work with compressed textures
|
||||||
@@ -4226,7 +4229,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
|
|||||||
if (cubemap.id != 0)
|
if (cubemap.id != 0)
|
||||||
{
|
{
|
||||||
cubemap.format = faces.format;
|
cubemap.format = faces.format;
|
||||||
cubemap.mipmaps = 1;
|
cubemap.mipmaps = faces.mipmaps;
|
||||||
}
|
}
|
||||||
else TRACELOG(LOG_WARNING, "IMAGE: Failed to load cubemap image");
|
else TRACELOG(LOG_WARNING, "IMAGE: Failed to load cubemap image");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user