texturec: Added PNG error text on failure.

This commit is contained in:
Branimir Karadžić
2017-11-08 18:58:38 -08:00
parent 389d53e94d
commit 7cc14e99a1

View File

@@ -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;