Explorar el Código

texturec: Added PNG error text on failure.

Branimir Karadžić hace 8 años
padre
commit
7cc14e99a1
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/image_decode.cpp

+ 5 - 2
src/image_decode.cpp

@@ -28,7 +28,6 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4127) // warning C4127: conditional expression
 #define LODEPNG_NO_COMPILE_ENCODER
 #define LODEPNG_NO_COMPILE_DISK
 #define LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS
-#define LODEPNG_NO_COMPILE_ERROR_TEXT
 #define LODEPNG_NO_COMPILE_ALLOCATORS
 #define LODEPNG_NO_COMPILE_CPP
 #include <lodepng/lodepng.cpp>
@@ -93,7 +92,11 @@ namespace bimg
 		uint8_t* data = NULL;
 		error = lodepng_decode(&data, &width, &height, &state, (uint8_t*)_data, _size);
 
-		if (0 == error)
+		if (0 != error)
+		{
+			_err->setError(BIMG_ERROR, lodepng_error_text(error) );
+		}
+		else
 		{
 			bool palette   = false;
 			bool supported = false;