]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animation.cpp
Add public functions for adding owned keyframes to Animation
[libs/gl.git] / source / animation.cpp
index 0d0ce75e951176dc3444b29c1b231b7f8c530735..0e4bd3e6ff26c26a4e4b7204c487fa6715148be7 100644 (file)
@@ -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())