Skip to content

Commit 90f6bfe

Browse files
committed
[cpp] Port of commit 9d49999: Changed SequenceTimeline to match AttachmentTimeline behavior.
1 parent 308c340 commit 90f6bfe

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

spine-cpp/spine-cpp/src/spine/SequenceTimeline.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec
7474
if (slotAttachment != _attachment) {
7575
if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment *) slotAttachment)->getTimelineAttachment() != _attachment) return;
7676
}
77+
Sequence *sequence = NULL;
78+
if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence();
79+
if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence();
80+
if (!sequence) return;
81+
82+
if (direction == MixDirection_Out) {
83+
if (blend == MixBlend_Setup) slot->setSequenceIndex(-1);
84+
return;
85+
}
7786

7887
Vector<float> &frames = this->_frames;
7988
if (time < frames[0]) {// Time is before first frame.
@@ -86,10 +95,6 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec
8695
int modeAndIndex = (int) frames[i + MODE];
8796
float delay = frames[i + DELAY];
8897

89-
Sequence *sequence = NULL;
90-
if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence();
91-
if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence();
92-
if (!sequence) return;
9398
int index = modeAndIndex >> 4, count = (int) sequence->getRegions().size();
9499
int mode = modeAndIndex & 0xf;
95100
if (mode != SequenceMode::hold) {

0 commit comments

Comments
 (0)