diff --git a/source/Irrlicht/CImageWriterBMP.cpp b/source/Irrlicht/CImageWriterBMP.cpp index 84f107e..84fdc7b 100644 --- a/source/Irrlicht/CImageWriterBMP.cpp +++ b/source/Irrlicht/CImageWriterBMP.cpp @@ -10,6 +10,7 @@ #include "IWriteFile.h" #include "CColorConverter.h" #include "irrString.h" +#include "os.h" namespace irr { @@ -80,10 +81,9 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) CColorConverter_convertFORMATtoFORMAT = CColorConverter::convert_R5G6B5toR8G8B8; break; -#ifndef _DEBUG default: + os::Printer::log("CImageWriterBMP does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); break; -#endif } // couldn't find a color converter diff --git a/source/Irrlicht/CImageWriterJPG.cpp b/source/Irrlicht/CImageWriterJPG.cpp index 55f1bc4..e1d88e4 100644 --- a/source/Irrlicht/CImageWriterJPG.cpp +++ b/source/Irrlicht/CImageWriterJPG.cpp @@ -10,6 +10,7 @@ #include "IWriteFile.h" #include "CImage.h" #include "irrString.h" +#include "os.h" #ifdef _IRR_COMPILE_WITH_LIBJPEG_ #include // required for jpeglib.h @@ -121,10 +122,9 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality) case ECF_R5G6B5: format = CColorConverter::convert_R5G6B5toR8G8B8; break; -#ifndef _DEBUG default: + os::Printer::log("writeJPEGFile does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); break; -#endif } // couldn't find a color converter diff --git a/source/Irrlicht/CImageWriterPNG.cpp b/source/Irrlicht/CImageWriterPNG.cpp index 97bf4e1..3da4345 100644 --- a/source/Irrlicht/CImageWriterPNG.cpp +++ b/source/Irrlicht/CImageWriterPNG.cpp @@ -161,11 +161,12 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) case ECF_A1R5G5B5: CColorConverter::convert_A1R5G5B5toA8R8G8B8(data,image->getDimension().Height*image->getDimension().Width,tmpImage); break; -#ifndef _DEBUG // TODO: Error handling in case of unsupported color format default: - break; -#endif + os::Printer::log("CImageWriterPNG does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); + png_destroy_write_struct(&png_ptr, &info_ptr); + delete [] tmpImage; + return false; } // Create array of pointers to rows in image data diff --git a/source/Irrlicht/CImageWriterTGA.cpp b/source/Irrlicht/CImageWriterTGA.cpp index 6198e3f..dd8c070 100644 --- a/source/Irrlicht/CImageWriterTGA.cpp +++ b/source/Irrlicht/CImageWriterTGA.cpp @@ -10,6 +10,7 @@ #include "IWriteFile.h" #include "CColorConverter.h" #include "irrString.h" +#include "os.h" namespace irr { @@ -84,10 +85,9 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) imageHeader.PixelDepth = 24; imageHeader.ImageDescriptor |= 0; break; -#ifndef _DEBUG default: + os::Printer::log("CImageWriterTGA does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); break; -#endif } // couldn't find a color converter