|
@@ -334,11 +334,11 @@ void AnimationState::update(float delta) {
|
|
|
float nextTime = current._trackLast - next->_delay;
|
|
float nextTime = current._trackLast - next->_delay;
|
|
|
if (nextTime >= 0) {
|
|
if (nextTime >= 0) {
|
|
|
next->_delay = 0;
|
|
next->_delay = 0;
|
|
|
- next->_trackTime = nextTime + (delta * next->_timeScale);
|
|
|
|
|
|
|
+ next->_trackTime = (nextTime / current._timeScale + delta) * next->_timeScale;
|
|
|
current._trackTime += currentDelta;
|
|
current._trackTime += currentDelta;
|
|
|
setCurrent(i, next, true);
|
|
setCurrent(i, next, true);
|
|
|
while (next->_mixingFrom != NULL) {
|
|
while (next->_mixingFrom != NULL) {
|
|
|
- next->_mixTime += currentDelta;
|
|
|
|
|
|
|
+ next->_mixTime += delta;
|
|
|
next = next->_mixingFrom;
|
|
next = next->_mixingFrom;
|
|
|
}
|
|
}
|
|
|
continue;
|
|
continue;
|
|
@@ -728,14 +728,8 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
|
|
|
return finished;
|
|
return finished;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (to->_timeScale == 0 && to->_mixingTo) {
|
|
|
|
|
- to->_timeScale = 1;
|
|
|
|
|
- to->_mixTime = 0;
|
|
|
|
|
- to->_mixDuration = 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
from->_trackTime += delta * from->_timeScale;
|
|
from->_trackTime += delta * from->_timeScale;
|
|
|
- to->_mixTime += delta * to->_timeScale;
|
|
|
|
|
|
|
+ to->_mixTime += delta;
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -783,6 +777,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
|
|
|
from->_totalAlpha = 0;
|
|
from->_totalAlpha = 0;
|
|
|
for (size_t i = 0; i < timelineCount; i++) {
|
|
for (size_t i = 0; i < timelineCount; i++) {
|
|
|
Timeline *timeline = timelines[i];
|
|
Timeline *timeline = timelines[i];
|
|
|
|
|
+ MixDirection direction = MixDirection_Out;
|
|
|
MixBlend timelineBlend;
|
|
MixBlend timelineBlend;
|
|
|
float alpha;
|
|
float alpha;
|
|
|
switch (timelineMode[i]) {
|
|
switch (timelineMode[i]) {
|
|
@@ -811,8 +806,15 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
|
|
|
applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
|
|
applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
|
|
|
firstFrame);
|
|
firstFrame);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if (timelineBlend == MixBlend_Setup) {
|
|
|
|
|
+ if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) {
|
|
|
|
|
+ if (attachments) direction = MixDirection_In;
|
|
|
|
|
+ } else if (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti)) {
|
|
|
|
|
+ if (drawOrder) direction = MixDirection_In;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend,
|
|
timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend,
|
|
|
- MixDirection_Out);
|
|
|
|
|
|
|
+ direction);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|