mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Fix Image:getMipmapCount returning greater than 1 when a compressed texture is loaded without mipmaps in its source data but with mipmaps=true set.
This commit is contained in:
@@ -86,13 +86,14 @@ void Image::init(PixelFormat fmt, int w, int h, const Settings &settings)
|
|||||||
width = (int) (pixelWidth / settings.dpiScale + 0.5);
|
width = (int) (pixelWidth / settings.dpiScale + 0.5);
|
||||||
height = (int) (pixelHeight / settings.dpiScale + 0.5);
|
height = (int) (pixelHeight / settings.dpiScale + 0.5);
|
||||||
|
|
||||||
mipmapCount = mipmapsType == MIPMAPS_NONE ? 1 : getMipmapCount(w, h);
|
|
||||||
format = fmt;
|
format = fmt;
|
||||||
|
|
||||||
if (isCompressed() && mipmapsType == MIPMAPS_GENERATED)
|
if (isCompressed() && mipmapsType == MIPMAPS_GENERATED)
|
||||||
mipmapsType = MIPMAPS_NONE;
|
mipmapsType = MIPMAPS_NONE;
|
||||||
|
|
||||||
if (getMipmapCount() > 1)
|
mipmapCount = mipmapsType == MIPMAPS_NONE ? 1 : getMipmapCount(w, h);
|
||||||
|
|
||||||
|
if (mipmapCount > 1)
|
||||||
filter.mipmap = defaultMipmapFilter;
|
filter.mipmap = defaultMipmapFilter;
|
||||||
|
|
||||||
initQuad();
|
initQuad();
|
||||||
|
|||||||
Reference in New Issue
Block a user