X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.cpp;h=0e4bd3e6ff26c26a4e4b7204c487fa6715148be7;hp=0d0ce75e951176dc3444b29c1b231b7f8c530735;hb=f88bce7df357cf12ce20b7dc8c7d179d2ae95920;hpb=6e528ad728ed93f2016bc9f4204a9d906576300e diff --git a/source/animation.cpp b/source/animation.cpp index 0d0ce75e..0e4bd3e6 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -50,6 +50,12 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame &kf) create_curves(); } +void Animation::add_keyframe_owned(const Time::TimeDelta &t, const KeyFrame *kf) +{ + add_keyframe(t, kf, false, true); + create_curves(); +} + void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame &kf, float slope) { add_keyframe(t, &kf, slope, slope, false); @@ -70,6 +76,14 @@ void Animation::add_control_keyframe(const KeyFrame &kf) add_keyframe(keyframes.back().time, &kf, true, false); } +void Animation::add_control_keyframe_owned(const KeyFrame *kf) +{ + if(keyframes.empty()) + throw invalid_operation("Animation::add_control_keyframe_owned"); + + add_keyframe(keyframes.back().time, kf, true, true); +} + void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame *kf, float ss, float es, bool owned) { if(keyframes.empty())