Irrlicht 1.9 support
authorsfan5 <sfan5@live.de>
Sat, 24 Dec 2016 13:26:03 +0000 (14:26 +0100)
committersfan5 <sfan5@live.de>
Mon, 26 Dec 2016 21:36:22 +0000 (22:36 +0100)
src/cguittfont/CGUITTFont.h
src/client/tile.cpp
src/drawscene.cpp
src/game.cpp
src/guiChatConsole.cpp
src/irrlicht_changes/static_text.cpp

index 0aa540c5cfce7bf8b1ec5f69965fdccae7ef5cde..77c9e34f85c4cb8a2bee309c837dcd2f6f530804 100644 (file)
@@ -125,6 +125,10 @@ namespace gui
 
                                bool flgmip = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS);
                                driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+                               bool flgcpy = driver->getTextureCreationFlag(video::ETCF_ALLOW_MEMORY_COPY);
+                               driver->setTextureCreationFlag(video::ETCF_ALLOW_MEMORY_COPY, true);
+#endif
 
                                // Set the texture color format.
                                switch (pixel_mode)
@@ -140,6 +144,9 @@ namespace gui
 
                                // Restore our texture creation flags.
                                driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, flgmip);
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+                               driver->setTextureCreationFlag(video::ETCF_ALLOW_MEMORY_COPY, flgcpy);
+#endif
                                return texture ? true : false;
                        }
 
index 8f0c39465e3894f416b2aa04b6fe280b0742919d..7f7535df629491431d53edecb441a828457f1016 100644 (file)
@@ -938,7 +938,7 @@ video::ITexture* TextureSource::generateTextureFromMesh(
        smgr->drop();
 
        // Unset render target
-       driver->setRenderTarget(0, false, true, 0);
+       driver->setRenderTarget(0, false, true, video::SColor(0,0,0,0));
 
        if (params.delete_texture_on_shutdown)
                m_texture_trash.push_back(rtt);
index c6abda4ac135b28efb588396a144ae5471c32437..32a078b8ece7cc3ff3a5e51917c8a57e97dda729 100644 (file)
@@ -383,6 +383,10 @@ void draw_pageflip_3d_mode(Camera& camera, bool show_hud,
                bool draw_wield_tool, Client& client, gui::IGUIEnvironment* guienv,
                video::SColor skycolor)
 {
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+       errorstream << "Pageflip 3D mode is not supported"
+               << " with your Irrlicht version!" << std::endl;
+#else
        /* preserve old setup*/
        irr::core::vector3df oldPosition = camera.getCameraNode()->getPosition();
        irr::core::vector3df oldTarget   = camera.getCameraNode()->getTarget();
@@ -451,6 +455,7 @@ void draw_pageflip_3d_mode(Camera& camera, bool show_hud,
 
        camera.getCameraNode()->setPosition(oldPosition);
        camera.getCameraNode()->setTarget(oldTarget);
+#endif
 }
 
 void draw_plain(Camera &camera, bool show_hud, Hud &hud,
index 966c23073df3f85fea51602ad763fe973b5438df..5bdbea6170e9539fe543731a20b88ce398bd5217 100644 (file)
@@ -2071,9 +2071,11 @@ void Game::run()
 
 void Game::shutdown()
 {
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 8
        if (g_settings->get("3d_mode") == "pageflip") {
                driver->setRenderTarget(irr::video::ERT_STEREO_BOTH_BUFFERS);
        }
+#endif
 
        showOverlayMessage(wgettext("Shutting down..."), 0, 0, false);
 
index 8dd5ab032628c544956fefda705a84be4a4b53b6..86757617532fe086e7287c65d01585ae04ae2c47 100644 (file)
@@ -630,7 +630,7 @@ bool GUIChatConsole::OnEvent(const SEvent& event)
                }
                else if(event.KeyInput.Char != 0 && !event.KeyInput.Control)
                {
-                       #if (defined(__linux__))
+                       #if defined(__linux__) && (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9)
                                wchar_t wc = L'_';
                                mbtowc( &wc, (char *) &event.KeyInput.Char, sizeof(event.KeyInput.Char) );
                                prompt.input(wc);
index 703287eb310cf8d8854215f47ff7aa97c98203f1..50c6c6a6879a7fb424c8dc671cbb7b654943aa04 100644 (file)
 #if USE_FREETYPE
        #include "cguittfont/xCGUITTFont.h"
 #endif
+#ifndef _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
+       // newer Irrlicht versions no longer have this
+       #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
+#endif
 
 #include "util/string.h"