diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 5fc9774d1..2467f91d1 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -116,7 +116,7 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) std::cerr << "Error in framelistener: " << e.what() << std::endl; } - return !MWBase::Environment::get().getWorld()->getExitNow(); + return true; } OMW::Engine::Engine(Files::ConfigurationManager& configurationManager) diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index f08617d4c..8b809d399 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -248,9 +248,6 @@ namespace MWBase virtual bool isSwimming(const MWWorld::Ptr &object) = 0; virtual bool isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos) = 0; - - virtual void exitNow() = 0; ///< exit after this frame has ended - virtual bool getExitNow() = 0; ///< @return true if the application should exit }; } diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index ca9ebbc4a..e2fefd649 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -1,5 +1,8 @@ #include "mainmenu.hpp" +#include + + #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -69,7 +72,7 @@ namespace MWGui void MainMenu::exitGame(MyGUI::Widget* sender) { - MWBase::Environment::get().getWorld ()->exitNow(); + Ogre::Root::getSingleton ().queueEndRendering (); } } diff --git a/apps/openmw/mwinput/inputmanager.cpp b/apps/openmw/mwinput/inputmanager.cpp index 5a4718ccf..e29e3c268 100644 --- a/apps/openmw/mwinput/inputmanager.cpp +++ b/apps/openmw/mwinput/inputmanager.cpp @@ -1,5 +1,7 @@ #include "inputmanager.hpp" +#include + #include #include @@ -222,7 +224,7 @@ private: void exitNow() { if(!windows.isGuiMode()) - MWBase::Environment::get().getWorld()->exitNow(); + Ogre::Root::getSingleton().queueEndRendering (); } public: diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cb33b40f2..d9fbc5b77 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -170,7 +170,7 @@ namespace MWWorld const std::string& encoding, std::map fallbackMap) : mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0), mSky (true), mNextDynamicRecord (0), mCells (mStore, mEsm), - mNumFacing(0), mExit(false) + mNumFacing(0) { mPhysics = new PhysicsSystem(renderer); mPhysEngine = mPhysics->getEngine(); @@ -1148,14 +1148,4 @@ namespace MWWorld return pos.z < cell.water; } - void World::exitNow() - { - mExit = true; - } - - bool World::getExitNow() - { - return mExit; - } - } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 7af71d349..f2f221b39 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -277,9 +277,6 @@ namespace MWWorld virtual bool isSwimming(const MWWorld::Ptr &object); virtual bool isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos); - virtual void exitNow(); ///< exit after this frame has ended - virtual bool getExitNow(); ///< @return true if the application should exit - }; }