Fix build error and a pair of warnings

The error was about casting between osg::Callback* and osg::NodeCallback*
The warnings are both about virtual classes with non-virtual destructors
c++11
Alexander "Ace" Olofsson 10 years ago
parent 2065e0fa2d
commit 5d24091364

@ -93,6 +93,7 @@ protected:
boost::shared_ptr<float> mTimePtr; boost::shared_ptr<float> mTimePtr;
public: public:
virtual ~AnimationTime() { }
void setTimePtr(boost::shared_ptr<float> time) void setTimePtr(boost::shared_ptr<float> time)
{ mTimePtr = time; } { mTimePtr = time; }

@ -721,12 +721,12 @@ public:
if (stateset->getAttribute(osg::StateAttribute::MATERIAL)) if (stateset->getAttribute(osg::StateAttribute::MATERIAL))
{ {
SceneUtil::CompositeStateSetUpdater* composite = NULL; SceneUtil::CompositeStateSetUpdater* composite = NULL;
osg::NodeCallback* callback = node.getUpdateCallback(); osg::NodeCallback* callback = dynamic_cast<osg::NodeCallback*>(node.getUpdateCallback());
while (callback) while (callback)
{ {
if ((composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback))) if ((composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback)))
break; break;
callback = callback->getNestedCallback(); callback = dynamic_cast<osg::NodeCallback*>(callback->getNestedCallback());
} }
if (composite) if (composite)

@ -19,6 +19,8 @@ namespace MWRender
float mStartTime; float mStartTime;
public: public:
WeaponAnimationTime(Animation* animation) : mAnimation(animation), mStartTime(0) {} WeaponAnimationTime(Animation* animation) : mAnimation(animation), mStartTime(0) {}
virtual ~WeaponAnimationTime() { }
void setGroup(const std::string& group); void setGroup(const std::string& group);
void updateStartTime(); void updateStartTime();

Loading…
Cancel
Save