Improved the performance of dds data loading (love.image.newCompressedData / love.graphics.newImage("myfile.dds"))

This commit is contained in:
Alex Szpakowski
2013-06-14 08:43:07 -03:00
parent be33d17f89
commit 03f5bd9a5a
5 changed files with 30 additions and 4 deletions
+7 -1
View File
@@ -54,6 +54,11 @@ void DevilHandler::init()
void DevilHandler::quit()
{
ilShutDown();
if (devilMutex)
{
delete devilMutex;
devilMutex = 0;
}
}
bool DevilHandler::canDecode(love::filesystem::FileData * /*data*/)
@@ -210,9 +215,10 @@ DevilHandler::EncodedImage DevilHandler::encode(const DecodedImage &img, ImageDa
}
catch (std::exception &e)
{
// catches love and std exceptions
// Catches love and std exceptions.
ilDeleteImage(tempimage);
delete[] encodedimage.data;
encodedimage.data = 0;
throw love::Exception("%s", e.what());
}