diff --git a/spine-c/spine-c/src/spine/AnimationState.c b/spine-c/spine-c/src/spine/AnimationState.c index d1aaaf80d..5d02d43ef 100644 --- a/spine-c/spine-c/src/spine/AnimationState.c +++ b/spine-c/spine-c/src/spine/AnimationState.c @@ -433,6 +433,8 @@ void _spAnimationState_applyRotateTimeline (spAnimationState* self, spTimeline* float total, diff; int /*boolean*/ current, dir; + if (firstFrame) timelinesRotation[i] = 0; + if (alpha == 1) { spTimeline_apply(timeline, skeleton, 0, time, 0, 0, 1, setupPose, 0); return; @@ -468,11 +470,7 @@ void _spAnimationState_applyRotateTimeline (spAnimationState* self, spTimeline* r1 = setupPose ? bone->data->rotation : bone->rotation; diff = r2 - r1; if (diff == 0) { - if (firstFrame) { - timelinesRotation[i] = 0; - total = 0; - } else - total = timelinesRotation[i]; + total = timelinesRotation[i]; } else { float lastTotal, lastDiff; diff -= (16384 - (int)(16384.499999999996 - diff / 360)) * 360; @@ -581,6 +579,8 @@ void _spAnimationState_setCurrent (spAnimationState* self, int index, spTrackEnt current->mixingFrom = from; current->mixTime = 0; + from->timelinesRotationCount = 0; + /* If not completely mixed in, set mixAlpha so mixing out happens from current mix to zero. */ if (from->mixingFrom) current->mixAlpha *= MIN(from->mixTime / from->mixDuration, 1); } diff --git a/spine-sfml/example/main.cpp b/spine-sfml/example/main.cpp index 4ac13458f..023081c1a 100644 --- a/spine-sfml/example/main.cpp +++ b/spine-sfml/example/main.cpp @@ -48,6 +48,7 @@ void callback (AnimationState* state, EventType type, TrackEntry* entry, Event* break; case ANIMATION_INTERRUPT: printf("%d interrupt: %s\n", entry->trackIndex, animationName); + break; case ANIMATION_END: printf("%d end: %s\n", entry->trackIndex, animationName); break; @@ -56,6 +57,7 @@ void callback (AnimationState* state, EventType type, TrackEntry* entry, Event* break; case ANIMATION_DISPOSE: printf("%d dispose: %s\n", entry->trackIndex, animationName); + break; case ANIMATION_EVENT: printf("%d event: %s, %s: %d, %f, %s\n", entry->trackIndex, animationName, event->data->name, event->intValue, event->floatValue, event->stringValue);