From 2d6e048d88f8a076608fff29cdb0387b8c582a09 Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 1 Jul 2022 13:59:38 +0200 Subject: [PATCH] Fix C4589 msvc warning Constructor of abstract class 'SceneUtil::KeyframeController' ignores initializer for virtual base class 'osg::Object' --- components/nifosg/controller.cpp | 3 ++- components/sceneutil/keyframe.hpp | 5 ++--- components/sceneutil/osgacontroller.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/nifosg/controller.cpp b/components/nifosg/controller.cpp index 071541c196..b2beead8bd 100644 --- a/components/nifosg/controller.cpp +++ b/components/nifosg/controller.cpp @@ -71,7 +71,8 @@ KeyframeController::KeyframeController() } KeyframeController::KeyframeController(const KeyframeController ©, const osg::CopyOp ©op) - : SceneUtil::KeyframeController(copy, copyop) + : osg::Object(copy, copyop) + , SceneUtil::KeyframeController(copy) , SceneUtil::NodeCallback(copy, copyop) , mRotations(copy.mRotations) , mXRotations(copy.mXRotations) diff --git a/components/sceneutil/keyframe.hpp b/components/sceneutil/keyframe.hpp index 59a87ab08e..eee8d6646c 100644 --- a/components/sceneutil/keyframe.hpp +++ b/components/sceneutil/keyframe.hpp @@ -17,9 +17,8 @@ namespace SceneUtil public: KeyframeController() {} - KeyframeController(const KeyframeController& copy, const osg::CopyOp& copyop) - : osg::Object(copy, copyop) - , SceneUtil::Controller(copy) {} + KeyframeController(const KeyframeController& copy) + : SceneUtil::Controller(copy) {} virtual osg::Vec3f getTranslation(float time) const { return osg::Vec3f(); } diff --git a/components/sceneutil/osgacontroller.cpp b/components/sceneutil/osgacontroller.cpp index 4d0f7a460a..0f9cf4ce6e 100644 --- a/components/sceneutil/osgacontroller.cpp +++ b/components/sceneutil/osgacontroller.cpp @@ -68,8 +68,11 @@ namespace SceneUtil traverse( node ); } - OsgAnimationController::OsgAnimationController(const OsgAnimationController ©, const osg::CopyOp ©op) : SceneUtil::KeyframeController(copy, copyop), SceneUtil::NodeCallback(copy, copyop) - , mEmulatedAnimations(copy.mEmulatedAnimations) + OsgAnimationController::OsgAnimationController(const OsgAnimationController ©, const osg::CopyOp ©op) + : osg::Object(copy, copyop) + , SceneUtil::KeyframeController(copy) + , SceneUtil::NodeCallback(copy, copyop) + , mEmulatedAnimations(copy.mEmulatedAnimations) { mLinker = nullptr; for (const auto& mergedAnimationTrack : copy.mMergedAnimationTracks)