]> git.tdb.fi Git - libs/demoscene.git/commitdiff
Do not scale looping animation duration
authorMikko Rasa <tdb@tdb.fi>
Sat, 8 Jun 2019 07:16:48 +0000 (10:16 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 8 Jun 2019 07:16:48 +0000 (10:16 +0300)
source/animate.cpp

index f30281d7b33401a745e621462dbe32d7c8ebfa1d..28129156796426e244593ad8787c1e2c6dcba894 100644 (file)
@@ -30,7 +30,9 @@ void Animate::validate() const
 
 void Animate::start(float, float d)
 {
-       float speed = (d ? (anim->get_duration()/Time::sec)/d : 1.0f);
+       float speed = 1.0f;
+       if(!anim->is_looping() && d)
+               speed = (anim->get_duration()/Time::sec)/d;
        player->play(*target, *anim, speed);
 }