mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
Drop IrrCompileConfig (#163)
This commit is contained in:
@ -4,17 +4,13 @@
|
||||
|
||||
#include "CImageWriterPNG.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_PNG_WRITER_
|
||||
|
||||
#include "CImageLoaderPNG.h"
|
||||
#include "CColorConverter.h"
|
||||
#include "IWriteFile.h"
|
||||
#include "irrString.h"
|
||||
#include "os.h" // for logging
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_LIBPNG_
|
||||
#include <png.h> // use system lib png
|
||||
#endif // _IRR_COMPILE_WITH_LIBPNG_
|
||||
#include <png.h> // use system lib png
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -26,7 +22,6 @@ IImageWriter* createImageWriterPNG()
|
||||
return new CImageWriterPNG;
|
||||
}
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_LIBPNG_
|
||||
// PNG function for error handling
|
||||
static void png_cpexcept_error(png_structp png_ptr, png_const_charp msg)
|
||||
{
|
||||
@ -51,7 +46,6 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, png_bytep data, png_size_t
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Write Error");
|
||||
}
|
||||
#endif // _IRR_COMPILE_WITH_LIBPNG_
|
||||
|
||||
CImageWriterPNG::CImageWriterPNG()
|
||||
{
|
||||
@ -62,16 +56,11 @@ CImageWriterPNG::CImageWriterPNG()
|
||||
|
||||
bool CImageWriterPNG::isAWriteableFileExtension(const io::path& filename) const
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_LIBPNG_
|
||||
return core::hasFileExtension ( filename, "png" );
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) const
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_LIBPNG_
|
||||
if (!file || !image)
|
||||
return false;
|
||||
|
||||
@ -206,13 +195,7 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param)
|
||||
delete [] tmpImage;
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user