From 7cc14e99a1fca2400399a288cfa7dcc21adabee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 8 Nov 2017 18:58:38 -0800 Subject: [PATCH] texturec: Added PNG error text on failure. --- src/image_decode.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/image_decode.cpp b/src/image_decode.cpp index 1e97282..37038f3 100644 --- a/src/image_decode.cpp +++ b/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 @@ -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;