Page 1 of 1

Building against Irrlicht 1.6 (SVN) [Patch included]

Posted: Thu Aug 13, 2009 13:41
by egrath
Hello,
with the current Release, CEGUI can only be compiled against Irrlicht 1.4 which is a rather old version.

diff for RenderModules/IrrlichtRenderer:

Code: Select all

diff -r /home/er/tmp/cegui/x/CEGUI-0.6.2/RendererModules/IrrlichtRenderer/IrrlichtMemoryFile.cpp IrrlichtRenderer/IrrlichtMemoryFile.cpp
35,36c35
<  : d_filename(filename),
<    d_buffer(memory),
---
>    : d_buffer(memory),
39a39
>     d_filename = irr::core::string<irr::c16>( filename.c_str() );
42d41
< #if CEGUI_IRR_SDK_VERSION >= 13
44,46d42
< #else
< irr::s32 IrrlichtMemoryFile::read(void* buffer, irr::s32 sizeToRead)
< #endif
57d52
< #if CEGUI_IRR_SDK_VERSION >= 14
59,61d53
< #else
< bool IrrlichtMemoryFile::seek(irr::s32 finalPos, bool relativeMovement)
< #endif
77d68
< #if CEGUI_IRR_SDK_VERSION >= 14
79,81d69
< #else
< irr::s32 IrrlichtMemoryFile::getSize()
< #endif
86d73
< #if CEGUI_IRR_SDK_VERSION >= 14
88,90d74
< #else
< irr::s32 IrrlichtMemoryFile::getPos()
< #endif
95,99c79
< #if CEGUI_IRR_SDK_VERSION >= 14
< const irr::c8* IrrlichtMemoryFile::getFileName() const
< #else
< const irr::c8* IrrlichtMemoryFile::getFileName()
< #endif
---
> const irr::core::string<irr::c16> & IrrlichtMemoryFile::getFileName() const
101c81
<     return d_filename.c_str();
---
>     return d_filename;
diff -r /home/er/tmp/cegui/x/CEGUI-0.6.2/RendererModules/IrrlichtRenderer/IrrlichtMemoryFile.h IrrlichtRenderer/IrrlichtMemoryFile.h
50,66c50,54
< #if CEGUI_IRR_SDK_VERSION == 14
<     virtual bool seek(long finalPos, bool relativeMovement = false);
<     virtual irr::s32 read(void* buffer, irr::u32 sizeToRead);
<     virtual long getSize() const;
<     virtual long getPos() const;
<     virtual const irr::c8* getFileName() const;
< #else
<     #if CEGUI_IRR_SDK_VERSION == 13
<         virtual irr::s32 read(void* buffer, irr::u32 sizeToRead);
<     #else
<         virtual irr::s32 read(void* buffer, irr::s32 sizeToRead);
<     #endif
<     virtual bool seek(irr::s32 finalPos, bool relativeMovement = false);
<     virtual irr::s32 getSize();
<     virtual irr::s32 getPos();
<     virtual const irr::c8* getFileName();
< #endif
---
>    virtual bool seek(long finalPos, bool relativeMovement = false);
>    virtual irr::s32 read(void* buffer, irr::u32 sizeToRead);
>    virtual long getSize() const;
>    virtual long getPos() const;
>    virtual const irr::core::string<irr::c16> & getFileName() const;
69c57
<     String d_filename;
---
>     irr::core::string<irr::c16> d_filename;
diff -r /home/er/tmp/cegui/x/CEGUI-0.6.2/RendererModules/IrrlichtRenderer/irrlichttexture.cpp IrrlichtRenderer/irrlichttexture.cpp
56c56
<         irr::core::dimension2d<irr::s32> texSz(size, size);
---
>         irr::core::dimension2d<irr::u32> texSz(size, size);
142c142
<       irr::core::dimension2d<irr::s32> dim(buffWidth,buffHeight);
---
>       irr::core::dimension2d<irr::u32> dim(buffWidth,buffHeight);
167c167
<          irr::core::dimension2d<irr::s32> d=tex->getSize();
---
>          irr::core::dimension2d<irr::u32> d=tex->getSize();


Diff for Samples:

Code: Select all

diff -r /home/er/tmp/cegui/x/CEGUI-0.6.2/Samples/common/src/CEGuiIrrlichtBaseApplication.cpp common/src/CEGuiIrrlichtBaseApplication.cpp
53c53
<     d_device = irr::createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600), 32, false, true, false, this);
---
>     d_device = irr::createDevice(video::EDT_OPENGL, core::dimension2d<u32>(800, 600), 32, false, true, false, this);
197c197
<     irr::core::dimension2d<irr::s32> cur_size = d_driver->getScreenSize();
---
>     irr::core::dimension2d<irr::u32> cur_size = d_driver->getScreenSize();


In the above patch, support for 1.4 has been dropped. If you intend to apply this patch to trunk, please make also sure that the configure script recognizes recent Irrlicht Releases (not included in this patch). These patches can be applied against 0.6.2.

Egon

Re: Building against Irrlicht 1.6 (SVN) [Patch included]

Posted: Fri Aug 14, 2009 10:38
by CrazyEddie
Hi, thanks for the patch (unified format would have been better - but since we do not have that preference clearly displayed anywhere, I guess I can't grumble too much) :P

The unmodified code will actually compile with the latest Irrlicht release (1.5.1), so we're not quite that out of date. The fact that 1.4 is mentioned in the configuration, whereas 1.5 is not, is mainly due to there being no additional breaking interface changes between 1.4 and 1.5, so no additional config was required.

I've not actually tried the Irrlicht SVN code as yet (but need to before 0.7.0 is released, for different reasons), so the patch will almost certainly be useful in this case. I think we'll need to continue to also support 1.5.x since that's the latest code that's actually released :)

I should be able to get these updates in this weekend... probably...

CE.