Browse Source

Improved the error message when love.graphics.newImage fails due to CompressedImageData not having all required mipmap levels (thanks Shell32!)

Alex Szpakowski 9 years ago
parent
commit
7370bd56ce
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/modules/graphics/opengl/Image.cpp

+ 5 - 1
src/modules/graphics/opengl/Image.cpp

@@ -133,7 +133,11 @@ Image::Image(const std::vector<love::image::CompressedImageData *> &compressedda
 		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.");
+		{
+			throw love::Exception("Image cannot have mipmaps: compressed image data does not have all required mipmap levels (expected %d, got %d)",
+			                      getMipmapCount(width, height),
+			                      compresseddata[0]->getMipmapCount());
+		}
 	}
 
 	for (const auto &cd : compresseddata)