Skip to content

Commit

Permalink
fixed minor crash on shutdown example-voxel*
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertzui11 committed Jul 11, 2014
1 parent 0ff9042 commit 7dc03f9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions examples/voxelterrain/source/Handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
}

/**
Expand All @@ -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();
Expand Down Expand Up @@ -187,7 +185,7 @@ class Handler : public Ogre::FrameListener, public OIS::MouseListener, public OI
m_lookHor += static_cast<blub::real>(arg.state.Y.rel) / -500.;
m_lookVert += static_cast<blub::real>(arg.state.X.rel) / -500.;

m_lookHor = blub::math::clamp<blub::real>(m_lookHor, -blub::math::piHalf, blub::math::piHalf);
m_lookHor = blub::math::clamp<blub::real>(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));
Expand Down Expand Up @@ -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<Ogre::Root> renderSystem;
Ogre::SceneManager* renderScene;
Ogre::Camera* camera;
Expand All @@ -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;
Expand Down

0 comments on commit 7dc03f9

Please # to comment.