mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 13:23:53 +00:00
Feature #37 (In Progress) Render Path Grid
workaround for strange ESMStore bug
This commit is contained in:
parent
11f957a64d
commit
4659076129
4 changed files with 9 additions and 10 deletions
|
@ -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 <components/esm/loadstat.hpp>
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -123,8 +123,6 @@ namespace ESMS
|
|||
CellRefList<Static, D> statics;
|
||||
CellRefList<Weapon, D> 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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue