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

This commit is contained in:
Alex Szpakowski
2016-03-03 20:36:30 -04:00
parent a3ff90c94c
commit 7370bd56ce
+5 -1
View File
@@ -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)