Browse Source

love.image.isCompressed now compares file extensions in a case-insensitive manner

Alex Szpakowski 12 years ago
parent
commit
01666f6c29
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/modules/image/magpie/ddsHandler.cpp

+ 6 - 1
src/modules/image/magpie/ddsHandler.cpp

@@ -20,6 +20,8 @@
 
 #include "ddsHandler.h"
 
+#include <algorithm>
+
 namespace love
 {
 namespace image
@@ -29,7 +31,10 @@ namespace magpie
 
 bool ddsHandler::canParse(const filesystem::FileData *data)
 {
-	if (data->getExtension().compare("dds") != 0)
+	std::string ext = data->getExtension();
+	std::transform(ext.begin(), ext.end(), ext.begin(), tolower);
+
+	if (ext.compare("dds") != 0)
 		return false;
 
 	return dds::isCompressedDDS(data->getData(), data->getSize());