From 12450c9657ed677c33c686563b90cda01a79be40 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 12 Aug 2015 19:33:56 -0300 Subject: [PATCH] Don't error if a compressed texture with no mipmap information is passed into love.graphics.newImage and the mipmaps flag is true. --- src/modules/graphics/opengl/Image.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index c5006a66f..52079f5ad 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -119,7 +119,12 @@ Image::Image(const std::vector &compressedda if (verifyMipmapLevels(compresseddata)) this->flags.mipmaps = true; else if (flags.mipmaps && getMipmapCount(width, height) != compresseddata[0]->getMipmapCount()) - throw love::Exception("Image cannot have mipmaps: compressed image data does not have all required mipmap levels."); + { + if (compresseddata[0]->getMipmapCount() == 1) + this->flags.mipmaps = false; + else + throw love::Exception("Image cannot have mipmaps: compressed image data does not have all required mipmap levels."); + } for (const auto &cd : compresseddata) {