From 8d4dc096a4c5bc25a0f273b925ec48783c3e5cd0 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 1 Aug 2011 14:41:15 +0200 Subject: [PATCH] move getExterior back --- apps/openmw/mwworld/scene.cpp | 24 ------------------------ apps/openmw/mwworld/scene.hpp | 3 --- apps/openmw/mwworld/world.cpp | 29 ++++++++++++++++++++++++----- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 444e3b334..2080653fa 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -206,30 +206,6 @@ namespace MWWorld changeCell (x, y, position, true); } - - const ESM::Cell *Scene::getExterior (const std::string& cellName) const - { - // first try named cells - if (const ESM::Cell *cell = mWorld->getStore().cells.searchExtByName (cellName)) - return cell; - - // didn't work -> now check for regions - std::string cellName2 = ESMS::RecListT::toLower (cellName); - - for (ESMS::RecListT::MapType::const_iterator iter (mWorld->getStore().regions.list.begin()); - iter!=mWorld->getStore().regions.list.end(); ++iter) - { - if (ESMS::RecListT::toLower (iter->second.name)==cellName2) - { - if (const ESM::Cell *cell = mWorld->getStore().cells.searchExtByRegion (iter->first)) - return cell; - - break; - } - } - - return 0; - } Ptr::CellStore* Scene::getCurrentCell () { diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index f7e3fc7e6..bfb7a5537 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -93,9 +93,6 @@ namespace MWWorld void changeToExteriorCell (const ESM::Position& position); ///< Move to exterior cell. - const ESM::Cell *getExterior (const std::string& cellName) const; - ///< Return a cell matching the given name or a 0-pointer, if there is no such cell. - void markCellAsUnchanged(); std::string getFacedHandle(); diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 4d2c1590a..0e9f65e8c 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -320,6 +320,30 @@ namespace MWWorld delete mGlobalVariables; delete mWorldScene; } + + const ESM::Cell *World::getExterior (const std::string& cellName) const + { + // first try named cells + if (const ESM::Cell *cell = mStore.cells.searchExtByName (cellName)) + return cell; + + // didn't work -> now check for regions + std::string cellName2 = ESMS::RecListT::toLower (cellName); + + for (ESMS::RecListT::MapType::const_iterator iter (mStore.regions.list.begin()); + iter!=mStore.regions.list.end(); ++iter) + { + if (ESMS::RecListT::toLower (iter->second.name)==cellName2) + { + if (const ESM::Cell *cell = mStore.cells.searchExtByRegion (iter->first)) + return cell; + + break; + } + } + + return 0; + } Ptr::CellStore *World::getExterior (int x, int y) { @@ -581,11 +605,6 @@ namespace MWWorld return mWorldScene->changeToExteriorCell(position); } - const ESM::Cell *World::getExterior (const std::string& cellName) const - { - return mWorldScene->getExterior(cellName); - } - void World::markCellAsUnchanged() { return mWorldScene->markCellAsUnchanged();