]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/animate.cpp
Stop the animation when the action ends
[libs/demoscene.git] / source / animate.cpp
index c7eed389dd917e6436ca685c5a74ff84cad723dc..1eff05d569d1a09a76be45ea69dde9d09a7a522f 100644 (file)
@@ -8,14 +8,17 @@ namespace DemoScene {
 
 Animate::Animate():
        target(0),
+       target_obj(0),
        anim(0),
        stacked(false),
        player(0)
 { }
 
-Animate::Animate(GL::Placeable &t, const GL::Animation &a, GL::AnimationPlayer &p):
+Animate::Animate(GL::Placeable &t, const GL::Animation &a, GL::AnimationPlayer &p, bool s):
        target(&t),
+       target_obj(0),
        anim(&a),
+       stacked(s),
        player(&p)
 { }
 
@@ -50,6 +53,11 @@ void Animate::start(float, float d)
        }
 }
 
+void Animate::end(float)
+{
+       player->stop(*target, *anim);
+}
+
 
 Animate::Loader::Loader(Animate &a, Demo &d):
        DataFile::DerivedObjectLoader<Animate, Action::Loader>(a, d)