From e7057bed29e4c75d2d77596e43f349cff9cda841 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Sun, 31 Jul 2011 17:07:11 +0200 Subject: [PATCH] moving stuff from MWWorld::World to MWWorld::Scene but receiving segfault signals --- apps/openmw/CMakeLists.txt | 5 +- apps/openmw/mwrender/player.hpp | 2 +- apps/openmw/mwrender/render_manager.cpp | 1 + apps/openmw/mwrender/render_manager.hpp | 9 + apps/openmw/mwworld/physikssystem.cpp | 7 + apps/openmw/mwworld/physikssystem.hpp | 4 + apps/openmw/mwworld/player.cpp | 3 + apps/openmw/mwworld/scene.cpp | 539 ++++++++++++++++++++++++ apps/openmw/mwworld/scene.hpp | 65 +++ apps/openmw/mwworld/world.cpp | 8 +- apps/openmw/mwworld/world.hpp | 12 +- 11 files changed, 648 insertions(+), 7 deletions(-) create mode 100644 apps/openmw/mwrender/render_manager.cpp create mode 100644 apps/openmw/mwrender/render_manager.hpp create mode 100644 apps/openmw/mwworld/physikssystem.cpp create mode 100644 apps/openmw/mwworld/physikssystem.hpp create mode 100644 apps/openmw/mwworld/scene.cpp create mode 100644 apps/openmw/mwworld/scene.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index f8b4d7a59f..8fc10079c3 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,6 +16,7 @@ set(GAME_HEADER source_group(game FILES ${GAME} ${GAME_HEADER}) set(GAMEREND + mwrender/render_manager.cpp mwrender/mwscene.cpp mwrender/cellimp.cpp mwrender/interior.cpp @@ -24,6 +25,7 @@ set(GAMEREND mwrender/player.cpp ) set(GAMEREND_HEADER + mwrender/render_manager.hpp mwrender/cell.hpp mwrender/cellimp.hpp mwrender/mwscene.hpp @@ -137,6 +139,7 @@ source_group(apps\\openmw\\mwsound FILES ${GAMESOUND} ${GAMESOUND_HEADER}) set(GAMEWORLD mwworld/world.cpp + mwworld/scene.cpp mwworld/globals.cpp mwworld/class.cpp mwworld/actionteleport.cpp @@ -149,7 +152,7 @@ set(GAMEWORLD set(GAMEWORLD_HEADER mwworld/refdata.hpp mwworld/world.hpp - mwworld/ptr.hpp + mwworld/scene.hpp mwworld/environment.hpp mwworld/globals.hpp mwworld/class.hpp diff --git a/apps/openmw/mwrender/player.hpp b/apps/openmw/mwrender/player.hpp index f2d8191162..399d3f4854 100644 --- a/apps/openmw/mwrender/player.hpp +++ b/apps/openmw/mwrender/player.hpp @@ -22,7 +22,7 @@ namespace MWRender Ogre::Camera *getCamera() { return mCamera; } - std::string getHandle() const { return mHandle; } + std::string getHandle() const { std::cout << "mHandle " << mHandle << std::endl; return mHandle; } }; } diff --git a/apps/openmw/mwrender/render_manager.cpp b/apps/openmw/mwrender/render_manager.cpp new file mode 100644 index 0000000000..4212c0cec4 --- /dev/null +++ b/apps/openmw/mwrender/render_manager.cpp @@ -0,0 +1 @@ +#include "render_manager.hpp" diff --git a/apps/openmw/mwrender/render_manager.hpp b/apps/openmw/mwrender/render_manager.hpp new file mode 100644 index 0000000000..67b2fb93f4 --- /dev/null +++ b/apps/openmw/mwrender/render_manager.hpp @@ -0,0 +1,9 @@ +#ifndef _GAME_RENDER_MANAGER_H +#define _GAME_RENDER_MANAGER_H + +namespace MWRender +{ + +} + +#endif diff --git a/apps/openmw/mwworld/physikssystem.cpp b/apps/openmw/mwworld/physikssystem.cpp new file mode 100644 index 0000000000..5e20429373 --- /dev/null +++ b/apps/openmw/mwworld/physikssystem.cpp @@ -0,0 +1,7 @@ +#include "physikssystem.hpp" + + +namespace MWWorld +{ + +} diff --git a/apps/openmw/mwworld/physikssystem.hpp b/apps/openmw/mwworld/physikssystem.hpp new file mode 100644 index 0000000000..450f630b53 --- /dev/null +++ b/apps/openmw/mwworld/physikssystem.hpp @@ -0,0 +1,4 @@ +#ifndef GAME_MWWORLD_PHYSIKSSYSTEM_H +#define GAME_MWWORLD_PHYSIKSSYSTEM_H + +#endif diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 259348938f..d28569a9dd 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -17,6 +17,9 @@ namespace MWWorld mMale = !(player->flags & ESM::NPC::Female); mRace = player->race; mPlayer.ref.pos.pos[0] = mPlayer.ref.pos.pos[1] = mPlayer.ref.pos.pos[2] = 0; + std::cout << "mData.setHandle" << std::endl; + std::cout << renderer->getHandle(); + std::cout << "mData end" << std::endl; mPlayer.mData.setHandle (renderer->getHandle()); mClass = new ESM::Class (*world.getStore().classes.find (player->cls)); } diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp new file mode 100644 index 0000000000..2e9784d46f --- /dev/null +++ b/apps/openmw/mwworld/scene.cpp @@ -0,0 +1,539 @@ +#include "scene.hpp" + +#include "world.hpp" +#include "ptr.hpp" +#include "environment.hpp" +#include "class.hpp" +#include "player.hpp" + +#include "refdata.hpp" +#include "globals.hpp" +#include "doingphysics.hpp" +#include "cellfunctors.hpp" +#include "environment.hpp" + +#include +#include + +#include +#include + +#include "../mwrender/sky.hpp" +#include "../mwrender/interior.hpp" +#include "../mwrender/exterior.hpp" + +#include "../mwmechanics/mechanicsmanager.hpp" + +#include "../mwsound/soundmanager.hpp" + +#include "ptr.hpp" +#include "environment.hpp" +#include "class.hpp" +#include "player.hpp" + +#include "refdata.hpp" +#include "globals.hpp" +#include "doingphysics.hpp" +#include "cellfunctors.hpp" + +namespace { + + template + ESMS::LiveCellRef *searchViaHandle (const std::string& handle, + ESMS::CellRefList& refList) + { + typedef typename ESMS::CellRefList::List::iterator iterator; + + for (iterator iter (refList.list.begin()); iter!=refList.list.end(); ++iter) + { + if (iter->mData.getHandle()==handle) + { + return &*iter; + } + } + + return 0; + } +} + + +namespace MWWorld +{ + + Scene::Scene(Environment& environment, World *world, MWRender::MWScene scene) : + mEnvironment(environment), mWorld(world), mScene(scene) + { + } + + Ptr Scene::getPtr (const std::string& name, Ptr::CellStore& cell) + { + if (ESMS::LiveCellRef *ref = cell.activators.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.potions.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.appas.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.armors.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.books.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.clothes.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.containers.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.creatures.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.doors.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.ingreds.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.creatureLists.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.itemLists.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.lights.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.lockpicks.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.miscItems.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.npcs.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.probes.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.repairs.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.statics.find (name)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = cell.weapons.find (name)) + return Ptr (ref, &cell); + + return Ptr(); + } + + + + Ptr Scene::getPtrViaHandle (const std::string& handle, Ptr::CellStore& cell) + { + if (ESMS::LiveCellRef *ref = + searchViaHandle (handle, cell.activators)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.potions)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.appas)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.armors)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.books)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.clothes)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = + searchViaHandle (handle, cell.containers)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = + searchViaHandle (handle, cell.creatures)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.doors)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = + searchViaHandle (handle, cell.ingreds)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.lights)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.lockpicks)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.miscItems)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.npcs)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.probes)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.repairs)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.statics)) + return Ptr (ref, &cell); + + if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.weapons)) + return Ptr (ref, &cell); + + return Ptr(); + } + + MWRender::CellRender *Scene::searchRender (Ptr::CellStore *store) + { + CellRenderCollection::iterator iter = mActiveCells.find (store); + + if (iter!=mActiveCells.end()) + { + return iter->second; + } + + return 0; + } + + void Scene::unloadCell (CellRenderCollection::iterator iter) + { + ListHandles functor; + iter->first->forEach(functor); + + { // silence annoying g++ warning + for (std::vector::const_iterator iter (functor.mHandles.begin()); + iter!=functor.mHandles.end(); ++iter) + { + mScene.removeObject (*iter); // FIXME + } + } + + mEnvironment.mMechanicsManager->dropActors (iter->first); + mEnvironment.mSoundManager->stopSound (iter->first); + delete iter->second; + mActiveCells.erase (iter); + } + + void Scene::loadCell (Ptr::CellStore *cell, MWRender::CellRender *render) + { + // register local scripts + mWorld->insertInteriorScripts (*cell); // FIXME + + // This connects the cell data with the rendering scene. + std::pair result = + mActiveCells.insert (std::make_pair (cell, render)); + + if (result.second) + { + // Load the cell and insert it into the renderer + result.first->second->show(); + } + + } + + void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos) + { + SuppressDoingPhysics scopeGuard; + + // remove active + mEnvironment.mMechanicsManager->removeActor (mWorld->getPlayer().getPlayer()); + + CellRenderCollection::iterator active = mActiveCells.begin(); + + while (active!=mActiveCells.end()) + { + if (!(active->first->cell->data.flags & ESM::Cell::Interior)) + { + if (std::abs (X-active->first->cell->data.gridX)<=1 && + std::abs (Y-active->first->cell->data.gridY)<=1) + { + // keep cells within the new 3x3 grid + ++active; + continue; + } + } + + unloadCell (active++); + } + + // Load cells + for (int x=X-1; x<=X+1; ++x) + for (int y=Y-1; y<=Y+1; ++y) + { + CellRenderCollection::iterator iter = mActiveCells.begin(); + + while (iter!=mActiveCells.end()) + { + assert (!(iter->first->cell->data.flags & ESM::Cell::Interior)); + + if (x==iter->first->cell->data.gridX && + y==iter->first->cell->data.gridY) + break; + + ++iter; + } + + if (iter==mActiveCells.end()) + { + mExteriors[std::make_pair (x, y)].loadExt (x, y, mWorld->getStore(), mWorld->getEsmReader()); + Ptr::CellStore *cell = &mExteriors[std::make_pair (x, y)]; + + loadCell (cell, new MWRender::ExteriorCellRender (*cell, mEnvironment, mScene)); + } + } + + // find current cell + CellRenderCollection::iterator iter = mActiveCells.begin(); + + while (iter!=mActiveCells.end()) + { + assert (!(iter->first->cell->data.flags & ESM::Cell::Interior)); + + if (X==iter->first->cell->data.gridX && + Y==iter->first->cell->data.gridY) + break; + + ++iter; + } + + assert (iter!=mActiveCells.end()); + + mCurrentCell = iter->first; + + // adjust player + playerCellChange (&mExteriors[std::make_pair (X, Y)], position, adjustPlayerPos); + + // Sky system + mWorld->adjustSky(); // FIXME + + mCellChanged = true; + + } + + Ptr Scene::getPtr (const std::string& name, bool activeOnly) + { + // the player is always in an active cell. + if (name=="player") + { + return mWorld->getPlayer().getPlayer(); + } + + // active cells + for (CellRenderCollection::iterator iter (mActiveCells.begin()); + iter!=mActiveCells.end(); ++iter) + { + Ptr ptr = getPtr (name, *iter->first); + + if (!ptr.isEmpty()) + return ptr; + } + + if (!activeOnly) + { + // TODO: inactive cells + } + + throw std::runtime_error ("unknown ID: " + name); + + } + + Ptr Scene::getPtrViaHandle (const std::string& handle) + { + if (mWorld->getPlayer().getPlayer().getRefData().getHandle()==handle) + return mWorld->getPlayer().getPlayer(); + + for (CellRenderCollection::iterator iter (mActiveCells.begin()); + iter!=mActiveCells.end(); ++iter) + { + Ptr ptr = getPtrViaHandle (handle, *iter->first); + + if (!ptr.isEmpty()) + return ptr; + } + + throw std::runtime_error ("unknown Ogre handle: " + handle); + + } + + void Scene::playerCellChange (Ptr::CellStore *cell, const ESM::Position& position, + bool adjustPlayerPos) + { + if (adjustPlayerPos) + mWorld->getPlayer().setPos (position.pos[0], position.pos[1], position.pos[2], false); + + mWorld->getPlayer().setCell (cell); + // TODO orientation + mEnvironment.mMechanicsManager->addActor (mWorld->getPlayer().getPlayer()); + mEnvironment.mMechanicsManager->watchActor (mWorld->getPlayer().getPlayer()); + + } + + void Scene::enable (Ptr reference) + { + if (!reference.getRefData().isEnabled()) + { + reference.getRefData().enable(); + + if (MWRender::CellRender *render = searchRender (reference.getCell())) + { + render->enable (reference.getRefData().getHandle()); + + if (mActiveCells.find (reference.getCell())!=mActiveCells.end()) + { + Class::get (reference).enable (reference, mEnvironment); //FIXME + } + } + } + } + + void Scene::disable (Ptr reference) + { + if (reference.getRefData().isEnabled()) + { + reference.getRefData().disable(); + + if (MWRender::CellRender *render = searchRender (reference.getCell())) + { + render->disable (reference.getRefData().getHandle()); + + if (mActiveCells.find (reference.getCell())!=mActiveCells.end()) + { + Class::get (reference).disable (reference, mEnvironment); + mEnvironment.mSoundManager->stopSound3D (reference); + } + } + } + } + + void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position) + { + SuppressDoingPhysics scopeGuard; + + // remove active + CellRenderCollection::iterator active = mActiveCells.begin(); + + while (active!=mActiveCells.end()) + { + unloadCell (active++); + } + + // Load cell. + mInteriors[cellName].loadInt (cellName, mWorld->getStore(), mWorld->getEsmReader()); + Ptr::CellStore *cell = &mInteriors[cellName]; + + loadCell (cell, new MWRender::InteriorCellRender (*cell, mEnvironment, mScene)); + + // adjust player + mCurrentCell = cell; + playerCellChange (cell, position, true); // FIXME + + // Sky system + mWorld->adjustSky(); // FIXME + + mCellChanged = true; + //currentRegion->name = ""; + } + + void Scene::changeToExteriorCell (const ESM::Position& position) + { + int x = 0; + int y = 0; + + mWorld->positionToIndex (position.pos[0], position.pos[1], x, y); + + 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; + } + + void Scene::deleteObject (Ptr ptr) + { + if (ptr.getRefData().getCount()>0) + { + ptr.getRefData().setCount (0); + + if (MWRender::CellRender *render = searchRender (ptr.getCell())) + { + if (mActiveCells.find (ptr.getCell())!=mActiveCells.end()) + { + Class::get (ptr).disable (ptr, mEnvironment); + mEnvironment.mSoundManager->stopSound3D (ptr); + + if (!DoingPhysics::isDoingPhysics()) + mScene.removeObject (ptr.getRefData().getHandle()); + } + + render->deleteObject (ptr.getRefData().getHandle()); + ptr.getRefData().setHandle (""); + } + } + } + + void Scene::moveObject (Ptr ptr, float x, float y, float z) + { + ptr.getCellRef().pos.pos[0] = x; + ptr.getCellRef().pos.pos[1] = y; + ptr.getCellRef().pos.pos[2] = z; + + if (ptr==mWorld->getPlayer().getPlayer()) + { + if (mCurrentCell) + { + if (!(mCurrentCell->cell->data.flags & ESM::Cell::Interior)) + { + // exterior -> adjust loaded cells + int cellX = 0; + int cellY = 0; + + mWorld->positionToIndex (x, y, cellX, cellY); + + if (mCurrentCell->cell->data.gridX!=cellX || mCurrentCell->cell->data.gridY!=cellY) + { + changeCell (cellX, cellY, mWorld->getPlayer().getPlayer().getCellRef().pos, false); + } + + } + } + } + + mScene.moveObject (ptr.getRefData().getHandle(), Ogre::Vector3 (x, y, z), + !DoingPhysics::isDoingPhysics()); + + // TODO cell change for non-player ref + } + +} diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp new file mode 100644 index 0000000000..97c04ebcf0 --- /dev/null +++ b/apps/openmw/mwworld/scene.hpp @@ -0,0 +1,65 @@ +#ifndef GAME_MWWORLD_SCENE_H +#define GAME_MWWORLD_SCENE_H + +#include +#include "ptr.hpp" +#include "environment.hpp" +#include "../mwrender/mwscene.hpp" + +namespace Render +{ + class OgreRenderer; +} + +namespace MWRender +{ + class SkyManager; + class CellRender; +} + +namespace MWWorld +{ + + class Scene + { + public: + Scene(Environment& environment, World *world, MWRender::MWScene scene); + + private: + + typedef std::map CellRenderCollection; + + CellRenderCollection mActiveCells; + Ptr::CellStore *mCurrentCell; // the cell, the player is in + std::map mInteriors; + std::map, Ptr::CellStore> mExteriors; + Environment& mEnvironment; + World *mWorld; + MWRender::MWScene mScene; + bool mCellChanged; + + Ptr getPtr (const std::string& name, Ptr::CellStore& cell); + Ptr getPtrViaHandle (const std::string& handle, Ptr::CellStore& cell); + + public: + + MWRender::CellRender *searchRender (Ptr::CellStore *store); + + void unloadCell (CellRenderCollection::iterator iter); + void loadCell (Ptr::CellStore *cell, MWRender::CellRender *render); + void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos); + Ptr getPtr (const std::string& name, bool activeOnly); + Ptr getPtrViaHandle (const std::string& handle); + void playerCellChange (Ptr::CellStore *cell, const ESM::Position& position, bool adjustPlayerPos); + void enable (Ptr reference); + void disable (Ptr reference); + void changeToInteriorCell (const std::string& cellName, const ESM::Position& position); + void changeToExteriorCell (const ESM::Position& position); + const ESM::Cell *getExterior (const std::string& cellName) const; + void deleteObject (Ptr ptr); + void moveObject (Ptr ptr, float x, float y, float z); + }; + +} + +#endif diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 063f54d6f8..f8fda8b056 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -1,4 +1,3 @@ - #include "world.hpp" #include @@ -466,6 +465,11 @@ namespace MWWorld { return mStore; } + + ESM::ESMReader& World::getEsmReader() + { + return mEsm; + } const World::ScriptList& World::getLocalScripts() const { @@ -694,6 +698,7 @@ namespace MWWorld void World::changeToInteriorCell (const std::string& cellName, const ESM::Position& position) { + return mWorldScene->changeToInteriorCell(cellName, position); SuppressDoingPhysics scopeGuard; // remove active @@ -904,3 +909,4 @@ namespace MWWorld return std::make_pair (stream.str(), created); } } + diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp index cccd8816df..f9ff4d7144 100644 --- a/apps/openmw/mwworld/world.hpp +++ b/apps/openmw/mwworld/world.hpp @@ -13,6 +13,7 @@ #include "refdata.hpp" #include "ptr.hpp" #include "globals.hpp" +#include "scene.hpp" #include @@ -66,6 +67,7 @@ namespace MWWorld MWRender::SkyManager* mSkyManager; MWRender::MWScene mScene; + MWWorld::Scene *mWorldScene; MWWorld::Player *mPlayer; Ptr::CellStore *mCurrentCell; // the cell, the player is in CellRenderCollection mActiveCells; @@ -87,8 +89,6 @@ namespace MWWorld World (const World&); World& operator= (const World&); - void insertInteriorScripts (ESMS::CellStore& cell); - Ptr getPtr (const std::string& name, Ptr::CellStore& cellStore); Ptr getPtrViaHandle (const std::string& handle, Ptr::CellStore& cellStore); @@ -106,8 +106,6 @@ namespace MWWorld void playerCellChange (Ptr::CellStore *cell, const ESM::Position& position, bool adjustPlayerPos = true); - void adjustSky(); - void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos); ///< Move from exterior to interior or from interior cell to a different /// interior cell. @@ -120,9 +118,15 @@ namespace MWWorld ~World(); + void insertInteriorScripts (ESMS::CellStore& cell); + + void adjustSky(); + MWWorld::Player& getPlayer(); const ESMS::ESMStore& getStore() const; + + ESM::ESMReader& getEsmReader(); const ScriptList& getLocalScripts() const; ///< Names and local variable state of all local scripts in active cells.