From 1a9270245626b21c7fe9083e642b334611f30b7a Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 22 Jun 2017 10:35:08 +0200 Subject: [PATCH] Less odd control flow. End result is the same. --- .../com/esotericsoftware/spine/Animation.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) 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 ab610daa4..ca87c4f15 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -930,10 +930,19 @@ public class Animation { float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment; - switch (pose) { case setup: - break; + float[] zeroVertices; + if (vertexAttachment.getBones() == null) { + // Unweighted vertex positions (setup pose). + zeroVertices = vertexAttachment.getVertices(); + } else { + // Weighted deform offsets (zeros). + zeroVertices = zeros; + if (zeroVertices.length < vertexCount) zeros = zeroVertices = new float[vertexCount]; + } + System.arraycopy(zeroVertices, 0, vertices, 0, vertexCount); + return; case current: if (alpha == 1) break; if (vertexAttachment.getBones() == null) { @@ -947,21 +956,7 @@ public class Animation { for (int i = 0; i < vertexCount; i++) vertices[i] *= alpha; } - // Fall thru. - default: - return; } - - float[] zeroVertices; - if (vertexAttachment.getBones() == null) { - // Unweighted vertex positions (setup pose). - zeroVertices = vertexAttachment.getVertices(); - } else { - // Weighted deform offsets (zeros). - zeroVertices = zeros; - if (zeroVertices.length < vertexCount) zeros = zeroVertices = new float[vertexCount]; - } - System.arraycopy(zeroVertices, 0, vertices, 0, vertexCount); return; }