From 496466a1cce752ed9729bacf1606090324a4b85f Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 10 May 2014 15:33:00 +0200 Subject: [PATCH] Hull length is no longer nonessential. --- spine-c/include/spine/MeshAttachment.h | 2 +- spine-c/include/spine/SkinnedMeshAttachment.h | 2 +- spine-csharp/src/Attachments/MeshAttachment.cs | 2 +- spine-csharp/src/Attachments/SkinnedMeshAttachment.cs | 2 +- .../src/com/esotericsoftware/spine/SkeletonBinary.java | 4 ++-- .../com/esotericsoftware/spine/attachments/Attachment.java | 2 +- .../esotericsoftware/spine/attachments/MeshAttachment.java | 2 +- .../spine/attachments/SkinnedMeshAttachment.java | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spine-c/include/spine/MeshAttachment.h b/spine-c/include/spine/MeshAttachment.h index 859a0eec6..8d0f1e989 100644 --- a/spine-c/include/spine/MeshAttachment.h +++ b/spine-c/include/spine/MeshAttachment.h @@ -46,6 +46,7 @@ struct spMeshAttachment { int verticesCount; float* vertices; + int hullLength; int uvsCount; float* regionUVs; @@ -64,7 +65,6 @@ struct spMeshAttachment { int/*bool*/regionRotate; /* Nonessential. */ - int hullLength; int edgesCount; int* edges; float width, height; diff --git a/spine-c/include/spine/SkinnedMeshAttachment.h b/spine-c/include/spine/SkinnedMeshAttachment.h index c04c3fbcd..9e3966edb 100644 --- a/spine-c/include/spine/SkinnedMeshAttachment.h +++ b/spine-c/include/spine/SkinnedMeshAttachment.h @@ -55,6 +55,7 @@ struct spSkinnedMeshAttachment { int uvsCount; float* regionUVs; float* uvs; + int hullLength; float r, g, b, a; @@ -66,7 +67,6 @@ struct spSkinnedMeshAttachment { int/*bool*/regionRotate; /* Nonessential. */ - int hullLength; int edgesCount; int* edges; float width, height; diff --git a/spine-csharp/src/Attachments/MeshAttachment.cs b/spine-csharp/src/Attachments/MeshAttachment.cs index f007d7055..8060a0604 100644 --- a/spine-csharp/src/Attachments/MeshAttachment.cs +++ b/spine-csharp/src/Attachments/MeshAttachment.cs @@ -38,6 +38,7 @@ namespace Spine { internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight; internal float r = 1, g = 1, b = 1, a = 1; + public int HullLength { get; set; } public float[] Vertices { get { return vertices; } set { vertices = value; } } public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } } public float[] UVs { get { return uvs; } set { uvs = value; } } @@ -63,7 +64,6 @@ namespace Spine { public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size. // Nonessential. - public int HullLength { get; set; } public int[] Edges { get; set; } public float Width { get; set; } public float Height { get; set; } diff --git a/spine-csharp/src/Attachments/SkinnedMeshAttachment.cs b/spine-csharp/src/Attachments/SkinnedMeshAttachment.cs index 38dd17180..ebd662827 100644 --- a/spine-csharp/src/Attachments/SkinnedMeshAttachment.cs +++ b/spine-csharp/src/Attachments/SkinnedMeshAttachment.cs @@ -40,6 +40,7 @@ namespace Spine { internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight; internal float r = 1, g = 1, b = 1, a = 1; + public int HullLength { get; set; } public int[] Bones { get { return bones; } set { bones = value; } } public float[] Weights { get { return weights; } set { weights = value; } } public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } } @@ -66,7 +67,6 @@ namespace Spine { public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size. // Nonessential. - public int HullLength { get; set; } public int[] Edges { get; set; } public float Width { get; set; } public float Height { get; set; } diff --git a/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java b/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java index 7c9c3ace2..d171c1719 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java @@ -234,9 +234,9 @@ public class SkeletonBinary { mesh.setRegionUVs(uvs); mesh.updateUVs(); Color.rgba8888ToColor(mesh.getColor(), input.readInt()); + mesh.setHullLength(input.readInt(true) * 2); if (nonessential) { mesh.setEdges(readIntArray(input)); - mesh.setHullLength(input.readInt(true) * 2); mesh.setWidth(input.readFloat() * scale); mesh.setHeight(input.readFloat() * scale); } @@ -270,9 +270,9 @@ public class SkeletonBinary { mesh.setRegionUVs(uvs); mesh.updateUVs(); Color.rgba8888ToColor(mesh.getColor(), input.readInt()); + mesh.setHullLength(input.readInt(true) * 2); if (nonessential) { mesh.setEdges(readIntArray(input)); - mesh.setHullLength(input.readInt(true) * 2); mesh.setWidth(input.readFloat() * scale); mesh.setHeight(input.readFloat() * scale); } diff --git a/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java b/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java index 1d68e578f..de6f1e9d2 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java @@ -43,6 +43,6 @@ abstract public class Attachment { } public String toString () { - return name; + return getName(); } } diff --git a/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java b/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java index ad5ebe422..dc8d40477 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java @@ -48,9 +48,9 @@ public class MeshAttachment extends Attachment { private short[] triangles; private float[] worldVertices; private final Color color = new Color(1, 1, 1, 1); + private int hullLength; // Nonessential. - private int hullLength; private int[] edges; private float width, height; diff --git a/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkinnedMeshAttachment.java b/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkinnedMeshAttachment.java index a9dcfa9c7..7f52b8a86 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkinnedMeshAttachment.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkinnedMeshAttachment.java @@ -49,11 +49,11 @@ public class SkinnedMeshAttachment extends Attachment { private short[] triangles; private float[] worldVertices; private final Color color = new Color(1, 1, 1, 1); + private int hullLength; // Nonessential. private int[] edges; private float width, height; - private int hullLength; public SkinnedMeshAttachment (String name) { super(name);