diff --git a/apps/openmw/mwrender/debugging.cpp b/apps/openmw/mwrender/debugging.cpp index f1e601af5..8df4850db 100644 --- a/apps/openmw/mwrender/debugging.cpp +++ b/apps/openmw/mwrender/debugging.cpp @@ -10,6 +10,7 @@ #include "OgreTextureManager.h" #include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone +#include "../mwworld/environment.hpp" #include "../mwworld/ptr.hpp" #include #include @@ -19,8 +20,8 @@ using namespace MWRender; using namespace Ogre; -Debugging::Debugging(const ESMS::ESMStore &store, SceneManager* sceneMgr, OEngine::Physic::PhysicEngine *engine) : - mStore(store), mSceneMgr(sceneMgr), mEngine(engine), pathgridEnabled(false) +Debugging::Debugging(MWWorld::Environment &env, SceneManager* sceneMgr, OEngine::Physic::PhysicEngine *engine) : + mEnvironment(env), mSceneMgr(sceneMgr), mEngine(engine), pathgridEnabled(false) { } @@ -83,7 +84,7 @@ void Debugging::togglePathgrid() void Debugging::togglePathgridForCell(MWWorld::Ptr::CellStore *store, bool enabled) { - ESM::Pathgrid *pathgrid = mStore.pathgrids.search(*store->cell); + ESM::Pathgrid *pathgrid = mEnvironment.mWorld->getStore().pathgrids.search(*store->cell); if (!pathgrid) { std::cout << "No path grid :(" << std::endl; diff --git a/apps/openmw/mwrender/debugging.hpp b/apps/openmw/mwrender/debugging.hpp index 2258fec21..2b47eb773 100644 --- a/apps/openmw/mwrender/debugging.hpp +++ b/apps/openmw/mwrender/debugging.hpp @@ -23,6 +23,7 @@ namespace Ogre namespace MWWorld { class World; + class Environment; } namespace MWRender @@ -33,7 +34,8 @@ namespace MWRender { OEngine::Physic::PhysicEngine* mEngine; Ogre::SceneManager* mSceneMgr; - const ESMS::ESMStore& mStore; + MWWorld::Environment& mEnvironment; + //const ESMS::ESMStore& mStore; // Path grid stuff bool pathgridEnabled; @@ -53,7 +55,7 @@ namespace MWRender void togglePathgridForCell(MWWorld::Ptr::CellStore *store, bool enabled); public: - Debugging(const ESMS::ESMStore &store, Ogre::SceneManager *mSceneMgr, OEngine::Physic::PhysicEngine* engine); + Debugging(MWWorld::Environment &env, Ogre::SceneManager *mSceneMgr, OEngine::Physic::PhysicEngine* engine); bool toggleRenderMode (int mode); void cellAdded(MWWorld::Ptr::CellStore* store); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 94197108d..4cb8b42fa 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -24,7 +24,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const { mRendering.createScene("PlayerCam", 55, 5); - mDebugging = new Debugging(environment.mWorld->getStore(), mRendering.getScene(), engine); + mDebugging = new Debugging(environment, mRendering.getScene(), engine); // Set default mipmap level (NB some APIs ignore this) TextureManager::getSingleton().setDefaultNumMipmaps(5); diff --git a/components/esm_store/cell_store.hpp b/components/esm_store/cell_store.hpp index 4f5b6b6ec..c4bcf84d8 100644 --- a/components/esm_store/cell_store.hpp +++ b/components/esm_store/cell_store.hpp @@ -123,8 +123,6 @@ namespace ESMS CellRefList statics; CellRefList weapons; - ESM::Pathgrid *pathgrid; - void load (const ESMStore &store, ESMReader &esm) { if (mState!=State_Loaded) @@ -136,8 +134,6 @@ namespace ESMS loadRefs (store, esm); - pathgrid = store.pathgrids.search(*cell); - mState = State_Loaded; } }