소스 검색

TextureRegionAttachment -> HasTextureRegion.

Nathan Sweet 4 년 전
부모
커밋
920604dff7

+ 2 - 2
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java

@@ -87,7 +87,7 @@ import com.esotericsoftware.spine.attachments.PointAttachment;
 import com.esotericsoftware.spine.attachments.RegionAttachment;
 import com.esotericsoftware.spine.attachments.SequenceAttachment;
 import com.esotericsoftware.spine.attachments.SequenceAttachment.SequenceMode;
-import com.esotericsoftware.spine.attachments.TextureRegionAttachment;
+import com.esotericsoftware.spine.attachments.HasTextureRegion;
 import com.esotericsoftware.spine.attachments.VertexAttachment;
 
 /** Loads skeleton data in the Spine binary format.
@@ -543,7 +543,7 @@ public class SkeletonBinary extends SkeletonLoader {
 			SequenceMode mode = SequenceMode.values[input.readInt(true)];
 
 			if (attachment == null) return null;
-			String path = ((TextureRegionAttachment)attachment).getPath();
+			String path = ((HasTextureRegion)attachment).getPath();
 
 			SequenceAttachment sequence = attachmentLoader.newSequenceAttachment(skin, name, path, frameCount);
 			if (sequence == null) return null;

+ 2 - 2
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java

@@ -86,7 +86,7 @@ import com.esotericsoftware.spine.attachments.PointAttachment;
 import com.esotericsoftware.spine.attachments.RegionAttachment;
 import com.esotericsoftware.spine.attachments.SequenceAttachment;
 import com.esotericsoftware.spine.attachments.SequenceAttachment.SequenceMode;
-import com.esotericsoftware.spine.attachments.TextureRegionAttachment;
+import com.esotericsoftware.spine.attachments.HasTextureRegion;
 import com.esotericsoftware.spine.attachments.VertexAttachment;
 
 /** Loads skeleton data in the Spine JSON format.
@@ -475,7 +475,7 @@ public class SkeletonJson extends SkeletonLoader {
 		case sequence:
 			Attachment attachment = readAttachment(map.getChild("attachment"), skin, slotIndex, name, skeletonData);
 			if (attachment == null) return null;
-			String path = ((TextureRegionAttachment)attachment).getPath();
+			String path = ((HasTextureRegion)attachment).getPath();
 			int frameCount = map.getInt("count");
 			SequenceAttachment sequence = attachmentLoader.newSequenceAttachment(skin, name, path, frameCount);
 			if (sequence == null) return null;

+ 6 - 6
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/TextureRegionAttachment.java → spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/HasTextureRegion.java

@@ -4,7 +4,12 @@ package com.esotericsoftware.spine.attachments;
 import com.badlogic.gdx.graphics.Color;
 import com.badlogic.gdx.graphics.g2d.TextureRegion;
 
-public interface TextureRegionAttachment {
+public interface HasTextureRegion {
+	/** The name used to find the {@link #getRegion()}. */
+	public String getPath ();
+
+	public void setPath (String path);
+
 	/** Sets the region used to draw the attachment. If the region or its properties are changed, {@link #updateRegion()} must be
 	 * called. */
 	public void setRegion (TextureRegion region);
@@ -17,9 +22,4 @@ public interface TextureRegionAttachment {
 
 	/** The color to tint the attachment. */
 	public Color getColor ();
-
-	/** The name used to find the {@link #getRegion()}. */
-	public String getPath ();
-
-	public void setPath (String path);
 }

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java

@@ -40,7 +40,7 @@ import com.badlogic.gdx.utils.Null;
  * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
  * <p>
  * See <a href="http://esotericsoftware.com/spine-meshes">Mesh attachments</a> in the Spine User Guide. */
-public class MeshAttachment extends VertexAttachment implements TextureRegionAttachment {
+public class MeshAttachment extends VertexAttachment implements HasTextureRegion {
 	private TextureRegion region;
 	private String path;
 	private float[] regionUVs, uvs;

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java

@@ -40,7 +40,7 @@ import com.esotericsoftware.spine.Bone;
 /** An attachment that displays a textured quadrilateral.
  * <p>
  * See <a href="http://esotericsoftware.com/spine-regions">Region attachments</a> in the Spine User Guide. */
-public class RegionAttachment extends Attachment implements TextureRegionAttachment {
+public class RegionAttachment extends Attachment implements HasTextureRegion {
 	static public final int BLX = 0;
 	static public final int BLY = 1;
 	static public final int ULX = 2;

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SequenceAttachment.java

@@ -37,7 +37,7 @@ import com.esotericsoftware.spine.Slot;
 /** An attachment that applies a sequence of texture atlas regions to a region or mesh attachment.
  * <p>
  * See <a href="http://esotericsoftware.com/spine-sequences">Sequence attachments</a> in the Spine User Guide. */
-public class SequenceAttachment<T extends Attachment & TextureRegionAttachment> extends Attachment {
+public class SequenceAttachment<T extends Attachment & HasTextureRegion> extends Attachment {
 	private T attachment;
 	private String path;
 	private int frameCount;