diff options
author | Kahrl <kahrl@gmx.net> | 2011-11-19 16:37:52 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 11:56:06 +0200 |
commit | 1901158b3eacc95d945becea62ac28039618f460 (patch) | |
tree | 76fb2b1acf8cb3b4152202711bf32029ee67e626 /src | |
parent | 63d3403a2046046bdf826c9b47067031cacae8fe (diff) | |
download | minetest-1901158b3eacc95d945becea62ac28039618f460.tar.gz minetest-1901158b3eacc95d945becea62ac28039618f460.tar.bz2 minetest-1901158b3eacc95d945becea62ac28039618f460.zip |
Make camera.cpp Irrlicht 1.8-compatible by calling ITexture::lock differently depending on the irrlicht version.
Diffstat (limited to 'src')
-rw-r--r-- | src/camera.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/camera.cpp b/src/camera.cpp index 54b3326fa..6c81c46e2 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -29,6 +29,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" #include "nodedef.h" // For wield visualization +// In Irrlicht 1.8 the signature of ITexture::lock was changed from +// (bool, u32) to (E_TEXTURE_LOCK_MODE, u32). +#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7 +#define MY_ETLM_READ_ONLY true +#else +#define MY_ETLM_READ_ONLY video::ETLM_READ_ONLY +#endif + Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control): m_smgr(smgr), m_playernode(NULL), @@ -832,7 +840,7 @@ scene::IAnimatedMesh* ExtrudedSpriteSceneNode::extrude(video::ITexture* texture) { // Texture is in the correct color format, we can pass it // to extrudeARGB right away. - void* data = texture->lock(true); + void* data = texture->lock(MY_ETLM_READ_ONLY); if (data == NULL) return NULL; mesh = extrudeARGB(size.Width, size.Height, (u8*) data); @@ -842,7 +850,7 @@ scene::IAnimatedMesh* ExtrudedSpriteSceneNode::extrude(video::ITexture* texture) { video::IVideoDriver* driver = SceneManager->getVideoDriver(); - video::IImage* img1 = driver->createImageFromData(format, size, texture->lock(true)); + video::IImage* img1 = driver->createImageFromData(format, size, texture->lock(MY_ETLM_READ_ONLY)); if (img1 == NULL) return NULL; |