From 2287256c72d445887166aa7a03ad5e095ccf48d2 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Fri, 28 Oct 2016 22:52:15 +0200 Subject: [PATCH] Minor updates. - Hid updateAppliedTransform, since the applied values aren't public API. - Made VertexAttachment#computeWorldVertices public, event though it may not be useful to subclasses like MeshAttachment. --- .../src/com/esotericsoftware/spine/AnimationState.java | 4 ++-- .../src/com/esotericsoftware/spine/Bone.java | 2 +- .../spine/attachments/BoundingBoxAttachment.java | 6 ++---- .../spine/attachments/PathAttachment.java | 9 +-------- .../spine/attachments/VertexAttachment.java | 10 +++++----- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index 7d7e0f61f..9e49adcfd 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -397,7 +397,7 @@ public class AnimationState { /** @see #setAnimation(int, Animation, boolean) */ public TrackEntry setAnimation (int trackIndex, String animationName, boolean loop) { - Animation animation = data.getSkeletonData().findAnimation(animationName); + Animation animation = data.skeletonData.findAnimation(animationName); if (animation == null) throw new IllegalArgumentException("Animation not found: " + animationName); return setAnimation(trackIndex, animation, loop); } @@ -427,7 +427,7 @@ public class AnimationState { /** {@link #addAnimation(int, Animation, boolean, float)} */ public TrackEntry addAnimation (int trackIndex, String animationName, boolean loop, float delay) { - Animation animation = data.getSkeletonData().findAnimation(animationName); + Animation animation = data.skeletonData.findAnimation(animationName); if (animation == null) throw new IllegalArgumentException("Animation not found: " + animationName); return addAnimation(trackIndex, animation, loop, delay); } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java index dac5b7556..783eb362c 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java @@ -379,7 +379,7 @@ public class Bone implements Updatable { * the applied transform after the world transform has been modified directly (eg, by a constraint). *

* Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */ - public void updateAppliedTransform () { + void updateAppliedTransform () { appliedValid = true; Bone parent = this.parent; if (parent == null) { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/BoundingBoxAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/BoundingBoxAttachment.java index cf5c56c9b..ec80dfbd5 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/BoundingBoxAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/BoundingBoxAttachment.java @@ -41,10 +41,8 @@ public class BoundingBoxAttachment extends VertexAttachment { super(name); } - public void computeWorldVertices (Slot slot, float[] worldVertices) { - computeWorldVertices(slot, 0, worldVerticesLength, worldVertices, 0); - } - + /** The color of the bounding box as it was in Spine. Available only when nonessential data was exported. Bounding boxes are + * not usually rendered at runtime. */ public Color getColor () { return color; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java index 44c28fb73..9f159a984 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java @@ -44,14 +44,7 @@ public class PathAttachment extends VertexAttachment { super(name); } - public void computeWorldVertices (Slot slot, float[] worldVertices) { - super.computeWorldVertices(slot, worldVertices); - } - - public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset) { - super.computeWorldVertices(slot, start, count, worldVertices, offset); - } - + /** If true, the start and end knots are connected. */ public boolean getClosed () { return closed; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java index e9729ba7f..f9a8ebf38 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java @@ -50,11 +50,11 @@ public class VertexAttachment extends Attachment { } /** Transforms local vertices to world coordinates. - * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y. - * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start. - * @param worldVertices The output world vertices. Must have a length >= offset + count. - * @param offset The worldVertices index to begin writing values. */ - protected void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset) { + * @param start The index of the first {@link #getVertices()} value to transform. Each vertex has 2 values, x and y. + * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start. + * @param worldVertices The output world vertices. Must have a length >= offset + count. + * @param offset The worldVertices index to begin writing values. */ + public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset) { count += offset; Skeleton skeleton = slot.getSkeleton(); FloatArray deformArray = slot.getAttachmentVertices();