From 7dc03f97a9ebc4e0a3b915a906bbc071b859b08a Mon Sep 17 00:00:00 2001 From: Markus Lanner Date: Fri, 11 Jul 2014 15:44:28 +0200 Subject: [PATCH] fixed minor crash on shutdown example-voxel* --- examples/voxelterrain/source/Handler.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/voxelterrain/source/Handler.hpp b/examples/voxelterrain/source/Handler.hpp index 33ca83f..fed67c1 100644 --- a/examples/voxelterrain/source/Handler.hpp +++ b/examples/voxelterrain/source/Handler.hpp @@ -25,10 +25,10 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI * @brief Handler constructor */ Handler() - : graphicDispatcher(0, true) - , camera(nullptr) + : camera(nullptr) , keyboard(nullptr) , mouse(nullptr) + , graphicDispatcher(0, true) , m_lookVert(blub::math::pi) , m_lookHor(0.) , m_forward(false) @@ -48,8 +48,6 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI inputManager->destroyInputObject(keyboard); inputManager->destroyInputObject(mouse); OIS::InputManager::destroyInputSystem(inputManager); - - renderScene->destroyAllMovableObjects(); } /** @@ -71,7 +69,7 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI renderSystem->initialise(true); renderScene = renderSystem->createSceneManager(Ogre::ST_GENERIC); - // renderScene = renderSystem->createSceneManager("OctreeSceneManager"); +// renderScene = renderSystem->createSceneManager("OctreeSceneManager"); // Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../data", "FileSystem"); // Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); @@ -187,7 +185,7 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI m_lookHor += static_cast(arg.state.Y.rel) / -500.; m_lookVert += static_cast(arg.state.X.rel) / -500.; - m_lookHor = blub::math::clamp(m_lookHor, -blub::math::piHalf, blub::math::piHalf); + m_lookHor = blub::math::clamp(m_lookHor, -blub::math::piHalf, blub::math::piHalf); const blub::quaternion rotVert(0, blub::math::sin(m_lookVert / 2.0), 0, blub::math::cos(m_lookVert / 2.0)); const blub::quaternion rotHor(blub::math::sin(m_lookHor / 2.0), 0, 0, blub::math::cos(m_lookHor / 2.0)); @@ -287,8 +285,6 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI t_sigMouseGotPressed* signalMouseGotPressed() {return &m_sigMouseGotPressed;} public: - blub::async::dispatcher graphicDispatcher; - blub::scopedPointer renderSystem; Ogre::SceneManager* renderScene; Ogre::Camera* camera; @@ -297,6 +293,8 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI OIS::Keyboard *keyboard; OIS::Mouse *mouse; + blub::async::dispatcher graphicDispatcher; + protected: blub::real m_lookVert; blub::real m_lookHor;