Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit f3fbef22 authored by Jakob Weiss's avatar Jakob Weiss

Rebuilt DevIL with manually patched version

* Based on DevIL 1.8.0, built with libjpeg 9.1, libpng 1.6.69, libsquish 1.15, libtiff 5.2.5, openexr 2.2.0, zlib 1.2.11
* Manual patch fixes problem with paletted BMPs (see https://github.com/DentonW/DevIL/issues/56)
* DevIL only built for win64, win32 is considered deprecated as of right now :)
parent 0034e5c4
......@@ -19,19 +19,7 @@ IF(${ModuleEnabled})
LIST(APPEND CampvisGlobalIncludeDirs "${ThisModDir}/ext/devil/include")
IF(CAMPVIS_WIN32)
LIST(APPEND CampvisGlobalExternalLibs
"${ThisModDir}/ext/devil/lib/win32/DevIL.lib"
"${ThisModDir}/ext/devil/lib/win32/ILU.lib"
)
LIST(APPEND CampvisExternalDllsDebug
"${ThisModDir}/ext/devil/lib/win32/DevIL.dll"
"${ThisModDir}/ext/devil/lib/win32/ILU.dll"
)
LIST(APPEND CampvisExternalDllsRelease
"${ThisModDir}/ext/devil/lib/win32/DevIL.dll"
"${ThisModDir}/ext/devil/lib/win32/ILU.dll"
)
MESSAGE(WARNING "32 Bit Version of patched DevIL is no longer distributed. Build DevIL manually or better, switch to a 64 bit build!")
ELSEIF(CAMPVIS_WIN64)
LIST(APPEND CampvisGlobalExternalLibs
"${ThisModDir}/ext/devil/lib/win64/DevIL.lib"
......@@ -39,12 +27,12 @@ IF(${ModuleEnabled})
)
LIST(APPEND CampvisExternalDllsDebug
"${ThisModDir}/ext/devil/lib/win64/DevIL.dll"
"${ThisModDir}/ext/devil/lib/win64/ILU.dll"
"${ThisModDir}/ext/devil/bin/win64/DevIL.dll"
"${ThisModDir}/ext/devil/bin/win64/ILU.dll"
)
LIST(APPEND CampvisExternalDllsRelease
"${ThisModDir}/ext/devil/lib/win64/DevIL.dll"
"${ThisModDir}/ext/devil/lib/win64/ILU.dll"
"${ThisModDir}/ext/devil/bin/win64/DevIL.dll"
"${ThisModDir}/ext/devil/bin/win64/ILU.dll"
)
ENDIF()
......
%module DevIL
%{
#include "il.h"
#include "ilu.h"
#include "ilut.h"
//#include "ilu_region.h"
%}
%include "il.h"
%include "ilu.h"
%include "ilut.h"
//%include "ilu_region.h"
IL_INCLUDE_PATH="/usr/include"
IL_LIB_PATH="/usr/lib"
LUA_INCLUDE_PATH="/usr/include/lua5.1"
LUA_LIB_PATH="/usr/lib"
OSX=no
echo "Building the lua binding!"
export SWIG_FEATURES="-I$IL_INCLUDE_PATH"
swig -lua DevIL.i
if [ $? -ne 0 ] ; then
echo "swig Failed to build the lua interface"
exit 1
fi
compile() {
gcc luadevil.c "$1" -o luadevil "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT -llua5.1 &>/dev/null
err=$?
if [ "$OSX" = "no" ] ; then
gcc -shared "$1" -o DevIL.so "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT &>/dev/null
else
gcc -bundle -undefined dynamic_lookup "$1" -o DevIL.so "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT &>/dev/null
fi
return $err
}
compile DevIL_wrap.c
if [ $? -ne 0 ] ; then
echo 'Failed compilation'
echo 'On some platform the file malloc.h is not present and produces a compilation error'
echo -n 'it can be removed safely, try [y/n] ? '
while read i ; do
if [ "$i" = "y" ] ; then
sed 's/\#include\ \<malloc\.h\>//' < DevIL_wrap.c > DevIL_wrap.mod.c
compile "DevIL_wrap.mod.c"
if [ $? -ne 0 ] ; then
echo 'still failing...'
exit 2
fi
exit 0
elif [ "$i" = "n" ] ; then
echo 'ok, failing...'
exit 3
else
echo 'Unknown command [y/n] ? '
fi
done
fi
echo "ok!"
exit 0
#! /bin/bash
IL_INCLUDE_PATH="/usr/local/include"
IL_LIB_PATH="/usr/local/lib"
PYTHON_INCLUDE_PATH="/usr/include/python2.5"
swig "-I$IL_INCLUDE_PATH" -python -interface DevIL DevIL.i
if [ $? -ne 0 ] ; then
echo Error while building the swig interface
exit 1
fi
gcc -shared "-I$IL_INCLUDE_PATH" "-I$PYTHON_INCLUDE_PATH" "-L$IL_LIB_PATH" -lIL -lILU -lILUT DevIL_wrap.c -o DevIL.so
if [ $? -ne 0 ] ; then
echo Error while compiling the python module
fi
echo "DevIL.py and DevIL.so are ready"
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 01/06/2009
//
// Filename: IL/devil_internal_exports.h
//
// Description: Internal stuff for DevIL (IL, ILU and ILUT)
//
//-----------------------------------------------------------------------------
#ifndef IL_EXPORTS_H
#define IL_EXPORTS_H
#include "IL/il.h"
#ifdef DEBUG
#include <assert.h>
#else
#define assert(x)
#endif
#ifdef NOINLINE
// No inlining. Treat all inline funcs as static.
// Functions will be replicated in all translation units
// use them.
#define STATIC_INLINE static
#else
#if defined(_MSC_VER) && !defined(__cplusplus)
// MSVC compiler uses __inline when compiling C (not C++)
#define STATIC_INLINE static __inline
#else
// Portable across C99, GNU89, C++...
#define STATIC_INLINE static inline
#endif
#endif // NOINLINE
#ifdef __cplusplus
extern "C" {
#endif
#define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
//! Basic Palette struct
typedef struct ILpal
{
ILubyte* Palette; //!< the image palette (if any)
ILuint PalSize; //!< size of the palette (in bytes)
ILenum PalType; //!< the palette types in il.h (0x0500 range)
} ILpal;
//! The Fundamental Image structure
/*! Every bit of information about an image is stored in this internal structure.*/
typedef struct ILimage
{
ILuint Width; //!< the image's width
ILuint Height; //!< the image's height
ILuint Depth; //!< the image's depth
ILubyte Bpp; //!< bytes per pixel (now number of channels)
ILubyte Bpc; //!< bytes per channel
ILuint Bps; //!< bytes per scanline (components for IL)
ILubyte* Data; //!< the image data
ILuint SizeOfData; //!< the total size of the data (in bytes)
ILuint SizeOfPlane; //!< SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
ILenum Format; //!< image format (in IL enum style)
ILenum Type; //!< image type (in IL enum style)
ILenum Origin; //!< origin of the image
ILpal Pal; //!< palette details
ILuint Duration; //!< length of the time to display this "frame"
ILenum CubeFlags; //!< cube map flags for sides present in chain
struct ILimage* Mipmaps; //!< mipmapped versions of this image terminated by a NULL - usu. NULL
struct ILimage* Next; //!< next image in the chain - usu. NULL
struct ILimage* Faces; //!< next cubemap face in the chain - usu. NULL
struct ILimage* Layers; //!< subsequent layers in the chain - usu. NULL
ILuint* AnimList; //!< animation list
ILuint AnimSize; //!< animation list size
void* Profile; //!< colour profile
ILuint ProfileSize; //!< colour profile size
ILuint OffX; //!< x-offset of the image
ILuint OffY; //!< y-offset of the image
ILubyte* DxtcData; //!< compressed data
ILenum DxtcFormat; //!< compressed data format
ILuint DxtcSize; //!< compressed data size
} ILimage;
// Memory functions
ILAPI void* ILAPIENTRY ialloc(const ILsizei Size);
ILAPI void ILAPIENTRY ifree(const void *Ptr);
ILAPI void* ILAPIENTRY icalloc(const ILsizei Size, const ILsizei Num);
#ifdef ALTIVEC_GCC
ILAPI void* ILAPIENTRY ivec_align_buffer(void *buffer, const ILuint size);
#endif
// Internal library functions in IL
ILAPI ILimage* ILAPIENTRY ilGetCurImage(void);
ILAPI void ILAPIENTRY ilSetCurImage(ILimage *Image);
ILAPI void ILAPIENTRY ilSetError(ILenum Error);
ILAPI void ILAPIENTRY ilSetPal(ILpal *Pal);
//
// Utility functions
//
ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
ILAPI ILenum ILAPIENTRY ilGetFormatBpp(ILubyte Bpp);
ILAPI ILubyte ILAPIENTRY ilGetBpcType(ILenum Type);
ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI void ILAPIENTRY ilReplaceCurImage(ILimage *Image);
ILAPI void ILAPIENTRY iMemSwap(ILubyte *, ILubyte *, const ILuint);
//
// Image functions
//
ILAPI void ILAPIENTRY iBindImageTemp (void);
ILAPI ILboolean ILAPIENTRY ilClearImage_ (ILimage *Image);
ILAPI void ILAPIENTRY ilCloseImage (ILimage *Image);
ILAPI void ILAPIENTRY ilClosePal (ILpal *Palette);
ILAPI ILpal* ILAPIENTRY iCopyPal (void);
ILAPI ILboolean ILAPIENTRY ilCopyImageAttr (ILimage *Dest, ILimage *Src);
ILAPI ILimage* ILAPIENTRY ilCopyImage_ (ILimage *Src);
ILAPI void ILAPIENTRY ilGetClear (void *Colours, ILenum Format, ILenum Type);
ILAPI ILuint ILAPIENTRY ilGetCurName (void);
ILAPI ILboolean ILAPIENTRY ilIsValidPal (ILpal *Palette);
ILAPI ILimage* ILAPIENTRY ilNewImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILimage* ILAPIENTRY ilNewImageFull (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilInitImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilResizeImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILboolean ILAPIENTRY ilTexImage_ (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexImageSurface_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexSubImage_ (ILimage *Image, void *Data);
ILAPI void* ILAPIENTRY ilConvertBuffer (ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILpal *SrcPal, void *Buffer);
ILAPI ILimage* ILAPIENTRY iConvertImage (ILimage *Image, ILenum DestFormat, ILenum DestType);
ILAPI ILpal* ILAPIENTRY iConvertPal (ILpal *Pal, ILenum DestFormat);
ILAPI ILubyte* ILAPIENTRY iGetFlipped (ILimage *Image);
ILAPI ILboolean ILAPIENTRY iMirror();
ILAPI void ILAPIENTRY iFlipBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
ILubyte* iFlipNewBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
ILAPI void ILAPIENTRY iGetIntegervImage(ILimage *Image, ILenum Mode, ILint *Param);
// Internal library functions in ILU
ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
#ifdef __cplusplus
}
#endif
#endif//IL_EXPORTS_H
......@@ -242,6 +242,7 @@ typedef long long unsigned int ILuint64;
#define IL_UTX 0x0451 //!< Unreal (and Unreal Tournament) Texture - .utx extension
#define IL_MP3 0x0452 //!< MPEG-1 Audio Layer 3 - .mp3 extension
#define IL_KTX 0x0453 //!< Khronos Texture - .ktx extension
#define IL_SCITEX 0x0454 //!< Scitex Continuous Tone - .ch, .ct, and .sct extensions
#define IL_JASC_PAL 0x0475 //!< PaintShop Pro Palette
......
#ifndef __ILUT_CONFIG_H__
#define __ILUT_CONFIG_H__
//#define IL_USE_PRAGMA_LIBS
// Supported APIs (ILUT)
//
// sorry just
// cant get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#undef ILUT_USE_DIRECTX8
//#define ILUT_USE_DIRECTX9
//#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL
//#define ILUT_USE_SDL
#define ILUT_USE_WIN32
#endif//__ILUT_CONFIG_H__
This diff is collapsed.
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