Improved the error message when an unsupported file format is used with love.image.newImageData or love.graphics.newImage.

This commit is contained in:
Alex Szpakowski
2015-10-19 15:54:53 -03:00
parent 890802c0a3
commit 5fabd64aea
+2 -2
View File
@@ -117,8 +117,8 @@ void ImageData::decode(love::filesystem::FileData *data)
if (decodedimage.data == nullptr)
{
const char *ext = data->getExtension().c_str();
throw love::Exception("Could not decode to ImageData: unrecognized format (%s)", ext);
const std::string &name = data->getFilename();
throw love::Exception("Could not decode file '%s' to ImageData: unsupported file format", name.c_str());
}
// The decoder *must* output a 32 bits-per-pixel image.