mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 21:59:09 +08:00
[cpp] Port of commit 8290353. Fix for hold previous on 3+ animations causing dipping. See #1738.
This commit is contained in:
parent
6d833f36d1
commit
0405d239ea
@ -290,8 +290,9 @@ void EventQueue::drain() {
|
|||||||
|
|
||||||
const int Subsequent = 0;
|
const int Subsequent = 0;
|
||||||
const int First = 1;
|
const int First = 1;
|
||||||
const int Hold = 2;
|
const int HoldSubsequent = 2;
|
||||||
const int HoldMix = 3;
|
const int HoldFirst = 3;
|
||||||
|
const int HoldMix = 4;
|
||||||
|
|
||||||
const int Setup = 1;
|
const int Setup = 1;
|
||||||
const int Current = 2;
|
const int Current = 2;
|
||||||
@ -836,7 +837,11 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
|
|||||||
timelineBlend = MixBlend_Setup;
|
timelineBlend = MixBlend_Setup;
|
||||||
alpha = alphaMix;
|
alpha = alphaMix;
|
||||||
break;
|
break;
|
||||||
case Hold:
|
case HoldSubsequent:
|
||||||
|
timelineBlend = blend;
|
||||||
|
alpha = alphaHold;
|
||||||
|
break;
|
||||||
|
case HoldFirst:
|
||||||
timelineBlend = MixBlend_Setup;
|
timelineBlend = MixBlend_Setup;
|
||||||
alpha = alphaHold;
|
alpha = alphaHold;
|
||||||
break;
|
break;
|
||||||
@ -1007,8 +1012,12 @@ void AnimationState::computeHold(TrackEntry *entry) {
|
|||||||
if (to != NULL && to->_holdPrevious) {
|
if (to != NULL && to->_holdPrevious) {
|
||||||
for (size_t i = 0; i < timelinesCount; i++) {
|
for (size_t i = 0; i < timelinesCount; i++) {
|
||||||
int id = timelines[i]->getPropertyId();
|
int id = timelines[i]->getPropertyId();
|
||||||
if (!_propertyIDs.containsKey(id)) _propertyIDs.put(id, true);
|
if (!_propertyIDs.containsKey(id)) {
|
||||||
timelineMode[i] = Hold;
|
_propertyIDs.put(id, true);
|
||||||
|
timelineMode[i] = HoldFirst;
|
||||||
|
} else {
|
||||||
|
timelineMode[i] = HoldSubsequent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1039,7 +1048,7 @@ void AnimationState::computeHold(TrackEntry *entry) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
timelineMode[i] = Hold;
|
timelineMode[i] = HoldFirst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user