From f017fd6860dffd36a051e09824671ae5bdf19a92 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 14 Jun 2015 23:13:26 +0200 Subject: [PATCH] Reduce includes in animation.hpp --- apps/openmw/mwmechanics/character.cpp | 2 ++ apps/openmw/mwrender/animation.cpp | 30 +++++++++++++++++++++++ apps/openmw/mwrender/animation.hpp | 27 ++++++-------------- apps/openmw/mwrender/camera.cpp | 1 + apps/openmw/mwrender/characterpreview.cpp | 2 ++ 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index ea6b394816..c48599b465 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -19,6 +19,8 @@ #include "character.hpp" +#include + #include #include "movement.hpp" diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 261ec6c5b5..4f0cde61d1 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -17,6 +17,7 @@ #include #include // KeyframeHolder +#include #include @@ -204,6 +205,17 @@ namespace namespace MWRender { + struct Animation::AnimSource + { + osg::ref_ptr mKeyframes; + + typedef std::map > ControllerMap; + + ControllerMap mControllerMap[Animation::sNumGroups]; + + const std::multimap& getTextKeys(); + }; + class ResetAccumRootCallback : public osg::NodeCallback { public: @@ -1211,4 +1223,22 @@ namespace MWRender addExtraLight(getOrCreateObjectRoot(), ptr.get()->mBase); } + Animation::AnimState::~AnimState() + { + + } + + // ------------------------------ + + PartHolder::PartHolder(osg::ref_ptr node) + : mNode(node) + { + } + + PartHolder::~PartHolder() + { + if (mNode->getNumParents()) + mNode->getParent(0)->removeChild(mNode); + } + } diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 419ae6bc01..d80fd96a4f 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -3,7 +3,7 @@ #include "../mwworld/ptr.hpp" -#include +#include namespace ESM { @@ -18,6 +18,7 @@ namespace Resource namespace NifOsg { class KeyframeHolder; + class KeyframeController; } namespace MWRender @@ -43,16 +44,9 @@ public: class PartHolder { public: - PartHolder(osg::ref_ptr node) - : mNode(node) - { - } + PartHolder(osg::ref_ptr node); - ~PartHolder() - { - if (mNode->getNumParents()) - mNode->getParent(0)->removeChild(mNode); - } + ~PartHolder(); osg::ref_ptr getNode() { @@ -116,16 +110,7 @@ protected: } }; - struct AnimSource - { - osg::ref_ptr mKeyframes; - - typedef std::map > ControllerMap; - - ControllerMap mControllerMap[sNumGroups]; - - const std::multimap& getTextKeys(); - }; + struct AnimSource; struct AnimState { boost::shared_ptr mSource; @@ -150,6 +135,8 @@ protected: mPriority(0), mGroups(0), mAutoDisable(true) { } + ~AnimState(); + float getTime() const { return *mTime; diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp index 9080d31644..316c9308be 100644 --- a/apps/openmw/mwrender/camera.cpp +++ b/apps/openmw/mwrender/camera.cpp @@ -1,6 +1,7 @@ #include "camera.hpp" #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index cdf99f0fc9..d6c30da971 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -1,5 +1,7 @@ #include "characterpreview.hpp" +#include + #include #include #include