فهرست منبع

Added images path to nonessential data.

NathanSweet 11 سال پیش
والد
کامیت
5f8dd415a5

+ 6 - 0
spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java

@@ -113,6 +113,12 @@ public class SkeletonBinary {
 			skeletonData.height = input.readFloat();
 
 			boolean nonessential = input.readBoolean();
+
+			if (nonessential) {
+				String imagesPath = input.readString();
+				if (imagesPath.length() > 0) skeletonData.imagesPath = imagesPath;
+			}
+
 			// Bones.
 			for (int i = 0, n = input.readInt(true); i < n; i++) {
 				String name = input.readString();

+ 15 - 2
spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java

@@ -42,7 +42,7 @@ public class SkeletonData {
 	final Array<Animation> animations = new Array();
 	final Array<IkConstraintData> ikConstraints = new Array();
 	float width, height;
-	String version, hash;
+	String version, hash, imagesPath;
 
 	// --- Bones.
 
@@ -197,23 +197,36 @@ public class SkeletonData {
 		this.height = height;
 	}
 
-	/** Returns the Spine version used to export this data. */
+	/** Returns the Spine version used to export this data, or null. */
 	public String getVersion () {
 		return version;
 	}
 
+	/** @param version May be null. */
 	public void setVersion (String version) {
 		this.version = version;
 	}
 
+	/** @return May be null. */
 	public String getHash () {
 		return hash;
 	}
 
+	/** @param hash May be null. */
 	public void setHash (String hash) {
 		this.hash = hash;
 	}
 
+	/** @return May be null. */
+	public String getImagesPath () {
+		return imagesPath;
+	}
+
+	/** @param imagesPath May be null. */
+	public void setImagesPath (String imagesPath) {
+		this.imagesPath = imagesPath;
+	}
+
 	public String toString () {
 		return name != null ? name : super.toString();
 	}

+ 1 - 0
spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java

@@ -99,6 +99,7 @@ public class SkeletonJson {
 			skeletonData.version = skeletonMap.getString("spine");
 			skeletonData.width = skeletonMap.getFloat("width");
 			skeletonData.height = skeletonMap.getFloat("height");
+			skeletonData.imagesPath = skeletonMap.getString("images", null);
 		}
 
 		// Bones.