X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanimate.cpp;h=cd6cda1d8faee1ccca2f6ecdd7cf19abefbf0c1b;hb=02613d179c906075a0ad05a3aae46b3811f322aa;hp=f30281d7b33401a745e621462dbe32d7c8ebfa1d;hpb=462cb9fc40ae7fec26615c652e95991be89ea8ae;p=libs%2Fdemoscene.git diff --git a/source/animate.cpp b/source/animate.cpp index f30281d..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) { } @@ -30,8 +31,13 @@ void Animate::validate() const void Animate::start(float, float d) { - float speed = (d ? (anim->get_duration()/Time::sec)/d : 1.0f); - player->play(*target, *anim, speed); + float speed = 1.0f; + if(!anim->is_looping() && d) + speed = (anim->get_duration()/Time::sec)/d; + if(stacked) + player->play_stacked(*target, *anim, speed); + else + player->play(*target, *anim, speed); } @@ -40,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); }