diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index bbee7498a..c390f697a 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,7 +16,7 @@ set(GAME_HEADER source_group(game FILES ${GAME} ${GAME_HEADER}) add_openmw_dir (mwrender - renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface + renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface ) add_openmw_dir (mwinput diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp new file mode 100644 index 000000000..aed0b5ae0 --- /dev/null +++ b/apps/openmw/mwworld/refdata.cpp @@ -0,0 +1,88 @@ + +#include "refdata.hpp" + +namespace MWWorld +{ + RefData::RefData (const ESMS::CellRef& cellRef) + : mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mPosition (cellRef.pos) + {} + + std::string RefData::getHandle() + { + return mBaseNode->getName(); + } + + Ogre::SceneNode* RefData::getBaseNode() + { + return mBaseNode; + } + + void RefData::setBaseNode(Ogre::SceneNode* base) + { + mBaseNode = base; + } + + int RefData::getCount() const + { + return mCount; + } + + void RefData::setLocals (const ESM::Script& script) + { + if (!mHasLocals) + { + mLocals.configure (script); + mHasLocals = true; + } + } + + void RefData::setCount (int count) + { + mCount = count; + } + + MWScript::Locals& RefData::getLocals() + { + return mLocals; + } + + bool RefData::isEnabled() const + { + return mEnabled; + } + + void RefData::enable() + { + mEnabled = true; + } + + void RefData::disable() + { + mEnabled = true; + } + + boost::shared_ptr& RefData::getCreatureStats() + { + return mCreatureStats; + } + + boost::shared_ptr& RefData::getNpcStats() + { + return mNpcStats; + } + + boost::shared_ptr& RefData::getMovement() + { + return mMovement; + } + + boost::shared_ptr >& RefData::getContainerStore() + { + return mContainerStore; + } + + ESM::Position& RefData::getPosition() + { + return mPosition; + } +} diff --git a/apps/openmw/mwworld/refdata.hpp b/apps/openmw/mwworld/refdata.hpp index 9a91a27b5..7875c2e12 100644 --- a/apps/openmw/mwworld/refdata.hpp +++ b/apps/openmw/mwworld/refdata.hpp @@ -5,6 +5,8 @@ #include +#include + #include "../mwscript/locals.hpp" #include "../mwmechanics/creaturestats.hpp" @@ -12,7 +14,6 @@ #include "../mwmechanics/movement.hpp" #include "containerstore.hpp" -#include namespace ESM { @@ -45,90 +46,45 @@ namespace MWWorld ESM::Position mPosition; - public: - /// @param cr Used to copy constant data such as position into this class where it can - /// be altered without effecting the original data. This makes it possible - /// to reset the position as the orignal data is still held in the CellRef - RefData(const ESMS::CellRef& cr) : mBaseNode(0), mHasLocals (false), mEnabled (true), - mCount (1), mPosition(cr.pos) {} - - - std::string getHandle() - { - return mBaseNode->getName(); - } - Ogre::SceneNode* getBaseNode(){ - return mBaseNode; - } - void setBaseNode(Ogre::SceneNode* base){ - mBaseNode = base; - } - - int getCount() const - { - return mCount; - } - - void setLocals (const ESM::Script& script) - { - if (!mHasLocals) - { - mLocals.configure (script); - mHasLocals = true; - } - } - - - void setCount (int count) - { - mCount = count; - } - - MWScript::Locals& getLocals() - { - return mLocals; - } - - bool isEnabled() const - { - return mEnabled; - } - - void enable() - { - mEnabled = true; - } - - void disable() - { - mEnabled = true; - } - - boost::shared_ptr& getCreatureStats() - { - return mCreatureStats; - } - - boost::shared_ptr& getNpcStats() - { - return mNpcStats; - } - - boost::shared_ptr& getMovement() - { - return mMovement; - } - - boost::shared_ptr >& getContainerStore() - { - return mContainerStore; - } - - ESM::Position& getPosition() - { - return mPosition; - } + + /// @param cellRef Used to copy constant data such as position into this class where it can + /// be altered without effecting the original data. This makes it possible + /// to reset the position as the orignal data is still held in the CellRef + RefData (const ESMS::CellRef& cellRef); + + /// Return OGRE handle (may be empty). + std::string getHandle(); + + /// Return OGRE base node (can be a null pointer). + Ogre::SceneNode* getBaseNode(); + + /// Set OGRE base node (can be a null pointer). + void setBaseNode (Ogre::SceneNode* base); + + int getCount() const; + + void setLocals (const ESM::Script& script); + + void setCount (int count); + + MWScript::Locals& getLocals(); + + bool isEnabled() const; + + void enable(); + + void disable(); + + boost::shared_ptr& getCreatureStats(); + + boost::shared_ptr& getNpcStats(); + + boost::shared_ptr& getMovement(); + + boost::shared_ptr >& getContainerStore(); + + ESM::Position& getPosition(); }; }