From 5d2409136429cc870ab9f3c09167dc92358a8f5c Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 1 Jul 2015 15:06:38 +0200 Subject: [PATCH] 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 --- apps/openmw/mwrender/animation.hpp | 1 + apps/openmw/mwrender/sky.cpp | 4 ++-- apps/openmw/mwrender/weaponanimation.hpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 73079e9a9..d45d19cf9 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -93,6 +93,7 @@ protected: boost::shared_ptr mTimePtr; public: + virtual ~AnimationTime() { } void setTimePtr(boost::shared_ptr time) { mTimePtr = time; } diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index dc43783ff..c7b0d3e41 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -721,12 +721,12 @@ public: if (stateset->getAttribute(osg::StateAttribute::MATERIAL)) { SceneUtil::CompositeStateSetUpdater* composite = NULL; - osg::NodeCallback* callback = node.getUpdateCallback(); + osg::NodeCallback* callback = dynamic_cast(node.getUpdateCallback()); while (callback) { if ((composite = dynamic_cast(callback))) break; - callback = callback->getNestedCallback(); + callback = dynamic_cast(callback->getNestedCallback()); } if (composite) diff --git a/apps/openmw/mwrender/weaponanimation.hpp b/apps/openmw/mwrender/weaponanimation.hpp index 3bf0fb721..fae459611 100644 --- a/apps/openmw/mwrender/weaponanimation.hpp +++ b/apps/openmw/mwrender/weaponanimation.hpp @@ -19,6 +19,8 @@ namespace MWRender float mStartTime; public: WeaponAnimationTime(Animation* animation) : mAnimation(animation), mStartTime(0) {} + virtual ~WeaponAnimationTime() { } + void setGroup(const std::string& group); void updateStartTime();