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 77d9686ed..45dc14296 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -871,8 +871,8 @@ public class AnimationState { * References to a track entry must not be kept after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ static public class TrackEntry implements Poolable { Animation animation; - TrackEntry next, mixingFrom, mixingTo; - AnimationStateListener listener; + @Null TrackEntry next, mixingFrom, mixingTo; + @Null AnimationStateListener listener; int trackIndex; boolean loop, holdPrevious, reverse; float eventThreshold, attachmentThreshold, drawOrderThreshold; 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 b4485c4b7..2fd2d58c3 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java @@ -47,7 +47,7 @@ import com.esotericsoftware.spine.BoneData.TransformMode; public class Bone implements Updatable { final BoneData data; final Skeleton skeleton; - final Bone parent; + @Null final Bone parent; final Array children = new Array(); float x, y, rotation, scaleX, scaleY, shearX, shearY; float ax, ay, arotation, ascaleX, ascaleY, ashearX, ashearY; @@ -66,7 +66,7 @@ public class Bone implements Updatable { setToSetupPose(); } - /** Copy constructor. Does not copy the children bones. */ + /** Copy constructor. Does not copy the {@link #getChildren()} bones. */ public Bone (Bone bone, Skeleton skeleton, @Null Bone parent) { if (bone == null) throw new IllegalArgumentException("bone cannot be null."); if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java index 94bb5a0b6..519b132ef 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java @@ -36,7 +36,7 @@ import com.badlogic.gdx.utils.Null; public class BoneData { final int index; final String name; - final BoneData parent; + @Null final BoneData parent; float length; float x, y, rotation, scaleX = 1, scaleY = 1, shearX, shearY; TransformMode transformMode = TransformMode.normal; @@ -187,7 +187,7 @@ public class BoneData { this.skinRequired = skinRequired; } - /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually + /** The color of the bone as it was in Spine, or a default color if nonessential data was not exported. Bones are not usually * rendered at runtime. */ public Color getColor () { return color; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java index b6b111045..005fa0a81 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java @@ -57,7 +57,7 @@ public class Skeleton { final Array pathConstraints; final Array updateCache = new Array(); final Array updateCacheReset = new Array(); - Skin skin; + @Null Skin skin; final Color color; float time; float scaleX = 1, scaleY = 1; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java index 8319d57be..b8430593f 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java @@ -37,22 +37,22 @@ import com.badlogic.gdx.utils.Null; * See Data objects in the Spine Runtimes * Guide. */ public class SkeletonData { - String name; + @Null String name; final Array bones = new Array(); // Ordered parents first. final Array slots = new Array(); // Setup pose draw order. final Array skins = new Array(); - Skin defaultSkin; + @Null Skin defaultSkin; final Array events = new Array(); final Array animations = new Array(); final Array ikConstraints = new Array(); final Array transformConstraints = new Array(); final Array pathConstraints = new Array(); float x, y, width, height; - String version, hash; + @Null String version, hash; // Nonessential. float fps = 30; - String imagesPath, audioPath; + @Null String imagesPath, audioPath; // --- Bones. @@ -217,7 +217,8 @@ public class SkeletonData { // --- - /** The skeleton's name, which by default is the name of the skeleton data file, if possible. */ + /** The skeleton's name, which by default is the name of the skeleton data file when possible, or null when a name hasn't been + * set. */ public @Null String getName () { return name; } @@ -280,7 +281,7 @@ public class SkeletonData { this.hash = hash; } - /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. */ + /** The path to the images directory as defined in Spine, or null if nonessential data was not exported. */ public @Null String getImagesPath () { return imagesPath; } @@ -289,7 +290,7 @@ public class SkeletonData { this.imagesPath = imagesPath; } - /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. */ + /** The path to the audio directory as defined in Spine, or null if nonessential data was not exported. */ public @Null String getAudioPath () { return audioPath; } @@ -298,7 +299,7 @@ public class SkeletonData { this.audioPath = audioPath; } - /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */ + /** The dopesheet FPS in Spine, or zero if nonessential data was not exported. */ public float getFps () { return fps; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java index 231f5489c..eda7c9122 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java @@ -53,7 +53,7 @@ public class SkeletonRenderer { private boolean premultipliedAlpha; private final FloatArray vertices = new FloatArray(32); private final SkeletonClipping clipper = new SkeletonClipping(); - private VertexEffect vertexEffect; + private @Null VertexEffect vertexEffect; private final Vector2 temp = new Vector2(); private final Vector2 temp2 = new Vector2(); private final Color temp3 = new Color(); @@ -110,9 +110,9 @@ public class SkeletonRenderer { batch.setBlendFunction(blendMode.getSource(premultipliedAlpha), blendMode.getDest()); } - float c = NumberUtils.intToFloatColor(((int)alpha << 24) // - | ((int)(b * slotColor.b * color.b * multiplier) << 16) // - | ((int)(g * slotColor.g * color.g * multiplier) << 8) // + float c = NumberUtils.intToFloatColor((int)alpha << 24 // + | (int)(b * slotColor.b * color.b * multiplier) << 16 // + | (int)(g * slotColor.g * color.g * multiplier) << 8 // | (int)(r * slotColor.r * color.r * multiplier)); float[] uvs = region.getUVs(); for (int u = 0, v = 2; u < 8; u += 2, v += 5) { @@ -219,9 +219,9 @@ public class SkeletonRenderer { batch.setBlendFunction(blendMode.getSource(premultipliedAlpha), blendMode.getDest()); } - float c = NumberUtils.intToFloatColor(((int)alpha << 24) // - | ((int)(b * slotColor.b * color.b * multiplier) << 16) // - | ((int)(g * slotColor.g * color.g * multiplier) << 8) // + float c = NumberUtils.intToFloatColor((int)alpha << 24 // + | (int)(b * slotColor.b * color.b * multiplier) << 16 // + | (int)(g * slotColor.g * color.g * multiplier) << 8 // | (int)(r * slotColor.r * color.r * multiplier)); if (clipper.isClipping()) { @@ -345,9 +345,9 @@ public class SkeletonRenderer { float red = r * color.r * multiplier; float green = g * color.g * multiplier; float blue = b * color.b * multiplier; - float light = NumberUtils.intToFloatColor(((int)alpha << 24) // - | ((int)(blue * lightColor.b) << 16) // - | ((int)(green * lightColor.g) << 8) // + float light = NumberUtils.intToFloatColor((int)alpha << 24 // + | (int)(blue * lightColor.b) << 16 // + | (int)(green * lightColor.g) << 8 // | (int)(red * lightColor.r)); Color darkColor = slot.getDarkColor(); float dark = darkColor == null ? 0 diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java index 7b65396d9..7f83eb642 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java @@ -160,7 +160,7 @@ public class Skin { static public class SkinEntry { int slotIndex; String name; - Attachment attachment; + @Null Attachment attachment; private int hashCode; SkinEntry (int slotIndex, String name, @Null Attachment attachment) { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java index a71a9fa2d..14e72e832 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java @@ -43,8 +43,9 @@ import com.esotericsoftware.spine.attachments.VertexAttachment; public class Slot { final SlotData data; final Bone bone; - final Color color = new Color(), darkColor; - Attachment attachment; + final Color color = new Color(); + @Null final Color darkColor; + @Null Attachment attachment; private float attachmentTime; private FloatArray deform = new FloatArray(); diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java index f002cf454..d7b511f97 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java @@ -38,8 +38,8 @@ public class SlotData { final String name; final BoneData boneData; final Color color = new Color(1, 1, 1, 1); - Color darkColor; - String attachmentName; + @Null Color darkColor; + @Null String attachmentName; BlendMode blendMode; public SlotData (int index, String name, BoneData boneData) { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java index 53d59fcba..eda9d722d 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java @@ -41,7 +41,7 @@ public interface AttachmentLoader { /** @return May be null to not load the attachment. */ public @Null RegionAttachment newRegionAttachment (Skin skin, String name, String path); - /** @return May be null to not load the attachment. */ + /** @return May be null to not load the attachment. In that case null should also be returned for child meshes. */ public @Null MeshAttachment newMeshAttachment (Skin skin, String name, String path); /** @return May be null to not load the attachment. */ 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 812c99091..e0b8e737a 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 @@ -46,8 +46,8 @@ public class BoundingBoxAttachment extends VertexAttachment { super(name); } - /** 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. */ + /** The color of the bounding box as it was in Spine, or a default color if nonessential data was not 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/ClippingAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/ClippingAttachment.java index 7f4aa3b81..8bbf823ad 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/ClippingAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/ClippingAttachment.java @@ -30,12 +30,13 @@ package com.esotericsoftware.spine.attachments; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.Null; import com.esotericsoftware.spine.SlotData; /** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */ public class ClippingAttachment extends VertexAttachment { - SlotData endSlot; + @Null SlotData endSlot; // Nonessential. final Color color = new Color(0.2275f, 0.2275f, 0.8078f, 1); // ce3a3aff @@ -44,18 +45,18 @@ public class ClippingAttachment extends VertexAttachment { super(name); } - /** Clipping is performed between the clipping polygon's slot and the end slot. Returns -1 if clipping is done until the end of + /** Clipping is performed between the clipping attachment's slot and the end slot. If null clipping is done until the end of * the skeleton's rendering. */ - public SlotData getEndSlot () { + public @Null SlotData getEndSlot () { return endSlot; } - public void setEndSlot (SlotData endSlot) { + public void setEndSlot (@Null SlotData endSlot) { this.endSlot = endSlot; } - /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons - * are not usually rendered at runtime. */ + /** The color of the clipping attachment as it was in Spine, or a default color if nonessential data was not exported. Clipping + * attachments are not usually rendered at runtime. */ public Color getColor () { return color; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java index 7904e16cc..7977ed687 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java @@ -47,10 +47,10 @@ public class MeshAttachment extends VertexAttachment { private short[] triangles; private final Color color = new Color(1, 1, 1, 1); private int hullLength; - private MeshAttachment parentMesh; + private @Null MeshAttachment parentMesh; // Nonessential. - private short[] edges; + private @Null short[] edges; private float width, height; public MeshAttachment (String name) { @@ -188,13 +188,13 @@ public class MeshAttachment extends VertexAttachment { this.edges = edges; } - /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if - * nonessential data was exported. Triangulation is not performed at runtime. */ - public short[] getEdges () { + /** Vertex index pairs describing edges for controlling triangulation, or be null if nonessential data was not exported. Mesh + * triangles will never cross edges. Triangulation is not performed at runtime. */ + public @Null short[] getEdges () { return edges; } - /** The width of the mesh's image. Available only when nonessential data was exported. */ + /** The width of the mesh's image, or zero if nonessential data was not exported. */ public float getWidth () { return width; } @@ -203,7 +203,7 @@ public class MeshAttachment extends VertexAttachment { this.width = width; } - /** The height of the mesh's image. Available only when nonessential data was exported. */ + /** The height of the mesh's image, or zero if nonessential data was not exported. */ public float getHeight () { return height; } @@ -215,7 +215,7 @@ public class MeshAttachment extends VertexAttachment { /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */ - public MeshAttachment getParentMesh () { + public @Null MeshAttachment getParentMesh () { return parentMesh; } 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 a59e8091a..383bd4da8 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 @@ -77,7 +77,7 @@ public class PathAttachment extends VertexAttachment { this.lengths = lengths; } - /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually + /** The color of the path as it was in Spine, or a default color if nonessential data was not exported. Paths are not usually * rendered at runtime. */ public Color getColor () { return color; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java index 6b801c4f3..11aa27926 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java @@ -75,8 +75,8 @@ public class PointAttachment extends Attachment { this.rotation = rotation; } - /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments - * are not usually rendered at runtime. */ + /** The color of the point attachment as it was in Spine, or a default clor if nonessential data was not exported. Point + * attachments are not usually rendered at runtime. */ public Color getColor () { return color; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java index 75fea6ac9..aa1172a2f 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java @@ -35,7 +35,7 @@ import com.esotericsoftware.spine.Skeleton; /** Attachment that displays a skeleton. */ public class SkeletonAttachment extends Attachment { - private Skeleton skeleton; + private @Null Skeleton skeleton; public SkeletonAttachment (String name) { super(name); 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 608ec44a1..5208a071f 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 @@ -44,10 +44,10 @@ abstract public class VertexAttachment extends Attachment { static private int nextID; private final int id = nextID(); - int[] bones; + @Null int[] bones; float[] vertices; int worldVerticesLength; - VertexAttachment deformAttachment = this; + @Null VertexAttachment deformAttachment = this; public VertexAttachment (String name) { super(name);