mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[cpp] Port of commit 9d49999: Changed SequenceTimeline to match AttachmentTimeline behavior.
This commit is contained in:
parent
308c340cc9
commit
90f6bfe49e
@ -74,6 +74,15 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec
|
|||||||
if (slotAttachment != _attachment) {
|
if (slotAttachment != _attachment) {
|
||||||
if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment *) slotAttachment)->getTimelineAttachment() != _attachment) return;
|
if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment *) slotAttachment)->getTimelineAttachment() != _attachment) return;
|
||||||
}
|
}
|
||||||
|
Sequence *sequence = NULL;
|
||||||
|
if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence();
|
||||||
|
if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence();
|
||||||
|
if (!sequence) return;
|
||||||
|
|
||||||
|
if (direction == MixDirection_Out) {
|
||||||
|
if (blend == MixBlend_Setup) slot->setSequenceIndex(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vector<float> &frames = this->_frames;
|
Vector<float> &frames = this->_frames;
|
||||||
if (time < frames[0]) {// Time is before first frame.
|
if (time < frames[0]) {// Time is before first frame.
|
||||||
@ -86,10 +95,6 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec
|
|||||||
int modeAndIndex = (int) frames[i + MODE];
|
int modeAndIndex = (int) frames[i + MODE];
|
||||||
float delay = frames[i + DELAY];
|
float delay = frames[i + DELAY];
|
||||||
|
|
||||||
Sequence *sequence = NULL;
|
|
||||||
if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence();
|
|
||||||
if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence();
|
|
||||||
if (!sequence) return;
|
|
||||||
int index = modeAndIndex >> 4, count = (int) sequence->getRegions().size();
|
int index = modeAndIndex >> 4, count = (int) sequence->getRegions().size();
|
||||||
int mode = modeAndIndex & 0xf;
|
int mode = modeAndIndex & 0xf;
|
||||||
if (mode != SequenceMode::hold) {
|
if (mode != SequenceMode::hold) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user