]> git.tdb.fi Git - libs/demoscene.git/commitdiff
Add stacked flag to Animate action
authorMikko Rasa <tdb@tdb.fi>
Sat, 8 Jun 2019 13:48:42 +0000 (16:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 8 Jun 2019 13:48:42 +0000 (16:48 +0300)
source/animate.cpp
source/animate.h

index 28129156796426e244593ad8787c1e2c6dcba894..cd6cda1d8faee1ccca2f6ecdd7cf19abefbf0c1b 100644 (file)
@@ -9,6 +9,7 @@ namespace DemoScene {
 Animate::Animate():
        target(0),
        anim(0),
 Animate::Animate():
        target(0),
        anim(0),
+       stacked(false),
        player(0)
 { }
 
        player(0)
 { }
 
@@ -33,7 +34,10 @@ void Animate::start(float, float d)
        float speed = 1.0f;
        if(!anim->is_looping() && d)
                speed = (anim->get_duration()/Time::sec)/d;
        float speed = 1.0f;
        if(!anim->is_looping() && d)
                speed = (anim->get_duration()/Time::sec)/d;
-       player->play(*target, *anim, speed);
+       if(stacked)
+               player->play_stacked(*target, *anim, speed);
+       else
+               player->play(*target, *anim, speed);
 }
 
 
 }
 
 
@@ -42,6 +46,7 @@ Animate::Loader::Loader(Animate &a, Demo &d):
 {
        a.player = &demo.get_animation_player();
        add("animation", &Loader::animation);
 {
        a.player = &demo.get_animation_player();
        add("animation", &Loader::animation);
+       add("stacked", &Animate::stacked);
        add("target", &Loader::target);
 }
 
        add("target", &Loader::target);
 }
 
index 31d1641c97b6ad696acc190fc02aed93e4dac286..30f0c527b9e952b0da433fa29e4073bd3f44f85e 100644 (file)
@@ -24,6 +24,7 @@ public:
 private:
        Msp::GL::Placeable *target;
        const Msp::GL::Animation *anim;
 private:
        Msp::GL::Placeable *target;
        const Msp::GL::Animation *anim;
+       bool stacked;
        Msp::GL::AnimationPlayer *player;
 
 public:
        Msp::GL::AnimationPlayer *player;
 
 public: