From f4e893ef88ed89b95c658fb62e94c6826b3d411e Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Sat, 25 Sep 2021 20:34:25 -1000 Subject: [PATCH] Clean up. --- .../spine/attachments/SequenceAttachment.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SequenceAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SequenceAttachment.java index 3148c3f1f..40d4b8676 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SequenceAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SequenceAttachment.java @@ -52,28 +52,28 @@ public class SequenceAttachment /** Updates the {@link #attachment} with the {@link #regions region} for the slot's {@link Slot#getAttachmentTime()} and * returns it. */ public T updateAttachment (Slot slot) { - int frameIndex = (int)(slot.getAttachmentTime() / frameTime); + int index = (int)(slot.getAttachmentTime() / frameTime); switch (mode) { case forward: - frameIndex = Math.min(frameCount - 1, frameIndex); + index = Math.min(frameCount - 1, index); break; case backward: - frameIndex = Math.max(frameCount - frameIndex - 1, 0); + index = Math.max(frameCount - index - 1, 0); break; case forwardLoop: - frameIndex = frameIndex % frameCount; + index = index % frameCount; break; case backwardLoop: - frameIndex = frameCount - (frameIndex % frameCount) - 1; + index = frameCount - (index % frameCount) - 1; break; case pingPong: - frameIndex = frameIndex % (frameCount << 1); - if (frameIndex >= frameCount) frameIndex = frameCount - 1 - (frameIndex - frameCount); + index = index % (frameCount << 1); + if (index >= frameCount) index = frameCount - 1 - (index - frameCount); break; case random: - frameIndex = MathUtils.random(frameCount - 1); + index = MathUtils.random(frameCount - 1); } - attachment.setRegion(regions[frameIndex]); + attachment.setRegion(regions[index]); attachment.updateRegion(); return attachment; }