From 4efd63f89cb995cbe4f30358d268a9d0eaf0c9be Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Sat, 18 Jun 2022 18:48:26 -0400 Subject: [PATCH] [libgdx] Use linked mesh sequence properties when inheriting a sequence timeline. Also allow a linked mesh with no sequence when the source mesh has one. --- .../src/com/esotericsoftware/spine/Animation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index e3e45a533..3bd8bf011 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -2471,6 +2471,8 @@ public class Animation { if (!(slotAttachment instanceof VertexAttachment) || ((VertexAttachment)slotAttachment).getTimelineAttachment() != attachment) return; } + Sequence sequence = ((HasTextureRegion)slotAttachment).getSequence(); + if (sequence == null) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. @@ -2483,7 +2485,7 @@ public class Animation { int modeAndIndex = (int)frames[i + MODE]; float delay = frames[i + DELAY]; - int index = modeAndIndex >> 4, count = attachment.getSequence().getRegions().length; + int index = modeAndIndex >> 4, count = sequence.getRegions().length; SequenceMode mode = SequenceMode.values[modeAndIndex & 0xf]; if (mode != SequenceMode.hold) { index += (time - before) / delay + 0.00001f;