diff --git a/spine-corona/spine/Animation.lua b/spine-corona/spine/Animation.lua index 7897931da..2b740cd06 100644 --- a/spine-corona/spine/Animation.lua +++ b/spine-corona/spine/Animation.lua @@ -138,6 +138,7 @@ function Animation.RotateTimeline.new () local self = Animation.CurveTimeline.new() self.frames = {} + self.boneIndex = -1 function self:getDuration () return self.frames[#self.frames - 1] @@ -207,6 +208,7 @@ function Animation.TranslateTimeline.new () local self = Animation.CurveTimeline.new() self.frames = {} + self.boneIndex = -1 function self:getDuration () return self.frames[#self.frames - 2] @@ -297,6 +299,7 @@ function Animation.ColorTimeline.new () local self = Animation.CurveTimeline.new() self.frames = {} + self.slotIndex = -1 function self:getDuration () return self.frames[#self.frames - 4] @@ -360,6 +363,7 @@ function Animation.AttachmentTimeline.new () local self = Animation.CurveTimeline.new() self.frames = {} self.attachmentNames = {} + self.slotName = nil function self:getDuration () return self.frames[#self.frames] diff --git a/spine-corona/spine/Skeleton.lua b/spine-corona/spine/Skeleton.lua index 0dbe95ec4..d3a2ba00d 100644 --- a/spine-corona/spine/Skeleton.lua +++ b/spine-corona/spine/Skeleton.lua @@ -143,11 +143,11 @@ function Skeleton.new (skeletonData, group) if not attachmentName then error("attachmentName cannot be nil.", 2) end local slotIndex = self.data:findSlotIndex(slotName) if slotIndex == -1 then error("Slot not found: " .. slotName, 2) end + if self.skin then return self.skin:getAttachment(slotIndex, attachmentName) end if self.data.defaultSkin then local attachment = self.data.defaultSkin:getAttachment(slotIndex, attachmentName) if attachment then return attachment end end - if self.skin then return self.skin:getAttachment(slotIndex, attachmentName) end return nil end diff --git a/spine-corona/spine/Slot.lua b/spine-corona/spine/Slot.lua index 64c712cb5..9a1b754f4 100644 --- a/spine-corona/spine/Slot.lua +++ b/spine-corona/spine/Slot.lua @@ -47,7 +47,7 @@ function Slot.new (slotData, skeleton, bone) self:setAttachment(attachment) end - self:setColor(255, 255, 255, 255) + self:setToBindPose() return self end diff --git a/spine-cpp/.cproject b/spine-cpp/.cproject index 3a8e10aed..b47094f53 100644 --- a/spine-cpp/.cproject +++ b/spine-cpp/.cproject @@ -31,7 +31,7 @@ - - @@ -254,6 +253,7 @@ + @@ -320,7 +320,6 @@ - @@ -339,9 +338,9 @@ - - + + @@ -364,6 +363,19 @@ - - + + @@ -544,19 +543,19 @@ - - - + + + @@ -671,7 +670,7 @@ - + @@ -685,9 +684,7 @@ - - - + @@ -721,15 +718,13 @@ - - - + - + diff --git a/spine-libgdx/src/com/esotericsoftware/spine/AttachmentLoader.java b/spine-libgdx/src/com/esotericsoftware/spine/AttachmentLoader.java index 674b0092c..e2fc9e106 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/AttachmentLoader.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/AttachmentLoader.java @@ -2,5 +2,6 @@ package com.esotericsoftware.spine; public interface AttachmentLoader { + /** @return May be null to not load any attachment. */ public Attachment newAttachment (AttachmentType type, String name); } diff --git a/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java b/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java index 1d590b904..9fdc16030 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java @@ -216,11 +216,11 @@ public class Skeleton { /** @return May be null. */ public Attachment getAttachment (int slotIndex, String attachmentName) { if (attachmentName == null) throw new IllegalArgumentException("attachmentName cannot be null."); + if (skin != null) return skin.getAttachment(slotIndex, attachmentName); if (data.defaultSkin != null) { Attachment attachment = data.defaultSkin.getAttachment(slotIndex, attachmentName); if (attachment != null) return attachment; } - if (skin != null) return skin.getAttachment(slotIndex, attachmentName); return null; } diff --git a/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java b/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java index 301452181..bbb52076f 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java @@ -103,7 +103,7 @@ public class SkeletonJson { int slotIndex = skeletonData.findSlotIndex(slotEntry.key); for (Entry attachmentEntry : ((OrderedMap)slotEntry.value).entries()) { Attachment attachment = readAttachment(attachmentEntry.key, attachmentEntry.value); - skin.addAttachment(slotIndex, attachmentEntry.key, attachment); + if (attachment != null) skin.addAttachment(slotIndex, attachmentEntry.key, attachment); } } skeletonData.addSkin(skin); diff --git a/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java b/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java index aca01dce8..c63be69cc 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java @@ -113,10 +113,6 @@ public class MixTest extends ApplicationAdapter { } public static void main (String[] args) throws Exception { - LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); - config.title = "Mix Test"; - config.width = 640; - config.height = 480; - new LwjglApplication(new MixTest(), config); + new LwjglApplication(new MixTest()); } } diff --git a/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java b/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java index b011b7915..7ecf6621b 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java @@ -114,10 +114,6 @@ public class SkeletonTest extends ApplicationAdapter { } public static void main (String[] args) throws Exception { - LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); - config.title = "Skeleton Test"; - config.width = 640; - config.height = 480; - new LwjglApplication(new SkeletonTest(), config); + new LwjglApplication(new SkeletonTest()); } }