added a CellStore pointer to PlayerPos

pull/7/head
Marc Zinnschlag 15 years ago
parent 04b86f7e1e
commit fa50bbc77b

@ -6,6 +6,7 @@
#include <components/esm_store/cell_store.hpp>
#include "../mwworld/refdata.hpp"
#include "../mwworld/ptr.hpp"
namespace MWRender
{
@ -15,11 +16,12 @@ namespace MWRender
class PlayerPos
{
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> mPlayer;
MWWorld::Ptr::CellStore *mCellStore;
Ogre::Camera *camera;
public:
PlayerPos(Ogre::Camera *cam, const ESM::NPC *player) :
camera(cam)
mCellStore (0), camera(cam)
{
mPlayer.base = player;
mPlayer.ref.pos.pos[0] = mPlayer.ref.pos.pos[1] = mPlayer.ref.pos.pos[2] = 0;
@ -40,6 +42,11 @@ namespace MWRender
// TODO: Update sound listener
}
void setCell (MWWorld::Ptr::CellStore *cellStore)
{
mCellStore = cellStore;
}
Ogre::Camera *getCamera() { return camera; }

@ -183,6 +183,7 @@ namespace MWWorld
insertInteriorScripts (mInteriors[startCell]);
mPlayerPos = new MWRender::PlayerPos (mScene.getCamera(), mStore.npcs.find ("player"));
mPlayerPos->setCell (&mInteriors[startCell]);
// global variables
mGlobalVariables = new Globals (mStore);
@ -444,6 +445,7 @@ namespace MWWorld
insertInteriorScripts (mInteriors[cellName]);
mPlayerPos->setPos (position.pos[0], position.pos[1], position.pos[2]);
mPlayerPos->setCell (&mInteriors[cellName]);
// TODO orientation
// This connects the cell data with the rendering scene.

Loading…
Cancel
Save