From 02613d179c906075a0ad05a3aae46b3811f322aa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 8 Jun 2019 16:48:42 +0300 Subject: [PATCH] Add stacked flag to Animate action --- source/animate.cpp | 7 ++++++- source/animate.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) 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: -- 2.43.0