Some patches to fix or enhance Irrlicht 0.11
Irrlicht is an open-source
3D engine. Since there is no CVS support, yet, enhancements and bug fixes
have to be maintained by other means while the next release is prepared by
the Irrlicht developer. This web page provides a number of patches which allow
to easily change the source code of Irrlicht. If there are reasons to revert
these changes, it is usually possible by reverse application of the patch. Thus,
new features can be safely applied and tested.
What's a patch?
Patches contain code changes in such a way that these changes can be
automatically applied to a source tree. Thus, if you want to add some fix
available as a patch you just apply this patch to your sources. You don't have
to edit every file on your own and copy-and-paste from some website.
In order to apply a patch you need a source tree similar to that one of the
patch's author. This usually means you should have the same release, but in some
cases it might be the case that patches depend on others. The patches on this
page are created upon Irrlicht version 0.11.
To apply a patch follow these steps.
- Download the patch
- Change into the Irrlicht source tree, i.e. the directory called Irrlicht
where lots of *.cpp files are located.
- Execute the following command patch -p1 < patchfile
The patch command reads the patchfile and applies the changes to all files
mentioned within. Since the name of the source directory might be different
from that of the patch's author the patch is applied from within the source
directory and the first element of each file path is removed by the command
line option -p1. If you want to remove the patch again you may add
the option -R to the command line.
If some errors are encountered during patching a backup file with extension
.orig is created. This is also the case if only some warning has
been issued due to a different location of the changes. In cases where the
patch programme could not determine the correct location to apply the changes
an error is issued and another file with extension .rej is created.
This file contains all changes which could not be applied to the file.
To create a new patch based on your own modification you should do the
following. Please note that you have to keep another source tree containing
the original sources.
- Edit the code and check that it is compilable
- Change to the parent directory
- Execute diff -Naur originalSourceDir changedSourceDir > newPatchFile
Since the patch would contain all changes from all files already contained in
previous patches you have to keep your original sources on the same patch level
like your working directory. If you want to remove some parts of the patch
you should only remove complete blocks which begin with @@ otherwise
your patch might be broken.
The patch tool is also available for Windows command line. Check out
The Gnuwin32 project.
Please note the warning on that page that patches need the additonal
command line parameter --binary. This is due to the different line
end marker used on the different platforms. You may as well use
Cygwin which will bring a lot of other
useful tools, too ;-) Though, you also have to use --binary there.
Origins of the patches
Some of the changes have been extracted from the latest release of
Irrlicht-Spintz which contains some
of the bug fixes posted in the Irrlicht forums. I diff'ed the sources against
Irrlicht 0.8 and ported all patches to Irrlicht 0.11.
Some of the larger patches were developed by myself. Previous versions were
also posted to the forums or send directly to Niko. I removed the stuff which
is now part of Irrlicht 0.11 such that all patches should work again.
Another source of patches is the enhanced Irrlicht engine of
IrrlichtNX. Unfortunately, this
engine already changed lots of basic things which makes extracting working
patches rather difficult.
The patches
Here are the patch files and a short description for each of them. I reordered
them, mainly based on their effects.
Bug fixes
- my3d-16.patch Bring My3D Loader to latest version 3.16 (by ZDimitor)
- my3d-material.patch Additional material changes by ZDimitor, no D3D9 yet
- OpenGLLightmapAlpha.patchFix for OpenGL driver where Lightmap materials disappear in conjunction with transparent vertices, posted by ZDimitor.
- OpenGLARB2.patch Untested patch to fix the Linux OpenGL_ARB problem and add shader program support. First version had some ifdef's unchanged, fixed in version 2.
- LinuxKeyboard.patchFixed some problems of the Linux keyboard events. Now many keys are working, some strange garbage characters are not printed anymore. Tested with GUIEditBox. No real Unicode support yet, although some parts have been included already.
- irrString.patchMake string from float.
Feature enhancements
- arrayOps.patchAllows to access an array as a matrix. Simple helper function needed by Katoun's water node.
- KatounWater.patchUpdates the WaterSceneNode to new one posted by katoun. Does not look that good anymore with Irrlicht 0.11, though.
- LinuxDevice.patch Adds support for XShmem under Linux which should improve performance of the software renderer. Also adds support for 24bit and 32bit visuals. Support for XDBE extension is included but disabled (Double buffer support under X). A new compilation options lets you disable the XF86 extensions if compiling on a system without XFree86.
- LinuxDeviceUpdate.patchSome additions to the Linux Device, primarily on creating the XWindow, and fixing some problems from my earlier patches which have to be installed. Includes also some ideas from NX.
- OpenGLExtension.patch Changes the way availability of OpenGL extensions is checked. Second version to honor the need for whitespace after the string to avoid wrong recognition.
- particle.patch Particle animation enhanced
- rdtarga.patch An enhancement to libjpeg which becomes necessary if libjpeg is used for Targa support
- SetParticleSpeed.patchAdds method SetParticlesPerSecond to Particle emitters. This method allows to stop particle emitters, or set the min and max speed of them.
- TrueTypeFont.patchAdds support for TrueType fonts posted by zgock. You have to add new file CGUITTFont to your project file/Makefile.
- floatFPS.patch Changes frames per second interface to using floats
- GUILoadBar.patch Adds LoadBar to set of GUI elements. You have to add new file CGUILoadBar to your project file/Makefile.
- beginScene.patch Call beginScene without parameters and get/set attributes instead.
Optimizations
- collision.patch Small optimization for SceneCollisionManager
- loopOpt2.patch Adds support for memset and memcpy to some loops and propagates already existing optimizations to other loops where also applicable.
- SoftwareRenderer.patch Moves some redundant code from the software renderer modules into the main class
Version two removed a not properly working byte copy replacement. Did not swap bytes.
- SColor.patch Optimized some bit shifting in SColor and some more loop optimizations in conjunction with SColor enhancements
Misc
- WallWarnings.patch Fix reorder warnings of gcc in order to be able to compile Irrlicht with -Wall without thousands of useless warnings.
- renaming.patch Fix typos in comments
- Loader.patch Minor enhancement of loader routines for Jpeg and 3DS
- Makefile.patch Make the Makefile a little more structured and more compatible (Linux only)
IrrlichtNX(++) patches
Here is a first round of patches from IrrlichtNX. Please note that these are
patches for original Irrlicht files, NOT to patch IrrlichtNX. They
rather add IrrlichtNX features to Irrlicht. I did not check whether the patches
are really needed, or if they do what they should do. Please send in comments.
Currently not working patches
- GUICloseHandler.patch Allows to enable or disable the default handling of the GUI window close button
- 32bitIndex.patch
triangleFan.patch These two patches have to be applied together (I could not seperate them without breaking compilation). Change vertex indices to 32bit and add triangleFan support.
- newTGA.patch Adds a new possibility to load TGA files using libjpeg. Seems to have some problems with 0.10!
Removed patches
- Added in 0.12: Add texture support for MS3D files (by atomice)
- Added in 0.12: Adds ExposedData for Linux to access the windows ID of the main Irrlicht window.
- Added in 0.11: Enable antialiasing for D3Dx (by Chips, from afecelis files)
- fixed in 0.11: LinuxMipMaps, parallaxmapping, HLSLmemfault
- fixed in 0.10: CameraFPS, irrHeader, D3DAlphaOP, getcwdLinux, irrList
- XMLReader.patch. Adds single quotes support to XML reader (by Murphy). Not really integrated, but 0.10 accepts both quote signs (and even arbitary mix of the two which is usually not allowd in XML, though!)
- matrixRotate.patch from IrrSpintz for matrix4::rotateVect removed. According to jox Irrlicht 0.9 is doing it correctly.
Most patches for Irrlicht 0.10 are still available on this page.
I have some other patches related to projects using Irrlicht as well. Try
MyWorld Patch for Irrlicht+ODE project by Lofing
making it compilable again (at least for me with Linux/gcc3).
And the 3D editor by lantis needs a patch to work
with Linux
[Back to ParSys]
Christian Stehno (hybrid)
E-Mail
(last updated: July 25th, 2005)