diff --git a/apps/openmw/mwrender/cellimp.cpp b/apps/openmw/mwrender/cellimp.cpp index 6df253b6d..ef323b4cd 100644 --- a/apps/openmw/mwrender/cellimp.cpp +++ b/apps/openmw/mwrender/cellimp.cpp @@ -5,7 +5,7 @@ using namespace MWRender; template -void insertObj(CellRenderImp& cellRender, const T& liveRef) +void insertObj(CellRenderImp& cellRender, T& liveRef) { assert (liveRef.base != NULL); const std::string &model = liveRef.base->model; @@ -13,12 +13,12 @@ void insertObj(CellRenderImp& cellRender, const T& liveRef) { cellRender.insertBegin (liveRef.ref); cellRender.insertMesh ("meshes\\" + model); - cellRender.insertEnd(); + liveRef.mData.mHandle = cellRender.insertEnd(); } } template<> -void insertObj(CellRenderImp& cellRender, const ESMS::LiveCellRef& liveRef) +void insertObj(CellRenderImp& cellRender, ESMS::LiveCellRef& liveRef) { assert (liveRef.base != NULL); const std::string &model = liveRef.base->model; @@ -36,21 +36,21 @@ void insertObj(CellRenderImp& cellRender, const ESMS::LiveCellRefdata.radius); cellRender.insertLight(r, g, b, radius); - cellRender.insertEnd(); + liveRef.mData.mHandle = cellRender.insertEnd(); } } template -void insertCellRefList (CellRenderImp& cellRender, const T& cellRefList) +void insertCellRefList (CellRenderImp& cellRender, T& cellRefList) { - for(typename T::List::const_iterator it = cellRefList.list.begin(); + for(typename T::List::iterator it = cellRefList.list.begin(); it != cellRefList.list.end(); it++) { insertObj (cellRender, *it); } } -void CellRenderImp::insertCell(const ESMS::CellStore &cell) +void CellRenderImp::insertCell(ESMS::CellStore &cell) { // Loop through all references in the cell insertCellRefList (*this, cell.activators); diff --git a/apps/openmw/mwrender/cellimp.hpp b/apps/openmw/mwrender/cellimp.hpp index cb3be42ab..9f3554bfd 100644 --- a/apps/openmw/mwrender/cellimp.hpp +++ b/apps/openmw/mwrender/cellimp.hpp @@ -24,7 +24,7 @@ namespace MWRender virtual ~CellRenderImp() {} /// start inserting a new reference. - virtual void insertBegin (const ESM::CellRef &ref) = 0; + virtual void insertBegin (ESM::CellRef &ref) = 0; /// insert a mesh related to the most recent insertBegin call. virtual void insertMesh(const std::string &mesh) = 0; @@ -35,7 +35,7 @@ namespace MWRender /// finish inserting a new reference and return a handle to it. virtual std::string insertEnd() = 0; - void insertCell(const ESMS::CellStore &cell); + void insertCell(ESMS::CellStore &cell); }; } diff --git a/apps/openmw/mwrender/interior.cpp b/apps/openmw/mwrender/interior.cpp index e85d09722..5cf38a5a1 100644 --- a/apps/openmw/mwrender/interior.cpp +++ b/apps/openmw/mwrender/interior.cpp @@ -27,7 +27,7 @@ bool InteriorCellRender::lightOutQuadInLin = false; // start inserting a new reference. -void InteriorCellRender::insertBegin (const ESM::CellRef &ref) +void InteriorCellRender::insertBegin (ESM::CellRef &ref) { assert (!insert); diff --git a/apps/openmw/mwrender/interior.hpp b/apps/openmw/mwrender/interior.hpp index 9ffe6aa79..f7ec786a3 100644 --- a/apps/openmw/mwrender/interior.hpp +++ b/apps/openmw/mwrender/interior.hpp @@ -42,7 +42,7 @@ namespace MWRender static bool lightOutQuadInLin; - const ESMS::CellStore &cell; + ESMS::CellStore &cell; MWScene &scene; /// The scene node that contains all objects belonging to this @@ -57,7 +57,7 @@ namespace MWRender Ogre::ColourValue ambientColor; /// start inserting a new reference. - virtual void insertBegin (const ESM::CellRef &ref); + virtual void insertBegin (ESM::CellRef &ref); /// insert a mesh related to the most recent insertBegin call. virtual void insertMesh(const std::string &mesh); @@ -78,7 +78,7 @@ namespace MWRender public: - InteriorCellRender(const ESMS::CellStore &_cell, MWScene &_scene) + InteriorCellRender(ESMS::CellStore &_cell, MWScene &_scene) : cell(_cell), scene(_scene), base(NULL), insert(NULL), ambientMode (0) {} virtual ~InteriorCellRender() { destroy(); } diff --git a/apps/openmw/refdata.hpp b/apps/openmw/refdata.hpp index a49084906..8726d2023 100644 --- a/apps/openmw/refdata.hpp +++ b/apps/openmw/refdata.hpp @@ -1,10 +1,13 @@ #ifndef REFDATA_H #define REFDATA_H +#include + namespace OMW { - class RefData + struct RefData { + std::string mHandle; };