diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index a21295024..71130304c 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -134,13 +134,8 @@ void IrrDriver::initDevice() for(int bits=32; bits>15; bits -=8) { m_device = createDevice(type, -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2d(UserConfigParams::m_width, UserConfigParams::m_height ), -#else - core::dimension2d(UserConfigParams::m_width, - UserConfigParams::m_height ), -#endif bits, //bits per pixel UserConfigParams::m_fullscreen, false, // stencil buffers @@ -735,13 +730,8 @@ bool IrrDriver::OnEvent(const irr::SEvent &event) * rendering doesn't work if setRenderTarget is called here, but 3d * rendering doesn't work if it's not called here :( */ -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 IrrDriver::RTTProvider::RTTProvider(const core::dimension2du &dimension, const std::string &name) -#else -IrrDriver::RTTProvider::RTTProvider(const core::dimension2di &dimension, - const std::string &name) -#endif { m_video_driver = irr_driver->getVideoDriver(); diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 9373e015e..d0b2937d1 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -66,13 +66,8 @@ public: /** Returns a list of all video modes supports by the graphics card. */ const std::vector& getVideoModes() const { return m_modes; } /** Returns the frame size. */ -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 const core::dimension2d getFrameSize() const { return m_video_driver->getCurrentRenderTargetSize(); } -#else - const core::dimension2d getFrameSize() const - { return m_video_driver->getCurrentRenderTargetSize(); } -#endif /** Returns the irrlicht device. */ IrrlichtDevice *getDevice() const { return m_device; } /** Returns the irrlicht video driver. */ @@ -151,13 +146,8 @@ public: video::IVideoDriver *m_video_driver; public: -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 RTTProvider(const core::dimension2du &dimension, const std::string &name); -#else - RTTProvider(const core::dimension2di &dimension, - const std::string &name); -#endif ~RTTProvider(); diff --git a/src/guiengine/modaldialog.cpp b/src/guiengine/modaldialog.cpp index ea519590e..46f22ccb0 100644 --- a/src/guiengine/modaldialog.cpp +++ b/src/guiengine/modaldialog.cpp @@ -27,11 +27,7 @@ static ModalDialog* modalWindow = NULL; ModalDialog::ModalDialog(const float percentWidth, const float percentHeight) { -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 const core::dimension2d& frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#else - const core::dimension2d& frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#endif const int w = (int)(frame_size.Width*percentWidth); const int h = (int)(frame_size.Height*percentHeight); @@ -44,13 +40,8 @@ ModalDialog::ModalDialog(const float percentWidth, const float percentHeight) assert(w > 0); assert(h > 0); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 assert((unsigned int)w <= frame_size.Width); assert((unsigned int)h <= frame_size.Height); -#else - assert(w <= frame_size.Width); - assert(h <= frame_size.Height); -#endif m_area = core::rect< s32 >( core::position2d< s32 >(frame_size.Width/2 - w/2, frame_size.Height/2 - h/2), core::dimension2d< s32 >(w, h) ); diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index 314922870..25a2ebcc6 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -293,11 +293,7 @@ void Skin::drawBgImage() source_area = core::rect(0, 0, texture_w, texture_h); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2d frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#else - core::dimension2d frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#endif const int screen_w = frame_size.Width; const int screen_h = frame_size.Height; @@ -627,11 +623,7 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const // automatically guess from position on-screen if tabs go up or down -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 const bool vertical_flip = (unsigned int)rect.UpperLeftCorner.Y < GUIEngine::getDriver()->getCurrentRenderTargetSize().Height/2; -#else - const bool vertical_flip = rect.UpperLeftCorner.Y < GUIEngine::getDriver()->getCurrentRenderTargetSize().Height/2; -#endif params->vertical_flip = vertical_flip; core::rect< s32 > rect2 = rect; diff --git a/src/guiengine/widget.cpp b/src/guiengine/widget.cpp index beb723a67..03e556463 100644 --- a/src/guiengine/widget.cpp +++ b/src/guiengine/widget.cpp @@ -232,11 +232,7 @@ void Widget::readCoords(Widget* parent) unsigned int parent_w, parent_h, parent_x, parent_y; if(parent == NULL) { -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2d frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#else - core::dimension2d frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize(); -#endif parent_w = frame_size.Width; parent_h = frame_size.Height; parent_x = 0; @@ -293,11 +289,7 @@ void Widget::readCoords(Widget* parent) if (m_text.size() > 0) { IGUIFont* font = GUIEngine::getFont(); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2d< u32 > dim = font->getDimension( m_text.c_str() ); -#else - core::dimension2d< s32 > dim = font->getDimension( m_text.c_str() ); -#endif label_w = dim.Width; // FIXME - won't work with multiline labels. thus, for now, when multiple // lines are required, we need to specify a height explicitely diff --git a/src/guiengine/widgets/model_view_widget.cpp b/src/guiengine/widgets/model_view_widget.cpp index dfb4e9556..6ab09b28e 100644 --- a/src/guiengine/widgets/model_view_widget.cpp +++ b/src/guiengine/widgets/model_view_widget.cpp @@ -145,11 +145,7 @@ void ModelViewWidget::update(float delta) { std::string name = "model view "; name += m_properties[PROP_ID].c_str(); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 m_rtt_provider = new IrrDriver::RTTProvider(core::dimension2d< u32 >(512, 512), name ); -#else - m_rtt_provider = new IrrDriver::RTTProvider(core::dimension2d< s32 >(512, 512), name ); -#endif m_rtt_provider->setupRTTScene(m_models, m_model_location); } diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index 205222ddf..3a29e6f81 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -416,11 +416,7 @@ void FileManager::listFiles(std::set& result, const std::string& di { result.clear(); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 std::string previous_cwd1 = std::string(m_file_system->getWorkingDirectory().c_str()); -#else - std::string previous_cwd1 = m_file_system->getWorkingDirectory(); -#endif #ifdef WIN32 std::string path = is_full_path ? dir : m_root_dir+"/"+dir; #else @@ -433,11 +429,7 @@ void FileManager::listFiles(std::set& result, const std::string& di if(stat(path.c_str(), &mystat) < 0) return; if(! S_ISDIR(mystat.st_mode)) return; -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 std::string previous_cwd = std::string(m_file_system->getWorkingDirectory().c_str()); -#else - std::string previous_cwd = m_file_system->getWorkingDirectory(); -#endif if(!m_file_system->changeWorkingDirectoryTo( path.c_str() )) { @@ -449,11 +441,7 @@ void FileManager::listFiles(std::set& result, const std::string& di for(int n=0; n<(int)files->getFileCount(); n++) { //printf("---- Entry : %s \n", (make_full_path ? path+"/"+ files->getFileName(n) : files->getFileName(n)).c_str()); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 result.insert(make_full_path ? path+"/"+ files->getFileName(n).c_str() : files->getFileName(n).c_str()); -#else - result.insert(make_full_path ? path+"/"+ files->getFileName(n) : files->getFileName(n)); -#endif } m_file_system->changeWorkingDirectoryTo( previous_cwd.c_str() ); diff --git a/src/states_screens/race_gui.cpp b/src/states_screens/race_gui.cpp index 36309b6d3..d97edc498 100644 --- a/src/states_screens/race_gui.cpp +++ b/src/states_screens/race_gui.cpp @@ -81,15 +81,9 @@ void RaceGUI::createMarkerTexture() while(npower2>1)-1; -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 IrrDriver::RTTProvider rttProvider(core::dimension2du(m_marker_rendered_size * npower2, m_marker_rendered_size), "RaceGUI::markers"); -#else - IrrDriver::RTTProvider rttProvider(core::dimension2di(m_marker_rendered_size * npower2, - m_marker_rendered_size), - "RaceGUI::markers"); -#endif scene::ICameraSceneNode *camera = irr_driver->addCameraSceneNode(); core::matrix4 projection; projection.buildProjectionMatrixOrthoLH((float)(m_marker_rendered_size*npower2), @@ -493,11 +487,7 @@ void RaceGUI::drawSpeed(Kart* kart, const core::recti &viewport, if(speed_ratio>1) speed_ratio = 1; video::ITexture *bar_texture = m_speed_bar_icon->getTexture(); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2du bar_size = bar_texture->getOriginalSize(); -#else - core::dimension2di bar_size = bar_texture->getOriginalSize(); -#endif video::S3DVertex vertices[4]; vertices[0].TCoords = core::vector2df(1.0f, 1.0f); @@ -697,11 +687,7 @@ void RaceGUI::drawGlobalMusicDescription() // Draw text core::stringw thetext(s.c_str()); -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 core::dimension2d< u32 > textSize = font->getDimension(thetext.c_str()); -#else - core::dimension2d< s32 > textSize = font->getDimension(thetext.c_str()); -#endif const int textWidth = textSize.Width; core::rect pos((UserConfigParams::m_width >> 1) + 32, text_y, diff --git a/src/states_screens/race_gui.hpp b/src/states_screens/race_gui.hpp index b28392a24..60a33dd61 100644 --- a/src/states_screens/race_gui.hpp +++ b/src/states_screens/race_gui.hpp @@ -169,13 +169,8 @@ public: const video::SColor &color=video::SColor(255, 255, 0, 255)); /** Returns the size of the texture on which to render the minimap to. */ -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 const core::dimension2du getMiniMapSize() const { return core::dimension2du(m_map_width, m_map_height); } -#else - const core::dimension2di getMiniMapSize() const - { return core::dimension2di(m_map_width, m_map_height); } -#endif }; #endif diff --git a/src/tracks/quad_graph.cpp b/src/tracks/quad_graph.cpp index bd90b4563..132c7d297 100644 --- a/src/tracks/quad_graph.cpp +++ b/src/tracks/quad_graph.cpp @@ -466,15 +466,9 @@ int QuadGraph::findOutOfRoadSector(const Vec3& xyz, /** Draws the mini map on the screen. * \param where the top left and lower right corner for the mini map. */ -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 video::ITexture *QuadGraph::makeMiniMap(const core::dimension2du &dimension, const std::string &name, const video::SColor &fill_color) -#else -video::ITexture *QuadGraph::makeMiniMap(const core::dimension2di &dimension, - const std::string &name, - const video::SColor &fill_color) -#endif { IrrDriver::RTTProvider rttProvider(dimension, name); createMesh(false); diff --git a/src/tracks/quad_graph.hpp b/src/tracks/quad_graph.hpp index eda512407..4fd67f7b7 100644 --- a/src/tracks/quad_graph.hpp +++ b/src/tracks/quad_graph.hpp @@ -81,17 +81,10 @@ public: const int curr_sector=UNKNOWN_SECTOR, std::vector *all_sectors=NULL ) const; -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 video::ITexture *makeMiniMap(const core::dimension2du &where, const std::string &name, const video::SColor &fill_color =video::SColor(127, 255, 255, 255) ); -#else - video::ITexture *makeMiniMap(const core::dimension2di &where, - const std::string &name, - const video::SColor &fill_color - =video::SColor(127, 255, 255, 255) ); -#endif void mapPoint2MiniMap(const Vec3 &xyz, Vec3 *out) const; void setStartCoordinate(const CheckLine &cl); diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 20faa3e3a..f56ee682d 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -528,8 +528,6 @@ void Track::handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml) */ void Track::update(float dt) { - irr_driver->getSceneManager()->setAmbientLight(m_ambient_color); - for(unsigned int i=0; iupdate(dt); @@ -817,11 +815,7 @@ void Track::loadTrackModel(unsigned int mode_id) // ---- Fog if (m_use_fog) { -#if IRRLICHT_VERSION_MAJOR > 1 || IRRLICHT_VERSION_MINOR >= 6 irr_driver->getVideoDriver()->setFog(m_fog_color, video::EFT_FOG_LINEAR, m_fog_start, m_fog_end, m_fog_density); -#else - irr_driver->getVideoDriver()->setFog(m_fog_color, true, m_fog_start, m_fog_end, m_fog_density); -#endif } // Note: the physics world for irrlicht is created in loadMainTrack