mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 18:20:30 +01:00
Replace compile-warnings for unsupported image formats in writers with a log message warning.
Having too many warnings makes it harder to see real warnings. I know the idea to keep those around was to have them as reminder to work on those. But going over the formats here - it just doesn't make sense in most cases. And for the rest (like we could add converts from R8 or so) no-one is going to work on it until someone concretely needs it anyway. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6046 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
985997a755
commit
83d368cef4
@ -10,6 +10,7 @@
|
|||||||
#include "IWriteFile.h"
|
#include "IWriteFile.h"
|
||||||
#include "CColorConverter.h"
|
#include "CColorConverter.h"
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
@ -80,10 +81,9 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param)
|
|||||||
CColorConverter_convertFORMATtoFORMAT
|
CColorConverter_convertFORMATtoFORMAT
|
||||||
= CColorConverter::convert_R5G6B5toR8G8B8;
|
= CColorConverter::convert_R5G6B5toR8G8B8;
|
||||||
break;
|
break;
|
||||||
#ifndef _DEBUG
|
|
||||||
default:
|
default:
|
||||||
|
os::Printer::log("CImageWriterBMP does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// couldn't find a color converter
|
// couldn't find a color converter
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "IWriteFile.h"
|
#include "IWriteFile.h"
|
||||||
#include "CImage.h"
|
#include "CImage.h"
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_LIBJPEG_
|
#ifdef _IRR_COMPILE_WITH_LIBJPEG_
|
||||||
#include <stdio.h> // required for jpeglib.h
|
#include <stdio.h> // required for jpeglib.h
|
||||||
@ -121,10 +122,9 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality)
|
|||||||
case ECF_R5G6B5:
|
case ECF_R5G6B5:
|
||||||
format = CColorConverter::convert_R5G6B5toR8G8B8;
|
format = CColorConverter::convert_R5G6B5toR8G8B8;
|
||||||
break;
|
break;
|
||||||
#ifndef _DEBUG
|
|
||||||
default:
|
default:
|
||||||
|
os::Printer::log("writeJPEGFile does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// couldn't find a color converter
|
// couldn't find a color converter
|
||||||
|
@ -161,11 +161,12 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param)
|
|||||||
case ECF_A1R5G5B5:
|
case ECF_A1R5G5B5:
|
||||||
CColorConverter::convert_A1R5G5B5toA8R8G8B8(data,image->getDimension().Height*image->getDimension().Width,tmpImage);
|
CColorConverter::convert_A1R5G5B5toA8R8G8B8(data,image->getDimension().Height*image->getDimension().Width,tmpImage);
|
||||||
break;
|
break;
|
||||||
#ifndef _DEBUG
|
|
||||||
// TODO: Error handling in case of unsupported color format
|
// TODO: Error handling in case of unsupported color format
|
||||||
default:
|
default:
|
||||||
break;
|
os::Printer::log("CImageWriterPNG does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING);
|
||||||
#endif
|
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||||
|
delete [] tmpImage;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create array of pointers to rows in image data
|
// Create array of pointers to rows in image data
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "IWriteFile.h"
|
#include "IWriteFile.h"
|
||||||
#include "CColorConverter.h"
|
#include "CColorConverter.h"
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
@ -84,10 +85,9 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param)
|
|||||||
imageHeader.PixelDepth = 24;
|
imageHeader.PixelDepth = 24;
|
||||||
imageHeader.ImageDescriptor |= 0;
|
imageHeader.ImageDescriptor |= 0;
|
||||||
break;
|
break;
|
||||||
#ifndef _DEBUG
|
|
||||||
default:
|
default:
|
||||||
|
os::Printer::log("CImageWriterTGA does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// couldn't find a color converter
|
// couldn't find a color converter
|
||||||
|
Loading…
Reference in New Issue
Block a user