Fixed animation state delay when not set right away.

This commit is contained in:
NathanSweet 2013-10-22 11:41:57 +02:00
parent 03610fcaad
commit a9315d46f3
5 changed files with 13 additions and 18 deletions

View File

@ -200,10 +200,9 @@ public class AnimationState {
_tracks[trackIndex] = entry;
if (delay <= 0) {
if (last) {
if (last.time < last.endTime) delay += last.endTime - last.time;
delay -= _data.getMix(last.animation, animation);
} else
if (last)
delay += last.endTime - _data.getMix(last.animation, animation);
else
delay = 0;
}
entry.delay = delay;

View File

@ -262,10 +262,9 @@ spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIn
self->tracks[trackIndex] = entry;
if (delay <= 0) {
if (last) {
if (last->time < last->endTime) delay += last->endTime - last->time;
delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
} else
if (last)
delay += last->endTime - spAnimationStateData_getMix(self->data, last->animation, animation);
else
delay = 0;
}
entry->delay = delay;

View File

@ -213,10 +213,9 @@ namespace Spine {
tracks[trackIndex] = entry;
if (delay <= 0) {
if (last != null) {
if (last.time < last.endTime) delay += last.endTime - last.time;
delay -= data.GetMix(last.animation, animation);
} else
if (last != null)
delay += last.endTime - data.GetMix(last.animation, animation);
else
delay = 0;
}
entry.delay = delay;

View File

@ -231,10 +231,9 @@ public class AnimationState {
tracks.set(trackIndex, entry);
if (delay <= 0) {
if (last != null) {
if (last.time < last.endTime) delay += last.endTime - last.time;
delay -= data.getMix(last.animation, animation);
} else
if (last != null)
delay += last.endTime - data.getMix(last.animation, animation);
else
delay = 0;
}
entry.delay = delay;

View File

@ -200,8 +200,7 @@ function AnimationState.new (data)
delay = delay or 0
if delay <= 0 then
if last then
if last.time < last.endTime then delay = delay + last.endTime - last.time end
delay = delay - self.data:getMix(last.animation.name, animation.name)
delay = delay + last.endTime - self.data:getMix(last.animation.name, animation.name)
else
delay = 0
end