From: Mikko Rasa Date: Sat, 8 Jun 2019 13:48:42 +0000 (+0300) Subject: Add stacked flag to Animate action X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=02613d179c906075a0ad05a3aae46b3811f322aa;p=libs%2Fdemoscene.git Add stacked flag to Animate action --- diff --git a/source/animate.cpp b/source/animate.cpp index 2812915..cd6cda1 100644 --- a/source/animate.cpp +++ b/source/animate.cpp @@ -9,6 +9,7 @@ namespace DemoScene { Animate::Animate(): target(0), anim(0), + stacked(false), 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; - 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); + add("stacked", &Animate::stacked); add("target", &Loader::target); } diff --git a/source/animate.h b/source/animate.h index 31d1641..30f0c52 100644 --- a/source/animate.h +++ b/source/animate.h @@ -24,6 +24,7 @@ public: private: Msp::GL::Placeable *target; const Msp::GL::Animation *anim; + bool stacked; Msp::GL::AnimationPlayer *player; public: