[c] Port of commit 9d49999: Changed SequenceTimeline to match AttachmentTimeline behavior.

This commit is contained in:
Mario Zechner 2024-11-15 15:34:59 +01:00
parent 90f6bfe49e
commit e327e9beb5

View File

@ -1937,6 +1937,15 @@ void _spSequenceTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
}
}
if (self->attachment->type == SP_ATTACHMENT_REGION) sequence = ((spRegionAttachment *) self->attachment)->sequence;
if (self->attachment->type == SP_ATTACHMENT_MESH) sequence = ((spMeshAttachment *) self->attachment)->sequence;
if (!sequence) return;
if (direction == SP_MIX_DIRECTION_OUT) {
if (blend == SP_MIX_BLEND_SETUP) slot->sequenceIndex = -1;
return;
}
frames = self->super.frames->items;
if (time < frames[0]) { /* Time is before first frame. */
if (blend == SP_MIX_BLEND_SETUP || blend == SP_MIX_BLEND_FIRST) slot->sequenceIndex = -1;
@ -1948,9 +1957,6 @@ void _spSequenceTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
modeAndIndex = (int) frames[i + MODE];
delay = frames[i + DELAY];
if (self->attachment->type == SP_ATTACHMENT_REGION) sequence = ((spRegionAttachment *) self->attachment)->sequence;
if (self->attachment->type == SP_ATTACHMENT_MESH) sequence = ((spMeshAttachment *) self->attachment)->sequence;
if (!sequence) return;
index = modeAndIndex >> 4;
count = sequence->regions->size;
mode = modeAndIndex & 0xf;