Reduce includes in animation.hpp

c++11
scrawl 10 years ago
parent 9e049894e8
commit f017fd6860

@ -19,6 +19,8 @@
#include "character.hpp"
#include <iostream>
#include <osg/PositionAttitudeTransform>
#include "movement.hpp"

@ -17,6 +17,7 @@
#include <components/resource/texturemanager.hpp>
#include <components/nifosg/nifloader.hpp> // KeyframeHolder
#include <components/nifosg/controller.hpp>
#include <components/vfs/manager.hpp>
@ -204,6 +205,17 @@ namespace
namespace MWRender
{
struct Animation::AnimSource
{
osg::ref_ptr<const NifOsg::KeyframeHolder> mKeyframes;
typedef std::map<std::string, osg::ref_ptr<NifOsg::KeyframeController> > ControllerMap;
ControllerMap mControllerMap[Animation::sNumGroups];
const std::multimap<float, std::string>& getTextKeys();
};
class ResetAccumRootCallback : public osg::NodeCallback
{
public:
@ -1211,4 +1223,22 @@ namespace MWRender
addExtraLight(getOrCreateObjectRoot(), ptr.get<ESM::Light>()->mBase);
}
Animation::AnimState::~AnimState()
{
}
// ------------------------------
PartHolder::PartHolder(osg::ref_ptr<osg::Node> node)
: mNode(node)
{
}
PartHolder::~PartHolder()
{
if (mNode->getNumParents())
mNode->getParent(0)->removeChild(mNode);
}
}

@ -3,7 +3,7 @@
#include "../mwworld/ptr.hpp"
#include <components/nifosg/controller.hpp>
#include <components/sceneutil/controller.hpp>
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<osg::Node> node)
: mNode(node)
{
}
PartHolder(osg::ref_ptr<osg::Node> node);
~PartHolder()
{
if (mNode->getNumParents())
mNode->getParent(0)->removeChild(mNode);
}
~PartHolder();
osg::ref_ptr<osg::Node> getNode()
{
@ -116,16 +110,7 @@ protected:
}
};
struct AnimSource
{
osg::ref_ptr<const NifOsg::KeyframeHolder> mKeyframes;
typedef std::map<std::string, osg::ref_ptr<NifOsg::KeyframeController> > ControllerMap;
ControllerMap mControllerMap[sNumGroups];
const std::multimap<float, std::string>& getTextKeys();
};
struct AnimSource;
struct AnimState {
boost::shared_ptr<AnimSource> mSource;
@ -150,6 +135,8 @@ protected:
mPriority(0), mGroups(0), mAutoDisable(true)
{
}
~AnimState();
float getTime() const
{
return *mTime;

@ -1,6 +1,7 @@
#include "camera.hpp"
#include <osg/PositionAttitudeTransform>
#include <osg/Camera>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"

@ -1,5 +1,7 @@
#include "characterpreview.hpp"
#include <iostream>
#include <osg/Texture2D>
#include <osg/Camera>
#include <osg/PositionAttitudeTransform>

Loading…
Cancel
Save