Commit 95280da0 authored by hybrid's avatar hybrid

Added compiler switches for image loaders and writers.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@997 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 565c5bfe
...@@ -265,6 +265,36 @@ B3D, MS3D or X meshes */ ...@@ -265,6 +265,36 @@ B3D, MS3D or X meshes */
//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files //! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files
#define _IRR_COMPILE_WITH_STL_WRITER_ #define _IRR_COMPILE_WITH_STL_WRITER_
//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files
#define _IRR_COMPILE_WITH_BMP_LOADER_
//! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files
#define _IRR_COMPILE_WITH_JPG_LOADER_
//! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files
#define _IRR_COMPILE_WITH_PCX_LOADER_
//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files
#define _IRR_COMPILE_WITH_PNG_LOADER_
//! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files
#define _IRR_COMPILE_WITH_PPM_LOADER_
//! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files
#define _IRR_COMPILE_WITH_PSD_LOADER_
//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files
#define _IRR_COMPILE_WITH_TGA_LOADER_
//! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files
#define _IRR_COMPILE_WITH_BMP_WRITER_
//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files
#define _IRR_COMPILE_WITH_JPG_WRITER_
//! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files
#define _IRR_COMPILE_WITH_PCX_WRITER_
//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files
#define _IRR_COMPILE_WITH_PNG_WRITER_
//! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files
#define _IRR_COMPILE_WITH_PPM_WRITER_
//! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files
#define _IRR_COMPILE_WITH_PSD_WRITER_
//! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files
#define _IRR_COMPILE_WITH_TGA_WRITER_
//! Set FPU settings //! Set FPU settings
/** Irrlicht should use approximate float and integer fpu techniques /** Irrlicht should use approximate float and integer fpu techniques
precision will be lower but speed higher. currently X86 only precision will be lower but speed higher. currently X86 only
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderBMP.h" #include "CImageLoaderBMP.h"
#ifdef _IRR_COMPILE_WITH_BMP_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "SColor.h" #include "SColor.h"
#include "CColorConverter.h" #include "CColorConverter.h"
...@@ -360,3 +363,5 @@ IImageLoader* createImageLoaderBMP() ...@@ -360,3 +363,5 @@ IImageLoader* createImageLoaderBMP()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef __C_IMAGE_LOADER_BMP_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_BMP_H_INCLUDED__
#define __C_IMAGE_LOADER_BMP_H_INCLUDED__ #define __C_IMAGE_LOADER_BMP_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_BMP_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
...@@ -102,4 +106,5 @@ private: ...@@ -102,4 +106,5 @@ private:
#endif #endif
#endif
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderJPG.h" #include "CImageLoaderJPG.h"
#ifdef _IRR_COMPILE_WITH_JPG_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "CImage.h" #include "CImage.h"
#include "os.h" #include "os.h"
...@@ -253,3 +256,5 @@ IImageLoader* createImageLoaderJPG() ...@@ -253,3 +256,5 @@ IImageLoader* createImageLoaderJPG()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
#ifndef __C_IMAGE_LOADER_JPG_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_JPG_H_INCLUDED__
#define __C_IMAGE_LOADER_JPG_H_INCLUDED__ #define __C_IMAGE_LOADER_JPG_H_INCLUDED__
#include "IImageLoader.h" #include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_JPG_LOADER_
#include "IImageLoader.h"
#include "IrrCompileConfig.h"
#include <stdio.h> // required for jpeglib.h #include <stdio.h> // required for jpeglib.h
#ifdef _IRR_COMPILE_WITH_LIBJPEG_ #ifdef _IRR_COMPILE_WITH_LIBJPEG_
extern "C" { extern "C" {
...@@ -107,4 +109,5 @@ private: ...@@ -107,4 +109,5 @@ private:
#endif #endif
#endif
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderPCX.h" #include "CImageLoaderPCX.h"
#ifdef _IRR_COMPILE_WITH_PCX_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "SColor.h" #include "SColor.h"
#include "CColorConverter.h" #include "CColorConverter.h"
...@@ -180,3 +183,6 @@ IImageLoader* createImageLoaderPCX() ...@@ -180,3 +183,6 @@ IImageLoader* createImageLoaderPCX()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef __C_IMAGE_LOADER_PCX_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_PCX_H_INCLUDED__
#define __C_IMAGE_LOADER_PCX_H_INCLUDED__ #define __C_IMAGE_LOADER_PCX_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PCX_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
namespace irr namespace irr
...@@ -83,6 +87,6 @@ public: ...@@ -83,6 +87,6 @@ public:
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
#endif #endif
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h" #include "CImageLoaderPNG.h"
#ifdef _IRR_COMPILE_WITH_PNG_LOADER_
#ifdef _IRR_COMPILE_WITH_LIBPNG_ #ifdef _IRR_COMPILE_WITH_LIBPNG_
#ifndef _IRR_USE_NON_SYSTEM_LIB_PNG_ #ifndef _IRR_USE_NON_SYSTEM_LIB_PNG_
...@@ -12,7 +14,6 @@ ...@@ -12,7 +14,6 @@
#endif // _IRR_USE_NON_SYSTEM_LIB_PNG_ #endif // _IRR_USE_NON_SYSTEM_LIB_PNG_
#endif // _IRR_COMPILE_WITH_LIBPNG_ #endif // _IRR_COMPILE_WITH_LIBPNG_
#include "CImageLoaderPNG.h"
#include "CImage.h" #include "CImage.h"
#include "CReadFile.h" #include "CReadFile.h"
#include "os.h" #include "os.h"
...@@ -45,15 +46,6 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l ...@@ -45,15 +46,6 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l
} }
#endif // _IRR_COMPILE_WITH_LIBPNG_ #endif // _IRR_COMPILE_WITH_LIBPNG_
CImageLoaderPng::CImageLoaderPng()
{
// do something?
}
CImageLoaderPng::~CImageLoaderPng()
{
// do something?
}
//! returns true if the file maybe is able to be loaded by this class //! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga") //! based on the file extension (e.g. ".tga")
...@@ -276,3 +268,5 @@ IImageLoader* createImageLoaderPNG() ...@@ -276,3 +268,5 @@ IImageLoader* createImageLoaderPNG()
}// end namespace irr }// end namespace irr
}//end namespace video }//end namespace video
#endif
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
#ifndef __C_IMAGE_LOADER_PNG_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_PNG_H_INCLUDED__
#define __C_IMAGE_LOADER_PNG_H_INCLUDED__ #define __C_IMAGE_LOADER_PNG_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PNG_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
namespace irr namespace irr
...@@ -21,12 +25,6 @@ class CImageLoaderPng : public IImageLoader ...@@ -21,12 +25,6 @@ class CImageLoaderPng : public IImageLoader
{ {
public: public:
//! constructor
CImageLoaderPng();
//! destructor
virtual ~CImageLoaderPng();
//! returns true if the file maybe is able to be loaded by this class //! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".png") //! based on the file extension (e.g. ".png")
virtual bool isALoadableFileExtension(const c8* fileName) const; virtual bool isALoadableFileExtension(const c8* fileName) const;
...@@ -43,3 +41,5 @@ public: ...@@ -43,3 +41,5 @@ public:
} // end namespace irr } // end namespace irr
#endif #endif
#endif
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderPPM.h" #include "CImageLoaderPPM.h"
#ifdef _IRR_COMPILE_WITH_PPM_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "CColorConverter.h" #include "CColorConverter.h"
#include "CImage.h" #include "CImage.h"
...@@ -270,3 +273,5 @@ IImageLoader* createImageLoaderPPM() ...@@ -270,3 +273,5 @@ IImageLoader* createImageLoaderPPM()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef __C_IMAGE_LOADER_PPM_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_PPM_H_INCLUDED__
#define __C_IMAGE_LOADER_PPM_H_INCLUDED__ #define __C_IMAGE_LOADER_PPM_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PPM_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
#include "irrString.h" #include "irrString.h"
...@@ -16,7 +20,7 @@ namespace video ...@@ -16,7 +20,7 @@ namespace video
/*! /*!
Surface Loader for Windows bitmaps Surface Loader for SUN Pixmaps
*/ */
class CImageLoaderPPM : public IImageLoader class CImageLoaderPPM : public IImageLoader
{ {
...@@ -47,4 +51,5 @@ private: ...@@ -47,4 +51,5 @@ private:
#endif #endif
#endif
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderPSD.h" #include "CImageLoaderPSD.h"
#ifdef _IRR_COMPILE_WITH_PSD_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "os.h" #include "os.h"
#include "CImage.h" #include "CImage.h"
...@@ -368,3 +371,5 @@ IImageLoader* createImageLoaderPSD() ...@@ -368,3 +371,5 @@ IImageLoader* createImageLoaderPSD()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef __C_IMAGE_LOADER_PSD_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_PSD_H_INCLUDED__
#define __C_IMAGE_LOADER_PSD_H_INCLUDED__ #define __C_IMAGE_LOADER_PSD_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PSD_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
namespace irr namespace irr
...@@ -75,6 +79,6 @@ private: ...@@ -75,6 +79,6 @@ private:
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
#endif #endif
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageLoaderTGA.h" #include "CImageLoaderTGA.h"
#ifdef _IRR_COMPILE_WITH_TGA_LOADER_
#include "IReadFile.h" #include "IReadFile.h"
#include "os.h" #include "os.h"
#include "CColorConverter.h" #include "CColorConverter.h"
...@@ -191,3 +194,5 @@ IImageLoader* createImageLoaderTGA() ...@@ -191,3 +194,5 @@ IImageLoader* createImageLoaderTGA()
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
#endif
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef __C_IMAGE_LOADER_TGA_H_INCLUDED__ #ifndef __C_IMAGE_LOADER_TGA_H_INCLUDED__
#define __C_IMAGE_LOADER_TGA_H_INCLUDED__ #define __C_IMAGE_LOADER_TGA_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_TGA_LOADER_
#include "IImageLoader.h" #include "IImageLoader.h"
...@@ -83,4 +87,5 @@ private: ...@@ -83,4 +87,5 @@ private:
} // end namespace irr } // end namespace irr
#endif #endif
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterBMP.h" #include "CImageWriterBMP.h"
#ifdef _IRR_COMPILE_WITH_BMP_WRITER_
#include "CImageLoaderBMP.h" #include "CImageLoaderBMP.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "CColorConverter.h" #include "CColorConverter.h"
...@@ -125,3 +131,6 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) ...@@ -125,3 +131,6 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_BMP_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_BMP_H_INCLUDED__
#define _C_IMAGE_WRITER_BMP_H_INCLUDED__ #define _C_IMAGE_WRITER_BMP_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_BMP_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -24,5 +32,6 @@ public: ...@@ -24,5 +32,6 @@ public:
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
#endif // _C_IMAGE_WRITER_BMP_H_INCLUDED__ #endif // _C_IMAGE_WRITER_BMP_H_INCLUDED__
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterJPG.h" #include "CImageWriterJPG.h"
#ifdef _IRR_COMPILE_WITH_JPG_WRITER_
#include "CColorConverter.h" #include "CColorConverter.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "CImage.h" #include "CImage.h"
#include "CColorConverter.h" #include "CColorConverter.h"
#include "irrString.h" #include "irrString.h"
#include "IrrCompileConfig.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
extern "C" extern "C"
...@@ -227,3 +232,5 @@ bool CImageWriterJPG::writeImage(io::IWriteFile *file, IImage *input,u32 quality ...@@ -227,3 +232,5 @@ bool CImageWriterJPG::writeImage(io::IWriteFile *file, IImage *input,u32 quality
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_JPG_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_JPG_H_INCLUDED__
#define _C_IMAGE_WRITER_JPG_H_INCLUDED__ #define _C_IMAGE_WRITER_JPG_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_JPG_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -25,4 +33,5 @@ public: ...@@ -25,4 +33,5 @@ public:
} }
#endif // _C_IMAGE_WRITER_JPG_H_INCLUDED__ #endif // _C_IMAGE_WRITER_JPG_H_INCLUDED__
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterPCX.h" #include "CImageWriterPCX.h"
#ifdef _IRR_COMPILE_WITH_PCX_WRITER_
#include "CImageLoaderPCX.h" #include "CImageLoaderPCX.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "os.h" // for logging #include "os.h" // for logging
...@@ -36,3 +42,5 @@ bool CImageWriterPCX::writeImage(io::IWriteFile *file, IImage *image,u32 param) ...@@ -36,3 +42,5 @@ bool CImageWriterPCX::writeImage(io::IWriteFile *file, IImage *image,u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_PCX_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_PCX_H_INCLUDED__
#define _C_IMAGE_WRITER_PCX_H_INCLUDED__ #define _C_IMAGE_WRITER_PCX_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PCX_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -24,5 +32,6 @@ public: ...@@ -24,5 +32,6 @@ public:
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
#endif // _C_IMAGE_WRITER_PCX_H_INCLUDED__ #endif // _C_IMAGE_WRITER_PCX_H_INCLUDED__
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterPNG.h" #include "CImageWriterPNG.h"
#ifdef _IRR_COMPILE_WITH_PNG_WRITER_
#include "CImageLoaderPNG.h" #include "CImageLoaderPNG.h"
#include "CColorConverter.h" #include "CColorConverter.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "irrString.h" #include "irrString.h"
#include "os.h" // for logging #include "os.h" // for logging
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_LIBPNG_ #ifdef _IRR_COMPILE_WITH_LIBPNG_
#ifndef _IRR_USE_NON_SYSTEM_LIB_PNG_ #ifndef _IRR_USE_NON_SYSTEM_LIB_PNG_
#include <png.h> // use system lib png #include <png.h> // use system lib png
...@@ -198,3 +203,6 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) ...@@ -198,3 +203,6 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_PNG_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_PNG_H_INCLUDED__
#define _C_IMAGE_WRITER_PNG_H_INCLUDED__ #define _C_IMAGE_WRITER_PNG_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PNG_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -25,3 +33,5 @@ public: ...@@ -25,3 +33,5 @@ public:
} // namespace irr } // namespace irr
#endif // _C_IMAGE_WRITER_PNG_H_INCLUDED__ #endif // _C_IMAGE_WRITER_PNG_H_INCLUDED__
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterPPM.h" #include "CImageWriterPPM.h"
#ifdef _IRR_COMPILE_WITH_PPM_WRITER_
#include "IWriteFile.h" #include "IWriteFile.h"
#include "IImage.h" #include "IImage.h"
#include "dimension2d.h" #include "dimension2d.h"
...@@ -66,3 +72,6 @@ bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image,u32 param) ...@@ -66,3 +72,6 @@ bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image,u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_PPM_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_PPM_H_INCLUDED__
#define _C_IMAGE_WRITER_PPM_H_INCLUDED__ #define _C_IMAGE_WRITER_PPM_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PPM_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -25,4 +33,5 @@ public: ...@@ -25,4 +33,5 @@ public:
} // namespace irr } // namespace irr
#endif // _C_IMAGE_WRITER_PPM_H_INCLUDED__ #endif // _C_IMAGE_WRITER_PPM_H_INCLUDED__
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterPSD.h" #include "CImageWriterPSD.h"
#ifdef _IRR_COMPILE_WITH_PSD_WRITER_
#include "CImageLoaderPSD.h" #include "CImageLoaderPSD.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "os.h" // for logging #include "os.h" // for logging
...@@ -35,3 +41,6 @@ bool CImageWriterPSD::writeImage(io::IWriteFile *file, IImage *image,u32 param) ...@@ -35,3 +41,6 @@ bool CImageWriterPSD::writeImage(io::IWriteFile *file, IImage *image,u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_PSD_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_PSD_H_INCLUDED__
#define _C_IMAGE_WRITER_PSD_H_INCLUDED__ #define _C_IMAGE_WRITER_PSD_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_PSD_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -25,3 +33,5 @@ public: ...@@ -25,3 +33,5 @@ public:
} // namespace irr } // namespace irr
#endif // _I_IMAGE_WRITER_PSD_H_INCLUDED__ #endif // _I_IMAGE_WRITER_PSD_H_INCLUDED__
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CImageWriterTGA.h" #include "CImageWriterTGA.h"
#ifdef _IRR_COMPILE_WITH_TGA_WRITER_
#include "CImageLoaderTGA.h" #include "CImageLoaderTGA.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "CColorConverter.h" #include "CColorConverter.h"
...@@ -132,3 +138,6 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) ...@@ -132,3 +138,6 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param)
} // namespace video } // namespace video
} // namespace irr } // namespace irr
#endif
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef _C_IMAGE_WRITER_TGA_H_INCLUDED__ #ifndef _C_IMAGE_WRITER_TGA_H_INCLUDED__
#define _C_IMAGE_WRITER_TGA_H_INCLUDED__ #define _C_IMAGE_WRITER_TGA_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_TGA_WRITER_
#include "IImageWriter.h" #include "IImageWriter.h"
namespace irr namespace irr
...@@ -25,3 +33,5 @@ public: ...@@ -25,3 +33,5 @@ public:
} // namespace irr } // namespace irr
#endif // _C_IMAGE_WRITER_TGA_H_INCLUDED__ #endif // _C_IMAGE_WRITER_TGA_H_INCLUDED__
#endif
...@@ -84,21 +84,49 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<s32>& scre ...@@ -84,21 +84,49 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<s32>& scre
// create surface loader // create surface loader
#ifdef _IRR_COMPILE_WITH_BMP_LOADER_
SurfaceLoader.push_back(video::createImageLoaderBMP()); SurfaceLoader.push_back(video::createImageLoaderBMP());
#endif
#ifdef _IRR_COMPILE_WITH_JPG_LOADER_
SurfaceLoader.push_back(video::createImageLoaderJPG()); SurfaceLoader.push_back(video::createImageLoaderJPG());
#endif
#ifdef _IRR_COMPILE_WITH_TGA_LOADER_
SurfaceLoader.push_back(video::createImageLoaderTGA()); SurfaceLoader.push_back(video::createImageLoaderTGA());
#endif
#ifdef _IRR_COMPILE_WITH_PSD_LOADER_
SurfaceLoader.push_back(video::createImageLoaderPSD()); SurfaceLoader.push_back(video::createImageLoaderPSD());
#endif
#ifdef _IRR_COMPILE_WITH_PCX_LOADER_
SurfaceLoader.push_back(video::createImageLoaderPCX()); SurfaceLoader.push_back(video::createImageLoaderPCX());
#endif
#ifdef _IRR_COMPILE_WITH_PNG_LOADER_
SurfaceLoader.push_back(video::createImageLoaderPNG()); SurfaceLoader.push_back(video::createImageLoaderPNG());
#endif
#ifdef _IRR_COMPILE_WITH_PPM_LOADER_
SurfaceLoader.push_back(video::createImageLoaderPPM()); SurfaceLoader.push_back(video::createImageLoaderPPM());
#endif
#ifdef _IRR_COMPILE_WITH_BMP_WRITER_
SurfaceWriter.push_back(video::createImageWriterBMP()); SurfaceWriter.push_back(video::createImageWriterBMP());
#endif
#ifdef _IRR_COMPILE_WITH_JPG_WRITER_
SurfaceWriter.push_back(video::createImageWriterJPG()); SurfaceWriter.push_back(video::createImageWriterJPG());
#endif
#ifdef _IRR_COMPILE_WITH_TGA_WRITER_
SurfaceWriter.push_back(video::createImageWriterTGA()); SurfaceWriter.push_back(video::createImageWriterTGA());
#endif
#ifdef _IRR_COMPILE_WITH_PSD_WRITER_
SurfaceWriter.push_back(video::createImageWriterPSD()); SurfaceWriter.push_back(video::createImageWriterPSD());
#endif
#ifdef _IRR_COMPILE_WITH_PCX_WRITER_
SurfaceWriter.push_back(video::createImageWriterPCX()); SurfaceWriter.push_back(video::createImageWriterPCX());
#endif
#ifdef _IRR_COMPILE_WITH_PNG_WRITER_
SurfaceWriter.push_back(video::createImageWriterPNG()); SurfaceWriter.push_back(video::createImageWriterPNG());
#endif
#ifdef _IRR_COMPILE_WITH_PPM_WRITER_
SurfaceWriter.push_back(video::createImageWriterPPM()); SurfaceWriter.push_back(video::createImageWriterPPM());
#endif
// set ExposedData to 0 // set ExposedData to 0
memset(&ExposedData, 0, sizeof(ExposedData)); memset(&ExposedData, 0, sizeof(ExposedData));
......
...@@ -13,15 +13,14 @@ namespace scene ...@@ -13,15 +13,14 @@ namespace scene
{ {
//! constructor //! constructor
COctTreeTriangleSelector::COctTreeTriangleSelector(IMesh* mesh, ISceneNode* node, COctTreeTriangleSelector::COctTreeTriangleSelector(IMesh* mesh,
s32 minimalPolysPerNode) ISceneNode* node, s32 minimalPolysPerNode)
: CTriangleSelector(mesh, node), Root(0), NodeCount(0), : CTriangleSelector(mesh, node), Root(0), NodeCount(0),
MinimalPolysPerNode(minimalPolysPerNode) MinimalPolysPerNode(minimalPolysPerNode)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("COctTreeTriangleSelector"); setDebugName("COctTreeTriangleSelector");
#endif #endif
if (!Triangles.empty()) if (!Triangles.empty())
{ {
...@@ -41,7 +40,6 @@ COctTreeTriangleSelector::COctTreeTriangleSelector(IMesh* mesh, ISceneNode* node ...@@ -41,7 +40,6 @@ COctTreeTriangleSelector::COctTreeTriangleSelector(IMesh* mesh, ISceneNode* node
} }
//! destructor //! destructor
COctTreeTriangleSelector::~COctTreeTriangleSelector() COctTreeTriangleSelector::~COctTreeTriangleSelector()
{ {
...@@ -49,7 +47,6 @@ COctTreeTriangleSelector::~COctTreeTriangleSelector() ...@@ -49,7 +47,6 @@ COctTreeTriangleSelector::~COctTreeTriangleSelector()
} }
void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node) void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node)
{ {
++NodeCount; ++NodeCount;
...@@ -57,15 +54,15 @@ void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node) ...@@ -57,15 +54,15 @@ void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node)
node->Box.reset(node->Triangles[0].pointA); node->Box.reset(node->Triangles[0].pointA);
// get bounding box // get bounding box
s32 cnt = node->Triangles.size(); const u32 cnt = node->Triangles.size();
for (s32 i=0; i<cnt; ++i) for (u32 i=0; i<cnt; ++i)
{ {
node->Box.addInternalPoint(node->Triangles[i].pointA); node->Box.addInternalPoint(node->Triangles[i].pointA);
node->Box.addInternalPoint(node->Triangles[i].pointB); node->Box.addInternalPoint(node->Triangles[i].pointB);
node->Box.addInternalPoint(node->Triangles[i].pointC); node->Box.addInternalPoint(node->Triangles[i].pointC);
} }
core::vector3df middle = node->Box.getCenter(); const core::vector3df& middle = node->Box.getCenter();
core::vector3df edges[8]; core::vector3df edges[8];
node->Box.getEdges(edges); node->Box.getEdges(edges);
...@@ -114,9 +111,9 @@ void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node) ...@@ -114,9 +111,9 @@ void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node)
//! Gets all triangles which lie within a specific bounding box. //! Gets all triangles which lie within a specific bounding box.
void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles, void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount, s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box, const core::aabbox3d<f32>& box,
const core::matrix4* transform) const const core::matrix4* transform) const
{ {
core::matrix4 mat; core::matrix4 mat;
core::aabbox3d<f32> invbox = box; core::aabbox3d<f32> invbox = box;
...@@ -131,7 +128,7 @@ void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles, ...@@ -131,7 +128,7 @@ void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles,
mat.makeIdentity(); mat.makeIdentity();
if (transform) if (transform)
mat = (*transform); mat = *transform;
if (SceneNode) if (SceneNode)
mat *= SceneNode->getAbsoluteTransformation(); mat *= SceneNode->getAbsoluteTransformation();
...@@ -178,8 +175,8 @@ void COctTreeTriangleSelector::getTrianglesFromOctTree( ...@@ -178,8 +175,8 @@ void COctTreeTriangleSelector::getTrianglesFromOctTree(
//! Gets all triangles which have or may have contact with a 3d line. //! Gets all triangles which have or may have contact with a 3d line.
void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize, void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line, s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform) const const core::matrix4* transform) const
{ {
core::aabbox3d<f32> box(line.start); core::aabbox3d<f32> box(line.start);
box.addInternalPoint(line.end); box.addInternalPoint(line.end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment