Browse Source

Porting over recent change from AnimationState.c to AnimationState.cpp

Stephen Gowen 7 years ago
parent
commit
162cbeec72
1 changed files with 7 additions and 3 deletions
  1. 7 3
      spine-cpp/spine-cpp/src/spine/AnimationState.cpp

+ 7 - 3
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -568,9 +568,13 @@ namespace Spine {
             if (delay <= 0) {
                 float duration = last->_animationEnd - last->_animationStart;
                 if (duration != 0) {
-                    delay += duration * (1 + (int)(last->_trackTime / duration)) - _data.getMix(last->_animation, animation);
-                }
-                else {
+                    if (last->_loop) {
+                        delay += duration * (1 + (int)(last->_trackTime / duration));
+                    } else {
+                        delay += duration;
+                    }
+                    delay -= _data.getMix(last->_animation, animation);
+                } else {
                     delay = 0;
                 }
             }