From 7d2956329a5be52544ff88f490ae2515a73059ea Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 30 May 2011 14:27:04 +0200 Subject: [PATCH] some cleanup --- apps/openmw/mwrender/exterior.cpp | 16 ++++++++-------- apps/openmw/mwworld/world.cpp | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwrender/exterior.cpp b/apps/openmw/mwrender/exterior.cpp index 626ca8f1e..1cdc51c98 100644 --- a/apps/openmw/mwrender/exterior.cpp +++ b/apps/openmw/mwrender/exterior.cpp @@ -38,7 +38,7 @@ ExteriorCellRender::ExteriorCellRender(ESMS::CellStore &_cell, : mCell(_cell), mEnvironment (environment), mScene(_scene), mBase(NULL), mInsert(NULL), mAmbientMode (0) { uniqueID = uniqueID +1; - sg = Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID)); + sg = mScene.getMgr()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID)); } @@ -400,13 +400,13 @@ void ExteriorCellRender::destroy() mScene.getMgr()->destroySceneNode(mBase); } - mBase = NULL; - std::cout << "destroy"; - if (sg) - { - Ogre::Root::getSingleton().getSceneManagerIterator().getNext()->destroyStaticGeometry(sg); - sg = 0; - } + mBase = 0; + + if (sg) + { + mScene.getMgr()->destroyStaticGeometry (sg); + sg = 0; + } } // Switch through lighting modes. diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 68e3a745d..f1563e621 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -284,7 +284,6 @@ namespace MWWorld removeScripts (iter->first); mEnvironment.mMechanicsManager->dropActors (iter->first); - iter->second->destroy(); mEnvironment.mSoundManager->stopSound (iter->first); delete iter->second; mActiveCells.erase (iter);