From Cedric Pinson, Fix warning in osgAnimation, UpdateCallback. Fix bug removing callback in Action. Fix warning Stats

This commit is contained in:
Cedric Pinson
2009-10-29 16:09:07 +00:00
parent 50e10d52d7
commit 7e0a6fa68a
6 changed files with 23 additions and 13 deletions

View File

@@ -51,10 +51,12 @@ namespace osgAnimation
Callback* getNestedCallback() { return _nestedCallback.get(); }
void addNestedCallback(Callback* callback)
{
if (_nestedCallback.valid())
_nestedCallback->addNestedCallback(callback);
else
_nestedCallback = callback;
if (callback) {
if (_nestedCallback.valid())
_nestedCallback->addNestedCallback(callback);
else
_nestedCallback = callback;
}
}
void removeCallback(Callback* cb)
@@ -64,7 +66,7 @@ namespace osgAnimation
if (_nestedCallback.get() == cb)
_nestedCallback = _nestedCallback->getNestedCallback();
else
else if (_nestedCallback.valid())
_nestedCallback->removeCallback(cb);
}

View File

@@ -1,5 +1,5 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
@@ -10,7 +10,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
*/
#ifndef OSGANIMATION_TIMELINE_ANIMATION_MANAGER_H
#define OSGANIMATION_TIMELINE_ANIMATION_MANAGER_H

View File

@@ -37,11 +37,15 @@ namespace osgAnimation
class AnimationUpdateCallback : public AnimationUpdateCallbackBase, public T
{
public:
AnimationUpdateCallback() {}
AnimationUpdateCallback(const std::string& name) { T::setName(name);}
AnimationUpdateCallback(const AnimationUpdateCallback& apc,const osg::CopyOp& copyop):
T(apc, copyop) {}
META_Object(osgAnimation, AnimationUpdateCallback<T>);
const std::string& getName() const { return T::getName(); }
bool link(osgAnimation::Channel* channel) { return 0; }
int link(osgAnimation::Animation* animation)
{
if (T::getName().empty())