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
brilliant improvements and some of the bug fixes posted in the Irrlicht forums.
Irrlicht forum thread
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.12 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
Feature enhancements
- animCallback.patch Add event system for animation status changes.
- animatorDelete.patch Remove animator upon deletion event. Needs animCallback.patch.
- flystraight.patch Enhancements for FlyStraight animator with callbacks. Needs animCallback.patch.
- followspline.patch Enhancements for FollowSpline animator with callbacks. Needs animCallback.patch.
- particleattract.patch Add option to reverse particle attraction.
- filtering.patch Add anisotropic filtering.
- 8bitcolor.patch Add support for 8bit Bitmaps.
- yzAngle.patch Add another vector3d method (from Arras), used with particle generators.
- keyInterface.patch New keypress interface to change game controls without recompiling.
- md3.patch Add MD3 file format, submitted by madinitaly. Irrlicht forum thread
- OGLAnisotropy.patch Add Anisotropic filtering, submitted by disanti. Irrlicht forum thread
- 32bit.patch Change vertex indices to 32bit and add triangleFan support. Please ignore a fail in MS3D loader if you did not apply that patch also.
- animations.patch Add new animations interface.
- guiskintype.patch Ability to change skin type.
- lights.patch New lights (spot and directional) API CHANGE!
- mesh2T.patch Method to convert mesh to 2TCOORDS type. Needs s3dvertex.patch.
- s3dvertex.patch New constructor for S3DVertex2T.
- planarMapping.patch Allow makePlanarTextureMapping to use 1st or 2nd texture coordinates.
- 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. API CHANGE!
- 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.
- rdtarga.patch An enhancement to libjpeg which becomes necessary if libjpeg is used for Targa support
- floatFPS.patch Changes frames per second interface to using floats
Feature enhancements with additonal files (Add to your Makefile!)
- rawimage.patch Add Loader for RAW images. Needs 8bitcolor.patch.
- 3rdPersCam.patch Add 3rd person camera, needs keyInterface.patch.
- fire.patch Add fire scene node (CZestmyr).
- moreparticles.patch Add some more particle generators and apply some fixes. Probably needs the other Spintz Particles as well.
- particle-spintz.patch Major improvements to particle system.
- terrain.patch Major improvements and bugfixes to terrain node.
- TrueTypeFont.patchAdds support for TrueType fonts posted by zgock. You have to add new file CGUITTFont to your project file/Makefile.Irrlicht forum thread
- GUILoadBar.patch Adds LoadBar to set of GUI elements. You have to add new file CGUILoadBar to your project file/Makefile! Fixed a missing enum type recently.
Optimizations
Misc
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
- WallWarnings.patch Fix reorder warnings of gcc in order to be able to compile Irrlicht with -Wall without thousands of useless warnings.
- beginScene.patch Call beginScene without parameters and get/set attributes instead. Works, but breaks API.
- 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.
- GUICloseHandler.patch Allows to enable or disable the default handling of the GUI window close button
- newTGA.patch Adds a new possibility to load TGA files using libjpeg. Seems to have some problems with 0.10!
Removed patches
- collision.patch: Replaced by new spintz collision patch (remove before applying the new one)
- particle.patch: Replaced by new spintz particles (remove before applying the new one)
- SetParticleSpeed.patch: Replaced by new spintz particles (remove before applying the new one)
- 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.11 are still available on this page.
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.26 Patch or MyWorld.66 Patch for Irrlicht+ODE project by Lofing
making it compilable again (at least for me with Linux/gcc3). Latest version works without changes! Irrlicht forum thread
The 3D editor by lantis needs a patch to work with Linux
Acki made a ragdoll implementation for Irrlicht, here are the patch files. Irrlicht forum thread
[Back to ParSys]
Christian Stehno (hybrid)
E-Mail
(last updated: November 30th, 2005)