From 3dc750be8d2a7dd5fa7651c26b326c582db22d7b Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 14 Mar 2013 22:59:55 +0100 Subject: [PATCH 1/5] We'll stay with LWJGL backend for the examples. --- spine-libgdx/.classpath | 2 +- .../com/esotericsoftware/spine/AttachmentLoader.java | 1 + .../src/com/esotericsoftware/spine/SkeletonJson.java | 2 +- .../test/com/esotericsoftware/spine/MixTest.java | 10 +++------- .../test/com/esotericsoftware/spine/SkeletonTest.java | 10 +++------- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/spine-libgdx/.classpath b/spine-libgdx/.classpath index 962e3a64c..6cc66c9d2 100644 --- a/spine-libgdx/.classpath +++ b/spine-libgdx/.classpath @@ -2,7 +2,7 @@ - + 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/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 85e987e6f..c63be69cc 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/MixTest.java @@ -3,8 +3,8 @@ package com.esotericsoftware.spine; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.jglfw.JglfwApplication; -import com.badlogic.gdx.backends.jglfw.JglfwApplicationConfiguration; +import com.badlogic.gdx.backends.lwjgl.LwjglApplication; +import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.g2d.SpriteBatch; @@ -113,10 +113,6 @@ public class MixTest extends ApplicationAdapter { } public static void main (String[] args) throws Exception { - JglfwApplicationConfiguration config = new JglfwApplicationConfiguration(); - config.title = "Mix Test"; - config.width = 640; - config.height = 480; - new JglfwApplication(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 71cc84453..7ecf6621b 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java @@ -5,8 +5,8 @@ import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.InputAdapter; -import com.badlogic.gdx.backends.jglfw.JglfwApplication; -import com.badlogic.gdx.backends.jglfw.JglfwApplicationConfiguration; +import com.badlogic.gdx.backends.lwjgl.LwjglApplication; +import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; @@ -114,10 +114,6 @@ public class SkeletonTest extends ApplicationAdapter { } public static void main (String[] args) throws Exception { - JglfwApplicationConfiguration config = new JglfwApplicationConfiguration(); - config.title = "Skeleton Test"; - config.width = 640; - config.height = 480; - new JglfwApplication(new SkeletonTest(), config); + new LwjglApplication(new SkeletonTest()); } } From a1ad55f8a1333820cd2b79f0c0d9cd68623aa318 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Fri, 15 Mar 2013 01:41:24 +0100 Subject: [PATCH 2/5] Documented memory ownership. Clean up and minor improvements. --- spine-cpp/.cproject | 2 +- spine-cpp/data/spineboy-walk.json | 22 --------- spine-cpp/includes/spine-sfml/Atlas.h | 6 +-- spine-cpp/includes/spine-sfml/Skeleton.h | 2 +- spine-cpp/includes/spine-sfml/SkeletonJson.h | 1 + spine-cpp/includes/spine/Animation.h | 45 ++++++++--------- spine-cpp/includes/spine/BaseAtlas.h | 5 +- .../includes/spine/BaseAttachmentLoader.h | 4 +- spine-cpp/includes/spine/BaseSkeleton.h | 8 +-- spine-cpp/includes/spine/BaseSkeletonJson.h | 3 +- spine-cpp/includes/spine/Bone.h | 1 + spine-cpp/includes/spine/BoneData.h | 4 +- spine-cpp/includes/spine/SkeletonData.h | 6 ++- spine-cpp/includes/spine/Skin.h | 5 +- spine-cpp/includes/spine/Slot.h | 1 + spine-cpp/includes/spine/SlotData.h | 20 +------- spine-cpp/src/spine-sfml/Atlas.cpp | 8 ++- spine-cpp/src/spine-sfml/RegionAttachment.cpp | 4 +- spine-cpp/src/spine-sfml/SkeletonJson.cpp | 4 +- spine-cpp/src/spine/Animation.cpp | 49 ++++++++----------- spine-cpp/src/spine/BaseAtlas.cpp | 7 ++- spine-cpp/src/spine/BaseRegionAttachment.cpp | 4 +- spine-cpp/src/spine/BaseSkeleton.cpp | 13 ++--- spine-cpp/src/spine/BaseSkeletonJson.cpp | 44 +++++++++-------- spine-cpp/src/spine/Bone.cpp | 2 +- spine-cpp/src/spine/SkeletonData.cpp | 12 ++--- spine-cpp/src/spine/Skin.cpp | 12 ++--- spine-cpp/src/spine/Slot.cpp | 5 +- spine-cpp/src/spine/SlotData.cpp | 25 ++++++++++ 29 files changed, 164 insertions(+), 160 deletions(-) create mode 100644 spine-cpp/src/spine/SlotData.cpp 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 @@ -