Commits

David Rogers committed 61217d1

Remove remaining references to the DevIL library since we are no longer using it internally.

  • Participants
  • Parent commits e949df2

Comments (0)

Files changed (11)

OgreMain/include/OgreConfig.h

 #define OGRE_NO_FREEIMAGE 0
 #endif
 
-/** Disables use of the DevIL image library for loading images.
-By default DevIL is disabled in Eihort in favour of FreeImage, but you may re-enable
-it if you choose
-*/
-#ifndef OGRE_NO_DEVIL
-#define OGRE_NO_DEVIL 1
-#endif
-
 /** Disables use of the internal image codec for loading DDS files.
 WARNING: Use only when you want to provide your own image loading code via codecs.
 */

OgreMain/include/OgreILCodecs.h

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef _ILCodecs_H__
-#define _ILCodecs_H__
-
-#include <list>
-
-namespace Ogre 
-{
-    class ILImageCodec;
-    
-    class _OgrePrivate ILCodecs {
-    protected:
-       static std::list<ILImageCodec*> codeclist;
-    public:
-    	// Register all codecs provided by this module
-	   static void registerCodecs(void);
-	   // Delete all codecs provided by this module
-	   static void deleteCodecs(void);
-    };
-
-} // namespace Ogre
-
-
-#endif // #ifndef _DDSCodec_H__
-

OgreMain/include/OgreILImageCodec.h

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef _ILImageCodec_H__
-#define _ILImageCodec_H__
-
-#include "OgreImageCodec.h"
-
-namespace Ogre {
-
-    /** Codec specialized in images loaded using DevIL.
-        @remarks
-            The users implementing subclasses of ImageCodec are required to return
-            a valid pointer to a ImageData class from the decode(...) function.
-    */
-    class _OgreExport ILImageCodec : public ImageCodec
-    {
-    private:
-		static bool _is_initialised;
-        String mType;
-        unsigned int mIlType;
-
-    public:
-        ILImageCodec(const String &type, unsigned int ilType);
-        virtual ~ILImageCodec() { }
-
-        /// @copydoc Codec::code
-        DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
-        /// @copydoc Codec::codeToFile
-        void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const;
-        /// @copydoc Codec::decode
-        DecodeResult decode(DataStreamPtr& input) const;
-
-        /// Initialise DevIL
-        void initialiseIL(void);
-        
-        virtual String getType() const;        
-
-	String magicNumberToFileExt(const char *magicNumberPtr, size_t maxbytes) const;
-    };
-
-} // namespace
-
-#endif

OgreMain/include/OgreILUtil.h

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef _Ogre_ILUtil_H__
-#define _Ogre_ILUtil_H__
-
-#include <OgrePrerequisites.h>
-#include <OgreCommon.h>
-#include <OgrePixelFormat.h>
-
-namespace Ogre {
-
-    /* 
-     * DevIL specific utility class
-     **/    
-    class _OgrePrivate ILUtil {
-    public:
-    	/// Structure that encapsulates a devIL image format definition
-		struct ILFormat {
-			/// Construct an invalidated ILFormat structure
-			ILFormat():
-				numberOfChannels(0), format(-1), type(-1) {};
-
-			/// Construct a ILFormat from parameters
-			ILFormat(int channels, int format, int type=-1):
-				numberOfChannels(channels), format(format), type(type) {}
-
-			/// Return wether this structure represents a valid DevIL format
-			bool isValid() { return format!=-1; }
-
-			/// Number of channels, usually 3 or 4
-			int numberOfChannels;
-			/// IL_RGBA,IL_BGRA,IL_DXTx, ...
-  			int format;
-			/// IL_UNSIGNED_BYTE, IL_UNSIGNED_SHORT, ... may be -1 for compressed formats
-  			int type;
-		};
-
-        /** Get OGRE format to which a given IL format can be most optimally converted.
-         */
-        static PixelFormat ilFormat2OgreFormat( int ImageFormat, int ImageType );
-        /**	Get IL format that matches a given OGRE format exactly in memory.
-        	@remarks	Returns an invalid ILFormat (.isValid()==false) when
-        		there is no IL format that matches this.
-         */
-        static ILFormat OgreFormat2ilFormat( PixelFormat format );      
-        /** Convert current IL image to an OGRE format. The size of the target will be
-          	PixelUtil::getNumElemBytes(fmt) * ilGetInteger( IL_IMAGE_WIDTH ) * ilGetInteger( IL_IMAGE_HEIGHT ) * ilGetInteger( IL_IMAGE_DEPTH )
-          	The IL image type must be IL(_UNSIGNED_)BYTE or IL_FLOAT.
-        	The IL image format must be IL_RGBA, IL_BGRA, IL_RGB, IL_BGR, IL_LUMINANCE or IL_LUMINANCE_ALPHA
-         
-         	@param tar       Target pointer
-         	@param ogrefmt   Ogre pixel format to employ
-        */
-        static void toOgre(const PixelBox &dst);
-
-        /** Convert an OGRE format image to current IL image.
-         	@param src       Pixelbox; encapsulates source pointer, width, height, 
-         					 depth and format
-        */
-        static void fromOgre(const PixelBox &src);
-    };
-
-}
-
-#endif

OgreMain/src/OgreILCodecs.cpp

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <OgreStableHeaders.h>
-
-#include <OgreImage.h>
-#include <OgreCodec.h>
-#include <OgreException.h>
-#include <OgreLogManager.h>
-#include <OgreStringConverter.h>
-#include "OgreILImageCodec.h"
-#include "OgreILCodecs.h"
-
-#include <IL/il.h>
-#include <IL/ilu.h>
-
-namespace Ogre {
-    std::list<ILImageCodec*> ILCodecs::codeclist;
-
-	// Return IL type for a certain extension
-	ILenum ogreIlTypeFromExt(const String &ext)
-	{
-#ifdef IL_TGA
-		if (ext=="tga" || ext=="vda" ||
-			ext=="icb" || ext=="vst")
-			return IL_TGA;
-#endif
-#ifdef IL_JPG
-		if (ext=="jpg" || ext=="jpe" || ext=="jpeg")
-			return IL_JPG;
-#endif
-/*#ifdef IL_DDS
-		if (ext=="dds")
-			return IL_DDS;
-#endif*/
-#ifdef IL_PNG
-		if (ext=="png")
-			return IL_PNG;
-#endif
-#ifdef IL_BMP
-		if (ext=="bmp" || ext=="dib")
-			return IL_BMP;
-#endif
-#ifdef IL_GIF
-		if (ext=="gif")
-			return IL_GIF;
-#endif
-#ifdef IL_CUT
-		if (ext=="cut")
-			return IL_CUT;
-#endif
-#ifdef IL_HDR
-		if (ext=="hdr")
-			return IL_HDR;
-#endif
-#ifdef IL_ICO
-		if (ext=="ico" || ext=="cur")
-			return IL_ICO;
-#endif
-#ifdef IL_JNG
-		if (ext=="jng")
-			return IL_JNG;
-#endif
-#ifdef IL_LIF
-		if (ext=="lif")
-			return IL_LIF;
-#endif
-#ifdef IL_MDL
-		if (ext=="mdl")
-			return IL_MDL;
-#endif
-#ifdef IL_MNG
-		if (ext=="mng" || ext=="jng")
-			return IL_MNG;
-#endif
-#ifdef IL_PCD
-		if (ext=="pcd")
-			return IL_PCD;
-#endif
-#ifdef IL_PCX
-		if (ext=="pcx")
-			return IL_PCX;
-#endif
-#ifdef IL_PIC
-		if (ext=="pic")
-			return IL_PIC;
-#endif
-#ifdef IL_PIX
-		if (ext=="pix")
-			return IL_PIX;
-#endif
-#ifdef IL_PNM
-		if (ext=="pbm" || ext=="pgm" ||
-			ext=="pnm" || ext=="ppm")
-			return IL_PNM;
-#endif
-#ifdef IL_PSD
-		if (ext=="psd" || ext=="pdd")
-			return IL_PSD;
-#endif
-#ifdef IL_PSP
-		if (ext=="psp")
-			return IL_PSP;
-#endif
-#ifdef IL_PXR
-		if (ext=="pxr")
-			return IL_PXR;
-#endif
-#ifdef IL_SGI
-		if (ext=="sgi" || ext=="bw" ||
-			ext=="rgb" || ext=="rgba")
-			return IL_SGI;
-#endif
-#ifdef IL_TIF
-		if (ext=="tif" || ext=="tiff")
-			return IL_TIF;
-#endif
-#ifdef IL_WAL
-		if (ext=="wal")
-			return IL_WAL;
-#endif
-#ifdef IL_XPM
-		if (ext=="xpm")
-			return IL_XPM;
-#endif
-	
-		return IL_TYPE_UNKNOWN;
-	}
-
-	
-    void ILCodecs::registerCodecs(void) {
-		const char *il_version = ilGetString ( IL_VERSION_NUM );
-		if( ilGetError() != IL_NO_ERROR )
-		{
-			// IL defined the version number as IL_VERSION in older versions, so we have to scan for it
-			for(int ver=150; ver<170; ver++)
-			{
-				il_version = ilGetString ( ver ); 
-				if(ilGetError() == IL_NO_ERROR)
-					break;
-				else
-					il_version = "Unknown";
-			}
-		}
-		LogManager::getSingleton().logMessage(
-         LML_NORMAL,
-            "DevIL version: " + String(il_version));
-        const char *il_extensions = ilGetString ( IL_LOAD_EXT );
-		if( ilGetError() != IL_NO_ERROR )
-			il_extensions = "";
-        
-        std::stringstream ext;
-        String str, all;
-        ext << il_extensions;
-        while(ext >> str)
-        {
-#if 0
-			String fileName = "dummy." + str;
-			// DevIL doesn't export this under windows -- how weird
-			int ilType = ilTypeFromext(const_cast<char*>(fileName.c_str()));
-#endif
-			int ilType = ogreIlTypeFromExt(str);
-            ILImageCodec *codec = new ILImageCodec(str, ilType);
-            Codec::registerCodec(codec);
-            codeclist.push_back(codec);
-			//all += str+String("(")+StringConverter::toString(ilType)+String(") ");
-			all += str+String(" ");
-        }
-		// Raw format, missing in image formats string
-		ILImageCodec *cod = new ILImageCodec("raw", IL_RAW);
-		Codec::registerCodec(cod);
-		codeclist.push_back(cod);
-		//all += String("raw")+"("+StringConverter::toString(IL_RAW)+String(") ");
-		all += String("raw ");
-		LogManager::getSingleton().logMessage(
-         LML_NORMAL,
-            "DevIL image formats: " + all);
-    }
-
-    void ILCodecs::deleteCodecs(void) {
-        for(std::list<ILImageCodec*>::const_iterator i = codeclist.begin(); i != codeclist.end(); ++i)
-        {
-            Codec::unRegisterCodec(*i);   
-            delete *i;
-        }
-        codeclist.clear();
-    }
-
-}
-

OgreMain/src/OgreILImageCodec.cpp

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#include <OgreStableHeaders.h>
-
-#include <OgreRoot.h>
-#include <OgreRenderSystem.h>
-#include "OgreILImageCodec.h"
-#include <OgreImage.h>
-#include <OgreException.h>
-#include "OgreILUtil.h"
-
-#include <OgreLogManager.h>
-#include <OgreStringConverter.h>
-
-#include <IL/il.h>
-#include <IL/ilu.h>
-
-namespace Ogre {
-
-    bool ILImageCodec::_is_initialised = false;    
-    //---------------------------------------------------------------------
-
-    ILImageCodec::ILImageCodec(const String &type, unsigned int ilType):
-        mType(type),
-        mIlType(ilType)
-    { 
-        initialiseIL();
-    }
-
-    //---------------------------------------------------------------------
-    DataStreamPtr ILImageCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
-    {        
-
-        OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "code to memory not implemented",
-            "ILCodec::code");
-
-
-    }
-    //---------------------------------------------------------------------
-    void ILImageCodec::codeToFile(MemoryDataStreamPtr& input, 
-        const String& outFileName, Codec::CodecDataPtr& pData) const
-    {
-
-        ILuint ImageName;
-
-        ilGenImages( 1, &ImageName );
-        ilBindImage( ImageName );
-
-		ImageData* pImgData = static_cast< ImageData * >( pData.getPointer() );
-		PixelBox src(pImgData->width, pImgData->height, pImgData->depth, pImgData->format, input->getPtr());
-
-		// Convert image from OGRE to current IL image
-		ILUtil::fromOgre(src);
-
-        iluFlipImage();
-
-        // Implicitly pick DevIL codec
-        ilSaveImage(const_cast< char * >( outFileName.c_str() ) );
-	
-        // Check if everything was ok
-        ILenum PossibleError = ilGetError() ;
-        if( PossibleError != IL_NO_ERROR ) {
-           ilDeleteImages(1, &ImageName);
-           OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
-                "IL Error, could not save file: " + outFileName,
-                iluErrorString(PossibleError) ) ;
-        }
-
-        ilDeleteImages(1, &ImageName);
-
-    }
-    //---------------------------------------------------------------------
-    Codec::DecodeResult ILImageCodec::decode(DataStreamPtr& input) const
-    {
-
-        // DevIL variables
-        ILuint ImageName;
-
-        ILint ImageFormat, BytesPerPixel, ImageType;
-        ImageData* imgData = new ImageData();
-        MemoryDataStreamPtr output;
-
-        // Load the image
-        ilGenImages( 1, &ImageName );
-        ilBindImage( ImageName );
-
-        // Put it right side up
-        ilEnable(IL_ORIGIN_SET);
-        ilSetInteger(IL_ORIGIN_MODE, IL_ORIGIN_UPPER_LEFT);
-
-        // Keep DXTC(compressed) data if present
-        ilSetInteger(IL_KEEP_DXTC_DATA, IL_TRUE);
-
-        // Load image from stream, cache into memory
-        MemoryDataStream memInput(input);
-        ilLoadL( 
-            mIlType, 
-            memInput.getPtr(), 
-            static_cast< ILuint >(memInput.size()));
-
-        // Check if everything was ok
-        ILenum PossibleError = ilGetError() ;
-        if( PossibleError != IL_NO_ERROR ) {
-            OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
-                "IL Error",
-                iluErrorString(PossibleError) ) ;
-        }
-
-        ImageFormat = ilGetInteger( IL_IMAGE_FORMAT );
-        ImageType = ilGetInteger( IL_IMAGE_TYPE );
-
-        // Convert image if ImageType is incompatible with us (double or long)
-        if(ImageType != IL_BYTE && ImageType != IL_UNSIGNED_BYTE && 
-			ImageType != IL_FLOAT &&
-			ImageType != IL_UNSIGNED_SHORT && ImageType != IL_SHORT) {
-            ilConvertImage(ImageFormat, IL_FLOAT);
-			ImageType = IL_FLOAT;
-        }
-		// Converted paletted images
-		if(ImageFormat == IL_COLOUR_INDEX)
-		{
-			ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE);
-			ImageFormat = IL_BGRA;
-			ImageType = IL_UNSIGNED_BYTE;
-		}
-
-        // Now sets some variables
-        BytesPerPixel = ilGetInteger( IL_IMAGE_BYTES_PER_PIXEL ); 
-
-        imgData->format = ILUtil::ilFormat2OgreFormat( ImageFormat, ImageType );
-        imgData->width = ilGetInteger( IL_IMAGE_WIDTH );
-        imgData->height = ilGetInteger( IL_IMAGE_HEIGHT );
-        imgData->depth = ilGetInteger( IL_IMAGE_DEPTH );
-        imgData->num_mipmaps = ilGetInteger ( IL_NUM_MIPMAPS );
-        imgData->flags = 0;
-		
-		if(imgData->format == PF_UNKNOWN)
-		{
-			std::stringstream err;
-			err << "Unsupported devil format ImageFormat=" << std::hex << ImageFormat << 
-				" ImageType="<< ImageType << std::dec;
-			ilDeleteImages( 1, &ImageName );
-			
-			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
-                err.str(),
-                "ILImageCodec::decode" ) ;
-		}
-
-        // Check for cubemap
-        //ILuint cubeflags = ilGetInteger ( IL_IMAGE_CUBEFLAGS );
-		size_t numFaces = ilGetInteger ( IL_NUM_IMAGES ) + 1;
-        if(numFaces == 6) 
-			imgData->flags |= IF_CUBEMAP;
-        else
-            numFaces = 1; // Support only 1 or 6 face images for now
-  
-        // Keep DXT data (if present at all and the GPU supports it)
-        ILuint dxtFormat = ilGetInteger( IL_DXTC_DATA_FORMAT );
-        if(dxtFormat != IL_DXT_NO_COMP && Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability( RSC_TEXTURE_COMPRESSION_DXT ))
-        {
-			imgData->format = ILUtil::ilFormat2OgreFormat( dxtFormat, ImageType );
-            imgData->flags |= IF_COMPRESSED;
-            
-            // Validate that this devil version saves DXT mipmaps
-            if(imgData->num_mipmaps>0)
-            {
-                ilBindImage(ImageName);
-                ilActiveMipmap(1);
-                if((size_t)ilGetInteger( IL_DXTC_DATA_FORMAT ) != dxtFormat)
-                {
-                    imgData->num_mipmaps=0;
-                    LogManager::getSingleton().logMessage(
-                    "Warning: Custom mipmaps for compressed image "+input->getName()+" were ignored because they are not loaded by this DevIL version");
-                }
-            }
-        }
-        
-        // Calculate total size from number of mipmaps, faces and size
-        imgData->size = Image::calculateSize(imgData->num_mipmaps, numFaces, 
-            imgData->width, imgData->height, imgData->depth, imgData->format);
-
-        // Bind output buffer
-        output.bind(new MemoryDataStream(imgData->size));
-        size_t offset = 0;
-        
-        // Dimensions of current mipmap
-        size_t width = imgData->width;
-        size_t height = imgData->height;
-        size_t depth = imgData->depth;
-        
-        // Transfer data
-        for(size_t mip=0; mip<=imgData->num_mipmaps; ++mip)
-        {   
-            for(size_t i = 0; i < numFaces; ++i)
-            {
-                ilBindImage(ImageName);
-                if(numFaces > 1)
-                    ilActiveImage(i);
-                if(imgData->num_mipmaps > 0)
-                    ilActiveMipmap(mip);
-                /// Size of this face
-                size_t imageSize = PixelUtil::getMemorySize(
-                        width, height, depth, imgData->format);
-                if(imgData->flags & IF_COMPRESSED)
-                {
-
-                    // Compare DXT size returned by DevIL with our idea of the compressed size
-                    if(imageSize == ilGetDXTCData(NULL, 0, dxtFormat))
-                    {
-                        // Retrieve data from DevIL
-                        ilGetDXTCData((unsigned char*)output->getPtr()+offset, imageSize, dxtFormat);
-                    } else
-                    {
-                        LogManager::getSingleton().logMessage(
-                            "Warning: compressed image "+input->getName()+" size mismatch, devilsize="+StringConverter::toString(ilGetDXTCData(NULL, 0, dxtFormat))+" oursize="+
-                            StringConverter::toString(imageSize));
-                    }
-                }
-                else
-                {
-                    /// Retrieve data from DevIL
-                    PixelBox dst(width, height, depth, imgData->format, (unsigned char*)output->getPtr()+offset);
-                    ILUtil::toOgre(dst);
-                }
-                offset += imageSize;
-            }
-            /// Next mip
-            if(width!=1) width /= 2;
-            if(height!=1) height /= 2;
-            if(depth!=1) depth /= 2;
-        }
-
-        // Restore IL state
-        ilDisable(IL_ORIGIN_SET);
-        ilDisable(IL_FORMAT_SET);
-
-        ilDeleteImages( 1, &ImageName );
-
-        DecodeResult ret;
-        ret.first = output;
-        ret.second = CodecDataPtr(imgData);
-
-
-        return ret;
-    }
-    //---------------------------------------------------------------------
-    void ILImageCodec::initialiseIL(void)
-    {
-        if( !_is_initialised )
-        {
-            ilInit();
-            iluInit();
-            ilEnable( IL_FILE_OVERWRITE );
-            _is_initialised = true;
-        }
-    }
-    //---------------------------------------------------------------------    
-    String ILImageCodec::getType() const 
-    {
-        return mType;
-    }
-
-    //---------------------------------------------------------------------
-    String ILImageCodec::magicNumberToFileExt(const char *magicNumberPtr, size_t maxbytes) const
-    {
-	// DevIL uses magic internally to determine file types when
-	// necessary but does not expose the code in its API.
-	// This makes it difficult to implement this function, but also
-	// reduces its importance. Just for now, here is a kludge to 
-	// get Ogre to build and ensure that it always tries to load files
-	// that DevIL might be able to load.
-	return String("jpg");
-    }
-}

OgreMain/src/OgreILUtil.cpp

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2012 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <OgreStableHeaders.h>
-#include "OgreILUtil.h"
-#include <OgrePixelFormat.h>
-#include <OgreBitwise.h>
-#include <OgreColourValue.h>
-#include <OgreException.h>
-
-#include <IL/il.h>
-#include <IL/ilu.h>
-   
-namespace Ogre {
-	
-	/*************************************************************************
-    * IL specific functions
-    */
-    PixelFormat ILUtil::ilFormat2OgreFormat( int ImageFormat, int ImageType ) 
-	{
-        PixelFormat fmt = PF_UNKNOWN;
-        switch( ImageFormat )
-        {
-		/* Compressed formats -- ignore type */
-		case IL_DXT1:   fmt = PF_DXT1; break;
-		case IL_DXT2:   fmt = PF_DXT2; break;
-		case IL_DXT3:   fmt = PF_DXT3; break;
-		case IL_DXT4:   fmt = PF_DXT4; break;
-		case IL_DXT5:   fmt = PF_DXT5; break;
-		/* Normal formats */
-        case IL_RGB:
-			switch(ImageType)
-            {
-			case IL_FLOAT:  fmt = PF_FLOAT32_RGB; break;
-			case IL_UNSIGNED_SHORT: 
-			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
-			default:       	fmt = PF_BYTE_RGB; break;
-			}
-            break;
-        case IL_BGR:
-			switch(ImageType)
-            {
-			case IL_FLOAT:  fmt = PF_FLOAT32_RGB; break;
-			case IL_UNSIGNED_SHORT: 
-			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
-			default:       	fmt = PF_BYTE_BGR; break;
-			}
-            break;            
-        case IL_RGBA:
-			switch(ImageType)
-            {
-			case IL_FLOAT:  fmt = PF_FLOAT32_RGBA; break;
-			case IL_UNSIGNED_SHORT: 
-			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
-			default:       	fmt = PF_BYTE_RGBA; break;
-			}
-            break;
-        case IL_BGRA:
-			switch(ImageType)
-            {
-			case IL_FLOAT:  fmt = PF_FLOAT32_RGBA; break;
-			case IL_UNSIGNED_SHORT: 
-			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
-			default:       	fmt = PF_BYTE_BGRA; break;
-			}
-            break;
-        case IL_LUMINANCE:
-            switch(ImageType)
-            {
-            case IL_BYTE:
-            case IL_UNSIGNED_BYTE:
-                fmt = PF_L8;
-                break;
-            default:
-                fmt = PF_L16;
-            }
-            break;            
-        case IL_LUMINANCE_ALPHA:
-			fmt = PF_BYTE_LA;
-            break;
-        }  
-        return fmt;
-    }
-
-    //-----------------------------------------------------------------------
-
-    ILUtil::ILFormat ILUtil::OgreFormat2ilFormat( PixelFormat format )
-    {
-		switch(format) {
-            case PF_BYTE_L: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_BYTE);
-			case PF_BYTE_A: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_BYTE);
-			case PF_SHORT_L: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_SHORT);
-			case PF_BYTE_LA: return ILFormat(2, IL_LUMINANCE_ALPHA, IL_UNSIGNED_BYTE);
-			case PF_BYTE_RGB: return ILFormat(3, IL_RGB, IL_UNSIGNED_BYTE);
-			case PF_BYTE_RGBA: return ILFormat(4, IL_RGBA, IL_UNSIGNED_BYTE);
-            case PF_BYTE_BGR: return ILFormat(3, IL_BGR, IL_UNSIGNED_BYTE);
-            case PF_BYTE_BGRA: return ILFormat(4, IL_BGRA, IL_UNSIGNED_BYTE);
-			case PF_SHORT_RGBA: return ILFormat(4, IL_RGBA, IL_UNSIGNED_SHORT);
-			case PF_FLOAT32_RGB: return ILFormat(3, IL_RGB, IL_FLOAT);
-			case PF_FLOAT32_RGBA: return ILFormat(4, IL_RGBA, IL_FLOAT);
-			case PF_DXT1: return ILFormat(0, IL_DXT1);
-			case PF_DXT2: return ILFormat(0, IL_DXT2);
-			case PF_DXT3: return ILFormat(0, IL_DXT3);
-			case PF_DXT4: return ILFormat(0, IL_DXT4);
-			case PF_DXT5: return ILFormat(0, IL_DXT5);
-			default: return ILFormat();
-		}
-	}
-
-    //-----------------------------------------------------------------------
-	/// Helper functions for DevIL to Ogre conversion
-	inline void packI(uint8 r, uint8 g, uint8 b, uint8 a, PixelFormat pf,  void* dest)
-	{
-		PixelUtil::packColour(r, g, b, a, pf, dest);
-	}
-	inline void packI(uint16 r, uint16 g, uint16 b, uint16 a, PixelFormat pf,  void* dest)
-	{
-		PixelUtil::packColour((float)r/65535.0f, (float)g/65535.0f, 
-			(float)b/65535.0f, (float)a/65535.0f, pf, dest);
-	}
-	inline void packI(float r, float g, float b, float a, PixelFormat pf,  void* dest)
-	{
-		PixelUtil::packColour(r, g, b, a, pf, dest);
-	}
-    template <typename T> void ilToOgreInternal(uint8 *tar, PixelFormat ogrefmt, 
-        T r, T g, T b, T a)
-    {
-        const int ilfmt = ilGetInteger( IL_IMAGE_FORMAT );
-        T *src = (T*)ilGetData();
-        T *srcend = (T*)((uint8*)ilGetData() + ilGetInteger( IL_IMAGE_SIZE_OF_DATA ));
-        const size_t elemSize = PixelUtil::getNumElemBytes(ogrefmt);
-        while(src < srcend) {
-            switch(ilfmt) {
-			case IL_RGB:
-				r = src[0];	g = src[1];	b = src[2];
-				src += 3;
-				break;
-			case IL_BGR:
-				b = src[0];	g = src[1];	r = src[2];
-				src += 3;
-				break;
-			case IL_LUMINANCE:
-				r = src[0];	g = src[0];	b = src[0];
-				src += 1;
-				break;
-			case IL_LUMINANCE_ALPHA:
-				r = src[0];	g = src[0];	b = src[0];	a = src[1];
-				src += 2;
-				break;
-			case IL_RGBA:
-				r = src[0];	g = src[1];	b = src[2];	a = src[3];
-				src += 4;
-				break;
-			case IL_BGRA:
-				b = src[0];	g = src[1];	r = src[2];	a = src[3];
-				src += 4;
-				break;
-			default:
-				return;
-            }
-            packI(r, g, b, a, ogrefmt, tar);
-            tar += elemSize;
-        }
-
-    }   
-    //----------------------------------------------------------------------- 
-	/// Utility function to convert IL data types to UNSIGNED_
-	ILenum ILabs(ILenum in) {
-		switch(in) {
-		case IL_INT: return IL_UNSIGNED_INT;
-		case IL_BYTE: return IL_UNSIGNED_BYTE;
-		case IL_SHORT: return IL_UNSIGNED_SHORT;
-		default: return in;
-		}
-	}
-    //-----------------------------------------------------------------------
-    void ILUtil::toOgre(const PixelBox &dst) 
-    {
-		if(!dst.isConsecutive())
-			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
-                "Destination must currently be consecutive",
-                "ILUtil::ilToOgre" ) ;
-		if(dst.getWidth() != static_cast<size_t>(ilGetInteger( IL_IMAGE_WIDTH )) ||
-        	dst.getHeight() != static_cast<size_t>(ilGetInteger( IL_IMAGE_HEIGHT )) ||
-        	dst.getDepth() != static_cast<size_t>(ilGetInteger( IL_IMAGE_DEPTH )))
-			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
-                "Destination dimensions must equal IL dimension",
-                "ILUtil::ilToOgre" ) ;
-        
-        int ilfmt = ilGetInteger( IL_IMAGE_FORMAT );
-        int iltp = ilGetInteger( IL_IMAGE_TYPE );
-
-		// Check if in-memory format just matches
-		// If yes, we can just copy it and save conversion
-		ILFormat ifmt = OgreFormat2ilFormat( dst.format );
-		if(ifmt.format == ilfmt && ILabs(ifmt.type) == ILabs(iltp)) {
-            memcpy(dst.data, ilGetData(), ilGetInteger( IL_IMAGE_SIZE_OF_DATA )); 
-            return;
-        }
-		// Try if buffer is in a known OGRE format so we can use OGRE its
-		// conversion routines
-		PixelFormat bufFmt = ilFormat2OgreFormat((int)ilfmt, (int)iltp);
-		
-		ifmt = OgreFormat2ilFormat( bufFmt );
-		if(ifmt.format == ilfmt && ILabs(ifmt.type) == ILabs(iltp))
-		{
-			// IL format matches another OGRE format
-			PixelBox src(dst.getWidth(), dst.getHeight(), dst.getDepth(), bufFmt, ilGetData());
-			PixelUtil::bulkPixelConversion(src, dst);
-			return;
-		}
-		
-        // Thee extremely slow method
-        if(iltp == IL_UNSIGNED_BYTE || iltp == IL_BYTE) 
-        {
-            ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, (uint8)0x00,(uint8)0x00,(uint8)0x00,(uint8)0xFF);
-        } 
-        else if(iltp == IL_FLOAT)
-        {
-            ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, 0.0f,0.0f,0.0f,1.0f);          
-        }
-		else if(iltp == IL_SHORT || iltp == IL_UNSIGNED_SHORT)
-        {
-			ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, 
-				(uint16)0x0000,(uint16)0x0000,(uint16)0x0000,(uint16)0xFFFF); 
-        }
-        else 
-        {
-            OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
-                "Cannot convert this DevIL type",
-                "ILUtil::ilToOgre" ) ;
-        }
-    }
-    //-----------------------------------------------------------------------
-    void ILUtil::fromOgre(const PixelBox &src)
-    {
-		// ilTexImage http://openil.sourceforge.net/docs/il/f00059.htm
-		ILFormat ifmt = OgreFormat2ilFormat( src.format );
-		if(src.isConsecutive() && ifmt.isValid()) 
-		{
-			// The easy case, the buffer is laid out in memory just like 
-			// we want it to be and is in a format DevIL can understand directly
-			// We could even save the copy if DevIL would let us
-			ilTexImage(static_cast<ILuint>(src.getWidth()), 
-				static_cast<ILuint>(src.getHeight()), 
-				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
-				ifmt.format, ifmt.type, src.data);
-		} 
-		else if(ifmt.isValid()) 
-		{
-			// The format can be understood directly by DevIL. The only 
-			// problem is that ilTexImage expects our image data consecutively 
-			// so we cannot use that directly.
-			
-			// Let DevIL allocate the memory for us, and copy the data consecutively
-			// to its memory
-			ilTexImage(static_cast<ILuint>(src.getWidth()), 
-				static_cast<ILuint>(src.getHeight()), 
-				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
-				ifmt.format, ifmt.type, 0);
-			PixelBox dst(src.getWidth(), src.getHeight(), src.getDepth(), src.format, ilGetData());
-			PixelUtil::bulkPixelConversion(src, dst);
-		} 
-		else 
-		{
-			// Here it gets ugly. We're stuck with a pixel format that DevIL
-			// can't do anything with. We will do a bulk pixel conversion and
-			// then feed it to DevIL anyway. The problem is finding the best
-			// format to convert to.
-			
-			// most general format supported by OGRE and DevIL
-			PixelFormat fmt = PixelUtil::hasAlpha(src.format)?PF_FLOAT32_RGBA:PF_FLOAT32_RGB; 
-
-			// Make up a pixel format
-			// We don't have to consider luminance formats as they have
-			// straight conversions to DevIL, just weird permutations of RGBA an LA
-			int depths[4];
-			PixelUtil::getBitDepths(src.format, depths);
-			
-			// Native endian format with all bit depths<8 can safely and quickly be 
-			// converted to 24/32 bit
-			if(PixelUtil::isNativeEndian(src.format) && 
-				depths[0]<=8 && depths[1]<=8 && depths[2]<=8 && depths[3]<=8) {
-				if(PixelUtil::hasAlpha(src.format)) {
-					fmt = PF_A8R8G8B8;
-				} else {
-					fmt = PF_R8G8B8;
-				}
-			}
-			
-			// Let DevIL allocate the memory for us, then do the conversion ourselves
-			ifmt = OgreFormat2ilFormat( fmt );
-			ilTexImage(static_cast<ILuint>(src.getWidth()), 
-				static_cast<ILuint>(src.getHeight()), 
-				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
-				ifmt.format, ifmt.type, 0);
-			PixelBox dst(src.getWidth(), src.getHeight(), src.getDepth(), fmt, ilGetData());
-			PixelUtil::bulkPixelConversion(src, dst);
-		}
-    }
-
-}

OgreMain/src/OgreRoot.cpp

 #if OGRE_NO_FREEIMAGE == 0
 #include "OgreFreeImageCodec.h"
 #endif
-#if OGRE_NO_DEVIL == 0
-#include "OgreILCodecs.h"
-#endif
 #if OGRE_NO_DDS_CODEC == 0
 #include "OgreDDSCodec.h"
 #endif
 		// Register image codecs
 		FreeImageCodec::startup();
 #endif
-#if OGRE_NO_DEVIL == 0
-	    // Register image codecs
-	    ILCodecs::registerCodecs();
-#endif
 #if OGRE_NO_PVRTC_CODEC == 0
         PVRTCCodec::startup();
 #endif
 #if OGRE_NO_FREEIMAGE == 0
 		FreeImageCodec::shutdown();
 #endif
-#if OGRE_NO_DEVIL == 0
-        ILCodecs::deleteCodecs();
-#endif
 #if OGRE_NO_DDS_CODEC == 0
 		DDSCodec::shutdown();
 #endif

RenderSystems/GL/src/OgreGLHardwarePixelBuffer.cpp

 		src.getHeight() != dstBox.getHeight() ||
 		src.getDepth() != dstBox.getDepth())
 	{
-		// Scale to destination size. Use DevIL and not iluScale because ILU screws up for 
-		// floating point textures and cannot cope with 3D images.
+		// Scale to destination size.
 		// This also does pixel format conversion if needed
 		allocateBuffer();
 		scaled = mBuffer.getSubVolume(dstBox);

RenderSystems/GLES/src/OgreGLESHardwarePixelBuffer.cpp

             src.getHeight() != dstBox.getHeight() ||
             src.getDepth() != dstBox.getDepth())
         {
-            // Scale to destination size. Use DevIL and not iluScale because ILU screws up for 
-            // floating point textures and cannot cope with 3D images.
+            // Scale to destination size.
             // This also does pixel format conversion if needed
             allocateBuffer();
             scaled = mBuffer.getSubVolume(dstBox);

RenderSystems/GLES2/src/OgreGLES2HardwarePixelBuffer.cpp

             src.getHeight() != dstBox.getHeight() ||
             src.getDepth() != dstBox.getDepth())
         {
-            // Scale to destination size. Use DevIL and not iluScale because ILU screws up for 
-            // floating point textures and cannot cope with 3D images.
+            // Scale to destination size.
             // This also does pixel format conversion if needed
             allocateBuffer();
             scaled = mBuffer.getSubVolume(dstBox);