瀏覽代碼

[cpp][sfml] Backported changes from 3.7-beta-cpp branch. See #1192.

badlogic 6 年之前
父節點
當前提交
02c6f9cc63
共有 100 個文件被更改,包括 656 次插入389 次删除
  1. 5 5
      spine-cpp/LICENSE
  2. 23 15
      spine-cpp/README.md
  3. 3 3
      spine-cpp/spine-cpp-unit-tests/README.md
  4. 10 4
      spine-cpp/spine-cpp-unit-tests/src/main.cpp
  5. 3 3
      spine-cpp/spine-cpp/include/spine/Animation.h
  6. 16 17
      spine-cpp/spine-cpp/include/spine/AnimationState.h
  7. 5 5
      spine-cpp/spine-cpp/include/spine/AnimationStateData.h
  8. 10 6
      spine-cpp/spine-cpp/include/spine/Atlas.h
  9. 7 5
      spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h
  10. 3 3
      spine-cpp/spine-cpp/include/spine/Attachment.h
  11. 7 3
      spine-cpp/spine-cpp/include/spine/AttachmentLoader.h
  12. 4 3
      spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h
  13. 1 1
      spine-cpp/spine-cpp/include/spine/AttachmentType.h
  14. 1 1
      spine-cpp/spine-cpp/include/spine/BlendMode.h
  15. 5 2
      spine-cpp/spine-cpp/include/spine/Bone.h
  16. 3 3
      spine-cpp/spine-cpp/include/spine/BoneData.h
  17. 2 2
      spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h
  18. 2 2
      spine-cpp/spine-cpp/include/spine/ClippingAttachment.h
  19. 2 2
      spine-cpp/spine-cpp/include/spine/Color.h
  20. 11 4
      spine-cpp/spine-cpp/include/spine/ColorTimeline.h
  21. 2 2
      spine-cpp/spine-cpp/include/spine/Constraint.h
  22. 3 3
      spine-cpp/spine-cpp/include/spine/ContainerUtil.h
  23. 2 2
      spine-cpp/spine-cpp/include/spine/CurveTimeline.h
  24. 14 10
      spine-cpp/spine-cpp/include/spine/Debug.h
  25. 2 2
      spine-cpp/spine-cpp/include/spine/DeformTimeline.h
  26. 2 2
      spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h
  27. 3 3
      spine-cpp/spine-cpp/include/spine/Event.h
  28. 3 3
      spine-cpp/spine-cpp/include/spine/EventData.h
  29. 2 2
      spine-cpp/spine-cpp/include/spine/EventTimeline.h
  30. 10 16
      spine-cpp/spine-cpp/include/spine/Extension.h
  31. 59 0
      spine-cpp/spine-cpp/include/spine/HasRendererObject.h
  32. 5 5
      spine-cpp/spine-cpp/include/spine/HashMap.h
  33. 2 2
      spine-cpp/spine-cpp/include/spine/IkConstraint.h
  34. 3 3
      spine-cpp/spine-cpp/include/spine/IkConstraintData.h
  35. 13 5
      spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h
  36. 3 3
      spine-cpp/spine-cpp/include/spine/Json.h
  37. 3 3
      spine-cpp/spine-cpp/include/spine/LinkedMesh.h
  38. 12 11
      spine-cpp/spine-cpp/include/spine/MathUtil.h
  39. 5 5
      spine-cpp/spine-cpp/include/spine/MeshAttachment.h
  40. 1 1
      spine-cpp/spine-cpp/include/spine/MixBlend.h
  41. 1 1
      spine-cpp/spine-cpp/include/spine/MixDirection.h
  42. 2 2
      spine-cpp/spine-cpp/include/spine/PathAttachment.h
  43. 2 2
      spine-cpp/spine-cpp/include/spine/PathConstraint.h
  44. 3 3
      spine-cpp/spine-cpp/include/spine/PathConstraintData.h
  45. 9 4
      spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h
  46. 5 3
      spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h
  47. 2 2
      spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h
  48. 2 2
      spine-cpp/spine-cpp/include/spine/PointAttachment.h
  49. 2 2
      spine-cpp/spine-cpp/include/spine/Pool.h
  50. 1 1
      spine-cpp/spine-cpp/include/spine/PositionMode.h
  51. 8 8
      spine-cpp/spine-cpp/include/spine/RTTI.h
  52. 10 11
      spine-cpp/spine-cpp/include/spine/RegionAttachment.h
  53. 1 1
      spine-cpp/spine-cpp/include/spine/RotateMode.h
  54. 2 2
      spine-cpp/spine-cpp/include/spine/RotateTimeline.h
  55. 2 2
      spine-cpp/spine-cpp/include/spine/ScaleTimeline.h
  56. 2 2
      spine-cpp/spine-cpp/include/spine/ShearTimeline.h
  57. 4 4
      spine-cpp/spine-cpp/include/spine/Skeleton.h
  58. 3 3
      spine-cpp/spine-cpp/include/spine/SkeletonBinary.h
  59. 2 2
      spine-cpp/spine-cpp/include/spine/SkeletonBounds.h
  60. 6 4
      spine-cpp/spine-cpp/include/spine/SkeletonClipping.h
  61. 5 5
      spine-cpp/spine-cpp/include/spine/SkeletonData.h
  62. 3 3
      spine-cpp/spine-cpp/include/spine/SkeletonJson.h
  63. 6 6
      spine-cpp/spine-cpp/include/spine/Skin.h
  64. 2 4
      spine-cpp/spine-cpp/include/spine/Slot.h
  65. 3 3
      spine-cpp/spine-cpp/include/spine/SlotData.h
  66. 1 1
      spine-cpp/spine-cpp/include/spine/SpacingMode.h
  67. 7 2
      spine-cpp/spine-cpp/include/spine/SpineObject.h
  68. 2 2
      spine-cpp/spine-cpp/include/spine/SpineString.h
  69. 3 3
      spine-cpp/spine-cpp/include/spine/TextureLoader.h
  70. 2 2
      spine-cpp/spine-cpp/include/spine/Timeline.h
  71. 1 1
      spine-cpp/spine-cpp/include/spine/TimelineType.h
  72. 2 2
      spine-cpp/spine-cpp/include/spine/TransformConstraint.h
  73. 3 3
      spine-cpp/spine-cpp/include/spine/TransformConstraintData.h
  74. 12 4
      spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h
  75. 1 1
      spine-cpp/spine-cpp/include/spine/TransformMode.h
  76. 8 4
      spine-cpp/spine-cpp/include/spine/TranslateTimeline.h
  77. 2 2
      spine-cpp/spine-cpp/include/spine/Triangulator.h
  78. 18 5
      spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h
  79. 2 2
      spine-cpp/spine-cpp/include/spine/Updatable.h
  80. 9 5
      spine-cpp/spine-cpp/include/spine/Vector.h
  81. 5 3
      spine-cpp/spine-cpp/include/spine/VertexAttachment.h
  82. 4 4
      spine-cpp/spine-cpp/include/spine/VertexEffect.h
  83. 2 2
      spine-cpp/spine-cpp/include/spine/Vertices.h
  84. 52 0
      spine-cpp/spine-cpp/include/spine/dll.h
  85. 5 2
      spine-cpp/spine-cpp/include/spine/spine.h
  86. 5 2
      spine-cpp/spine-cpp/src/spine/Animation.cpp
  87. 42 38
      spine-cpp/spine-cpp/src/spine/AnimationState.cpp
  88. 5 2
      spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp
  89. 18 12
      spine-cpp/spine-cpp/src/spine/Atlas.cpp
  90. 13 6
      spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp
  91. 5 1
      spine-cpp/spine-cpp/src/spine/Attachment.cpp
  92. 5 1
      spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp
  93. 5 1
      spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp
  94. 26 15
      spine-cpp/spine-cpp/src/spine/Bone.cpp
  95. 5 1
      spine-cpp/spine-cpp/src/spine/BoneData.cpp
  96. 5 1
      spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp
  97. 5 1
      spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp
  98. 6 2
      spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp
  99. 5 1
      spine-cpp/spine-cpp/src/spine/Constraint.cpp
  100. 5 1
      spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp

+ 5 - 5
spine-cpp/LICENSE

@@ -1,15 +1,15 @@
-Spine Runtimes Software License v2.5
+spine Runtimes Software License v2.5
 
 Copyright (c) 2013-2016, Esoteric Software
 All rights reserved.
 
 You are granted a perpetual, non-exclusive, non-sublicensable, and
-non-transferable license to use, install, execute, and perform the Spine
+non-transferable license to use, install, execute, and perform the spine
 Runtimes software and derivative works solely for personal or internal
 use. Without the written permission of Esoteric Software (see Section 2 of
-the Spine Software License Agreement), you may not (a) modify, translate,
-adapt, or develop new applications using the Spine Runtimes or otherwise
-create derivative works or improvements of the Spine Runtimes or (b) remove,
+the spine Software License Agreement), you may not (a) modify, translate,
+adapt, or develop new applications using the spine Runtimes or otherwise
+create derivative works or improvements of the spine Runtimes or (b) remove,
 delete, alter, or obscure any trademarks or any copyright, trademark, patent,
 or other intellectual property or proprietary rights notices on or in the
 Software, including any copy thereof. Redistributions in binary or source

+ 23 - 15
spine-cpp/README.md

@@ -1,39 +1,47 @@
 # spine-cpp
 
-The spine-cpp runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using C++. It does not perform rendering but can be extended to enable Spine animations for other projects that utilize C++. Note, this library uses C++03 for maximum portability and therefore does not take advantage of any C++11 or newer features such as std::unique_ptr.
+The spine-cpp runtime provides basic functionality to load and manipulate [spine](http://esotericsoftware.com) skeletal animation data using C++. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C++. Note, this library uses C++03 for maximum portability and therefore does not take advantage of any C++11 or newer features such as std::unique_ptr.
 
 ## Licensing
 
-This Spine Runtime may only be used for personal or internal use, typically to evaluate Spine before purchasing. If you would like to incorporate a Spine Runtime into your applications, distribute software containing a Spine Runtime, or modify a Spine Runtime, then you will need a valid [Spine license](https://esotericsoftware.com/spine-purchase). Please see the [Spine Runtimes Software License](http://esotericsoftware.com/git/spine-runtimes/blob/LICENSE) for detailed information.
+This spine Runtime may only be used for personal or internal use, typically to evaluate spine before purchasing. If you would like to incorporate a spine Runtime into your applications, distribute software containing a spine Runtime, or modify a spine Runtime, then you will need a valid [spine license](https://esotericsoftware.com/spine-purchase). Please see the [spine Runtimes Software License](http://esotericsoftware.com/git/spine-runtimes/blob/LICENSE) for detailed information.
 
-The Spine Runtimes are developed with the intent to be used with data exported from Spine. By purchasing Spine, `Section 2` of the [Spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the Spine Runtimes.
+The spine Runtimes are developed with the intent to be used with data exported from spine. By purchasing spine, `Section 2` of the [spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the spine Runtimes.
 
-## Spine version
+## spine version
 
-spine-cpp works with data exported from Spine 3.6.xx.
+spine-cpp works with data exported from spine 3.7.xx.
 
-spine-cpp supports all Spine features.
+spine-cpp supports all spine features.
 
 ## Setup
 
-1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above.
-2. Create a new project and import the source.
-
-Alternatively, the contents of the `spine-cpp/spine-cpp/src` and `spine-cpp/spine-cpp/include` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-cpp/spine-cpp/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
+1. Download the spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above.
+2. Copy the contents of the `spine-cpp/spine-cpp/src` and `spine-cpp/spine-cpp/include` directories into your project. Be sure your header search is configured to find the contents of the `spine-cpp/spine-cpp/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
 
 ## Extension
 
-Extending spine-cpp requires implementing both the SpineExtension class (which has a handy default instance) and the TextureLoader class:
+Extending spine-cpp requires implementing both the `SpineExtension` class and the TextureLoader class:
 
-Spine::SpineExtension::setInstance(Spine::DefaultSpineExtension::getInstance());
+```
+#include <spine/Extension.h>
+void spine::SpineExtension *spine::getDefaultExtension() {
+  return new spine::DefaultExtension();
+}
 
-class MyTextureLoader : public TextureLoader
+class MyTextureLoader : public spine::TextureLoader
 {
-  virtual void load(AtlasPage& page, const String& path) { // TODO }
+  virtual void load(spine::AtlasPage& page, const spine::String& path) {
+    void* texture = ... load the texture based on path ...
+    page->setRendererObject(texture); // use the texture later in your rendering code
+  }
 
   virtual void unload(void* texture) { // TODO }
 };
+```
 
 ## Runtimes extending spine-cpp
 
-- Coming Soon!
+- [spine-sfml](../spine-sfml/cpp)
+- [spine-cocos2dx](../spine-cocos2dx)
+- [spine-ue4](../spine-ue4)

+ 3 - 3
spine-cpp/spine-cpp-unit-tests/README.md

@@ -1,6 +1,6 @@
 # spine-cpp-unit-tests
 
-The spine-cpp-unit-tests project is to test the [Spine](http://esotericsoftware.com) skeletal animation system. It does not perform rendering.  It is primarily used for regression testing and leak detection.  It is designed to be run from a Continuous Integration server and to passively verify changes automatically on check-in.
+The spine-cpp-unit-tests project is to test the [spine](http://esotericsoftware.com) skeletal animation system. It does not perform rendering.  It is primarily used for regression testing and leak detection.  It is designed to be run from a Continuous Integration server and to passively verify changes automatically on check-in.
 
 ## Mini CPP Unit Testing
 [MiniCppUnit](https://sourceforge.net/p/minicppunit/wiki/Home/) is a minimal unit testing framework similar to JUnit.  It is used here to avoid large dependancies.
@@ -42,9 +42,9 @@ msbuild spine_unit_test.sln /t:spine_unit_test /p:Configuration="Debug" /p:Platf
 
 
 ## Licensing
-This Spine Runtime may only be used for personal or internal use, typically to evaluate Spine before purchasing. If you would like to incorporate a Spine Runtime into your applications, distribute software containing a Spine Runtime, or modify a Spine Runtime, then you will need a valid [Spine license](https://esotericsoftware.com/spine-purchase). Please see the [Spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information.
+This spine Runtime may only be used for personal or internal use, typically to evaluate spine before purchasing. If you would like to incorporate a spine Runtime into your applications, distribute software containing a spine Runtime, or modify a spine Runtime, then you will need a valid [spine license](https://esotericsoftware.com/spine-purchase). Please see the [spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information.
 
-The Spine Runtimes are developed with the intent to be used with data exported from Spine. By purchasing Spine, `Section 2` of the [Spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the Spine Runtimes.
+The spine Runtimes are developed with the intent to be used with data exported from spine. By purchasing spine, `Section 2` of the [spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the spine Runtimes.
 
 original "walk"": 330
 second "walk": 0d0

+ 10 - 4
spine-cpp/spine-cpp-unit-tests/src/main.cpp

@@ -34,7 +34,7 @@
 
 #pragma warning ( disable : 4710 )
 
-using namespace Spine;
+using namespace spine;
 
 void loadBinary(const String &binaryFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData,
 				AnimationStateData *&stateData, Skeleton *&skeleton, AnimationState *&state) {
@@ -123,11 +123,17 @@ void testLoading() {
 	}
 }
 
+namespace spine {
+	SpineExtension* getDefaultExtension() {
+		return new DefaultSpineExtension();
+	}
+}
+
 int main(int argc, char **argv) {
-	DebugExtension *ext = new DebugExtension();
-	SpineExtension::setInstance(ext);
+	DebugExtension debug(SpineExtension::getInstance());
+	SpineExtension::setInstance(&debug);
 
 	testLoading();
 
-	ext->reportLeaks();
+	debug.reportLeaks();
 }

+ 3 - 3
spine-cpp/spine-cpp/include/spine/Animation.h

@@ -35,16 +35,16 @@
 #include <spine/MixBlend.h>
 #include <spine/MixDirection.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class Timeline;
 
 class Skeleton;
 
 class Event;
 
-class Animation : public SpineObject {
+class SP_API Animation : public SpineObject {
 	friend class AnimationState;
 
 	friend class TrackEntry;

+ 16 - 17
spine-cpp/spine-cpp/include/spine/AnimationState.h

@@ -35,9 +35,10 @@
 #include <spine/Pool.h>
 #include <spine/MixBlend.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
+#include <spine/HasRendererObject.h>
 
-namespace Spine {
+namespace spine {
     enum EventType {
         EventType_Start,
         EventType_Interrupt,
@@ -56,15 +57,17 @@ namespace Spine {
     class Skeleton;
     class RotateTimeline;
     
-    typedef void (*OnAnimationEventFunc) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
+    typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
     
     /// State for the playback of an animation
-    class TrackEntry : public SpineObject {
+    class SP_API TrackEntry : public SpineObject, public HasRendererObject {
         friend class EventQueue;
         friend class AnimationState;
         
     public:
         TrackEntry();
+
+        virtual ~TrackEntry();
         
         /// The index of the track where this entry is either current or queued.
         int getTrackIndex();
@@ -236,8 +239,7 @@ namespace Spine {
         /// TrackEntry chooses the short way the first time it is applied and remembers that direction.
         void resetRotationDirections();
         
-        void setOnAnimationEventFunc(OnAnimationEventFunc inValue);
-
+        void setListener(AnimationStateListener listener);
 
     private:
         Animation* _animation;
@@ -256,12 +258,12 @@ namespace Spine {
         Vector<int> _timelineMode;
         Vector<TrackEntry*> _timelineHoldMix;
         Vector<float> _timelinesRotation;
-        OnAnimationEventFunc _onAnimationEventFunc;
+        AnimationStateListener _listener;
         
         void reset();
     };
     
-    class EventQueueEntry : public SpineObject {
+    class SP_API EventQueueEntry : public SpineObject {
         friend class EventQueue;
         
     public:
@@ -272,7 +274,7 @@ namespace Spine {
         EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL);
     };
     
-    class EventQueue : public SpineObject {
+    class SP_API EventQueue : public SpineObject {
         friend class AnimationState;
         
     private:
@@ -305,7 +307,7 @@ namespace Spine {
         void drain();
     };
     
-    class AnimationState : public SpineObject {
+    class SP_API AnimationState : public SpineObject, public HasRendererObject {
         friend class TrackEntry;
         friend class EventQueue;
         
@@ -393,13 +395,12 @@ namespace Spine {
         float getTimeScale();
         void setTimeScale(float inValue);
 
-        void setOnAnimationEventFunc(OnAnimationEventFunc inValue);
+        void setListener(AnimationStateListener listener);
 
-        void setRendererObject(void* inValue);
-        void* getRendererObject();
+		void disableQueue();
+		void enableQueue();
         
     private:
-        static const int Subsequent, First, Hold, HoldMix;
         
         AnimationStateData* _data;
 
@@ -410,10 +411,8 @@ namespace Spine {
 
         Vector<int> _propertyIDs;
         bool _animationsChanged;
-        
-        void* _rendererObject;
 
-        OnAnimationEventFunc _onAnimationEventFunc;
+        AnimationStateListener _listener;
         
         float _timeScale;
 

+ 5 - 5
spine-cpp/spine-cpp/include/spine/AnimationStateData.h

@@ -33,27 +33,27 @@
 
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 
-namespace Spine {
+namespace spine {
     class SkeletonData;
     class Animation;
     
     /// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
-    class AnimationStateData : public SpineObject {
+    class SP_API AnimationStateData : public SpineObject {
         friend class AnimationState;
         
     public:
+		explicit AnimationStateData(SkeletonData* skeletonData);
+		
         /// The SkeletonData to look up animations when they are specified by name.
         SkeletonData* getSkeletonData();
         
         /// The mix duration to use when no mix duration has been specifically defined between two animations.
         float getDefaultMix();
         void setDefaultMix(float inValue);
-
-        explicit AnimationStateData(SkeletonData* skeletonData);
         
         /// Sets a mix duration by animation names.
         void setMix(const String& fromName, const String& toName, float duration);

+ 10 - 6
spine-cpp/spine-cpp/include/spine/Atlas.h

@@ -34,9 +34,10 @@
 #include <spine/Vector.h>
 #include <spine/Extension.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
+#include <spine/HasRendererObject.h>
 
-namespace Spine {
+namespace spine {
 enum Format {
 	Format_Alpha,
 	Format_Intensity,
@@ -64,7 +65,7 @@ enum TextureWrap {
 	TextureWrap_Repeat
 };
 
-class AtlasPage : public SpineObject {
+class SP_API AtlasPage : public SpineObject, public HasRendererObject {
 public:
 	String name;
 	Format format;
@@ -72,16 +73,17 @@ public:
 	TextureFilter magFilter;
 	TextureWrap uWrap;
 	TextureWrap vWrap;
-	void *rendererObject;
 	int width, height;
 
 	explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
 											   magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
 											   vWrap(TextureWrap_ClampToEdge) {
 	}
+
+	virtual ~AtlasPage() { }
 };
 
-class AtlasRegion : public SpineObject {
+class SP_API AtlasRegion : public SpineObject {
 public:
 	AtlasPage *page;
 	String name;
@@ -97,7 +99,7 @@ public:
 
 class TextureLoader;
 
-class Atlas : public SpineObject {
+class SP_API Atlas : public SpineObject {
 public:
 	Atlas(const String &path, TextureLoader *textureLoader);
 
@@ -112,6 +114,8 @@ public:
 	/// @return The region, or NULL.
 	AtlasRegion *findRegion(const String &name);
 
+	Vector<AtlasPage*> &getPages();
+
 private:
 	Vector<AtlasPage *> _pages;
 	Vector<AtlasRegion *> _regions;

+ 7 - 5
spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h

@@ -33,10 +33,10 @@
 
 #include <spine/AttachmentLoader.h>
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
-namespace Spine {
+namespace spine {
     class Atlas;
     class AtlasRegion;
     
@@ -44,10 +44,10 @@ namespace Spine {
     /// An AttachmentLoader that configures attachments using texture regions from an Atlas.
     /// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide.
     ///
-    class AtlasAttachmentLoader : public AttachmentLoader {
-        RTTI_DECL
-        
+	class SP_API AtlasAttachmentLoader : public AttachmentLoader {
     public:
+		RTTI_DECL
+		
         explicit AtlasAttachmentLoader(Atlas* atlas);
         
         virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
@@ -61,6 +61,8 @@ namespace Spine {
         virtual PointAttachment* newPointAttachment(Skin& skin, const String& name);
         
         virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
+
+		virtual void configureAttachment(Attachment* attachment);
         
         AtlasRegion* findRegion(const String& name);
         

+ 3 - 3
spine-cpp/spine-cpp/include/spine/Attachment.h

@@ -33,10 +33,10 @@
 
 #include <spine/RTTI.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
-class Attachment : public SpineObject {
+namespace spine {
+class SP_API Attachment : public SpineObject {
 RTTI_DECL
 
 public:

+ 7 - 3
spine-cpp/spine-cpp/include/spine/AttachmentLoader.h

@@ -33,10 +33,11 @@
 
 #include <spine/RTTI.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
     class Skin;
+    class Attachment;
     class RegionAttachment;
     class MeshAttachment;
     class BoundingBoxAttachment;
@@ -44,7 +45,8 @@ namespace Spine {
     class PointAttachment;
     class ClippingAttachment;
     
-    class AttachmentLoader : public SpineObject {
+    class SP_API AttachmentLoader : public SpineObject {
+	public:
         RTTI_DECL
         
         AttachmentLoader();
@@ -66,6 +68,8 @@ namespace Spine {
         virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
         
         virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name) = 0;
+
+        virtual void configureAttachment(Attachment* attachment) = 0;
     };
 }
 

+ 4 - 3
spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h

@@ -36,13 +36,14 @@
 #include <spine/Vector.h>
 #include <spine/MixBlend.h>
 #include <spine/MixDirection.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
+
+namespace spine {
 
-namespace Spine {
     class Skeleton;
     class Event;
     
-    class AttachmentTimeline : public Timeline {
+    class SP_API AttachmentTimeline : public Timeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 1 - 1
spine-cpp/spine-cpp/include/spine/AttachmentType.h

@@ -31,7 +31,7 @@
 #ifndef Spine_AttachmentType_h
 #define Spine_AttachmentType_h
 
-namespace Spine {
+namespace spine {
     enum AttachmentType {
         AttachmentType_Region,
         AttachmentType_Boundingbox,

+ 1 - 1
spine-cpp/spine-cpp/include/spine/BlendMode.h

@@ -31,7 +31,7 @@
 #ifndef Spine_BlendMode_h
 #define Spine_BlendMode_h
 
-namespace Spine {
+namespace spine {
 enum BlendMode {
 	BlendMode_Normal = 0,
 	BlendMode_Additive,

+ 5 - 2
spine-cpp/spine-cpp/include/spine/Bone.h

@@ -35,7 +35,7 @@
 #include <spine/SpineObject.h>
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
 class BoneData;
 
 class Skeleton;
@@ -45,7 +45,7 @@ class Skeleton;
 /// A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
 /// local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
 /// constraint or application code modifies the world transform after it was computed from the local transform.
-class Bone : public Updatable {
+class SP_API Bone : public Updatable {
 	friend class AnimationState;
 
 	friend class RotateTimeline;
@@ -221,6 +221,9 @@ public:
 	/// Returns the magnitide (always positive) of the world scale Y.
 	float getWorldScaleY();
 
+	bool isAppliedValid();
+	void setAppliedValid(bool valid);
+
 private:
 	static bool yDown;
 

+ 3 - 3
spine-cpp/spine-cpp/include/spine/BoneData.h

@@ -33,10 +33,10 @@
 
 #include <spine/TransformMode.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
-class BoneData : public SpineObject {
+namespace spine {
+class SP_API BoneData : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h

@@ -34,9 +34,9 @@
 #include <spine/VertexAttachment.h>
 #include <spine/SpineObject.h>
 
-namespace Spine {
+namespace spine {
     /// Attachment that has a polygon for bounds checking.
-    class BoundingBoxAttachment : public VertexAttachment {
+    class SP_API BoundingBoxAttachment : public VertexAttachment {
         RTTI_DECL
         
         explicit BoundingBoxAttachment(const String& name);

+ 2 - 2
spine-cpp/spine-cpp/include/spine/ClippingAttachment.h

@@ -33,10 +33,10 @@
 
 #include <spine/VertexAttachment.h>
 
-namespace Spine {
+namespace spine {
     class SlotData;
     
-    class ClippingAttachment : public VertexAttachment {
+    class SP_API ClippingAttachment : public VertexAttachment {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Color.h

@@ -32,8 +32,8 @@
 
 #include <spine/MathUtil.h>
 
-namespace Spine {
-class Color : public SpineObject {
+namespace spine {
+class SP_API Color : public SpineObject {
 public:
 	Color() : r(0), g(0), b(0), a(0) {
 	}

+ 11 - 4
spine-cpp/spine-cpp/include/spine/ColorTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-class ColorTimeline : public CurveTimeline {
+namespace spine {
+class SP_API ColorTimeline : public CurveTimeline {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;
@@ -62,8 +62,15 @@ public:
 	Vector<float> &getFrames();
 
 protected:
-	static const int PREV_TIME, PREV_R, PREV_G, PREV_B, PREV_A;
-	static const int R, G, B, A;
+	static const int PREV_TIME;
+	static const int PREV_R;
+	static const int PREV_G;
+	static const int PREV_B;
+	static const int PREV_A;
+	static const int R;
+	static const int G;
+	static const int B;
+	static const int A;
 
 private:
 	int _slotIndex;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Constraint.h

@@ -33,9 +33,9 @@
 
 #include <spine/Updatable.h>
 
-namespace Spine {
+namespace spine {
 /// The interface for all constraints.
-class Constraint : public Updatable {
+class SP_API Constraint : public Updatable {
 RTTI_DECL
 
 public:

+ 3 - 3
spine-cpp/spine-cpp/include/spine/ContainerUtil.h

@@ -35,12 +35,12 @@
 #include <spine/Vector.h>
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 
-namespace Spine {
-    class ContainerUtil : public SpineObject {
+namespace spine {
+    class SP_API ContainerUtil : public SpineObject {
     public:
         /// Finds an item by comparing each item's name.
         /// It is more efficient to cache the results of this method than to call it multiple times.

+ 2 - 2
spine-cpp/spine-cpp/include/spine/CurveTimeline.h

@@ -34,9 +34,9 @@
 #include <spine/Timeline.h>
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
     /// Base class for frames that use an interpolation bezier curve.
-    class CurveTimeline : public Timeline {
+    class SP_API CurveTimeline : public Timeline {
         RTTI_DECL
         
     public:

+ 14 - 10
spine-cpp/spine-cpp/include/spine/Debug.h

@@ -35,8 +35,8 @@
 
 #include <map>
 
-namespace Spine {
-class DebugExtension : public DefaultSpineExtension {
+namespace spine {
+class SP_API DebugExtension : public SpineExtension {
 	struct Allocation {
 		void *address;
 		size_t size;
@@ -51,14 +51,14 @@ class DebugExtension : public DefaultSpineExtension {
 	};
 
 public:
-	DebugExtension(): _allocations(0), _reallocations(0), _frees(0) {
+	DebugExtension(SpineExtension* extension): _extension(extension), _allocations(0), _reallocations(0), _frees(0) {
 	}
 
 	void reportLeaks() {
 		for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
 			printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
 		}
-		printf("allocations: %lu, reallocations: %lu, frees: %lu\n", _allocations, _reallocations, _frees);
+		printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees);
 		if (_allocated.empty()) printf("No leaks detected");
 	}
 
@@ -66,16 +66,15 @@ public:
 		_allocated.clear();
 	}
 
-protected:
 	virtual void *_alloc(size_t size, const char *file, int line) {
-		void *result = DefaultSpineExtension::_alloc(size, file, line);
+		void *result = _extension->_alloc(size, file, line);
 		_allocated[result] = Allocation(result, size, file, line);
 		_allocations++;
 		return result;
 	}
 
 	virtual void *_calloc(size_t size, const char *file, int line) {
-		void *result = DefaultSpineExtension::_calloc(size, file, line);
+		void *result = _extension->_calloc(size, file, line);
 		_allocated[result] = Allocation(result, size, file, line);
 		_allocations++;
 		return result;
@@ -83,7 +82,7 @@ protected:
 
 	virtual void *_realloc(void *ptr, size_t size, const char *file, int line) {
 		_allocated.erase(ptr);
-		void *result = DefaultSpineExtension::_realloc(ptr, size, file, line);
+		void *result = _extension->_realloc(ptr, size, file, line);
 		_reallocations++;
 		_allocated[result] = Allocation(result, size, file, line);
 		return result;
@@ -91,17 +90,22 @@ protected:
 
 	virtual void _free(void *mem, const char *file, int line) {
 		if (_allocated.count(mem)) {
-			DefaultSpineExtension::_free(mem, file, line);
+			_extension->_free(mem, file, line);
 			_frees++;
 			_allocated.erase(mem);
 			return;
 		}
 
 		printf("%s:%i (address %p): Double free or not allocated through SpineExtension\n", file, line, mem);
-		DefaultSpineExtension::_free(mem, file, line);
+		_extension->_free(mem, file, line);
+	}
+
+	virtual char *_readFile(const String &path, int *length) {
+		return _extension->_readFile(path, length);
 	}
 
 private:
+	SpineExtension* _extension;
 	std::map<void*, Allocation> _allocated;
 	size_t _allocations;
 	size_t _reallocations;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/DeformTimeline.h

@@ -33,10 +33,10 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
+namespace spine {
     class VertexAttachment;
     
-    class DeformTimeline : public CurveTimeline {
+    class SP_API DeformTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/Timeline.h>
 
-namespace Spine {
-    class DrawOrderTimeline : public Timeline {
+namespace spine {
+    class SP_API DrawOrderTimeline : public Timeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 3 - 3
spine-cpp/spine-cpp/include/spine/Event.h

@@ -32,13 +32,13 @@
 #define Spine_Event_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class EventData;
 
 /// Stores the current pose values for an Event.
-class Event : public SpineObject {
+class SP_API Event : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;

+ 3 - 3
spine-cpp/spine-cpp/include/spine/EventData.h

@@ -32,11 +32,11 @@
 #define Spine_EventData_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 /// Stores the setup pose values for an Event.
-class EventData : public SpineObject {
+class SP_API EventData : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/EventTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/Timeline.h>
 
-namespace Spine {
-    class EventTimeline : public Timeline {
+namespace spine {
+    class SP_API EventTimeline : public Timeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 10 - 16
spine-cpp/spine-cpp/include/spine/Extension.h

@@ -32,13 +32,14 @@
 #define Spine_Extension_h
 
 #include <stdlib.h>
+#include <spine/dll.h>
 
 #define SP_UNUSED(x) (void)(x)
 
-namespace Spine {
+namespace spine {
 class String;
 
-class SpineExtension {
+class SP_API SpineExtension {
 public:
 	template<typename T>
 	static T *alloc(size_t num, const char *file, int line) {
@@ -70,7 +71,6 @@ public:
 
 	virtual ~SpineExtension();
 
-protected:
 	/// Implement this function to use your own memory allocator
 	virtual void *_alloc(size_t size, const char *file, int line) = 0;
 
@@ -83,13 +83,14 @@ protected:
 
 	virtual char *_readFile(const String &path, int *length) = 0;
 
+protected:
 	SpineExtension();
 
 private:
 	static SpineExtension *_instance;
 };
 
-class DefaultSpineExtension : public SpineExtension {
+class SP_API DefaultSpineExtension : public SpineExtension {
 public:
 	DefaultSpineExtension();
 
@@ -107,18 +108,11 @@ protected:
 	virtual char *_readFile(const String &path, int *length);
 };
 
-struct Allocation {
-	void *address;
-	size_t size;
-	const char *fileName;
-	int line;
-
-	Allocation() : address(NULL), size(0), fileName(NULL), line(0) {
-	}
-
-	Allocation(void *a, size_t s, const char *f, int l) : address(a), size(s), fileName(f), line(l) {
-	}
-};
+// This function is to be implemented by engine specific runtimes to provide
+// the default extension for that engine. It is called the first time
+// SpineExtension::getInstance() is called, when no instance has been set
+// yet.
+extern SpineExtension *getDefaultExtension();
 }
 
 #endif /* Spine_Extension_h */

+ 59 - 0
spine-cpp/spine-cpp/include/spine/HasRendererObject.h

@@ -0,0 +1,59 @@
+/******************************************************************************
+ * Spine Runtimes Software License v2.5
+ *
+ * Copyright (c) 2013-2016, Esoteric Software
+ * All rights reserved.
+ *
+ * You are granted a perpetual, non-exclusive, non-sublicensable, and
+ * non-transferable license to use, install, execute, and perform the Spine
+ * Runtimes software and derivative works solely for personal or internal
+ * use. Without the written permission of Esoteric Software (see Section 2 of
+ * the Spine Software License Agreement), you may not (a) modify, translate,
+ * adapt, or develop new applications using the Spine Runtimes or otherwise
+ * create derivative works or improvements of the Spine Runtimes or (b) remove,
+ * delete, alter, or obscure any trademarks or any copyright, trademark, patent,
+ * or other intellectual property or proprietary rights notices on or in the
+ * Software, including any copy thereof. Redistributions in binary or source
+ * form must include this license and terms.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
+ * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+#ifndef Spine_HasRendererObject_h
+#define Spine_HasRendererObject_h
+
+namespace spine {
+
+typedef void (*DisposeRendererObject) (void* rendererObject);
+
+class SP_API HasRendererObject {
+public:
+	explicit HasRendererObject() : _rendererObject(NULL), _dispose(NULL) {};
+
+	virtual ~HasRendererObject() {
+		if (_dispose && _rendererObject)
+			_dispose(_rendererObject);
+	}
+
+	void* getRendererObject() { return _rendererObject; }
+	void setRendererObject(void* rendererObject, DisposeRendererObject dispose = NULL) {
+		_rendererObject = rendererObject;
+		_dispose = dispose;
+	}
+private:
+	void *_rendererObject;
+	DisposeRendererObject _dispose;
+};
+
+}
+
+#endif

+ 5 - 5
spine-cpp/spine-cpp/include/spine/HashMap.h

@@ -40,14 +40,14 @@
 #pragma warning(disable:4291)
 #endif
 
-namespace Spine {
+namespace spine {
 template<typename K, typename V>
-class HashMap : public SpineObject {
+class SP_API HashMap : public SpineObject {
 private:
 	class Entry;
 
 public:
-	class Pair {
+	class SP_API Pair {
 	public:
 		explicit Pair(K &k, V &v) : key(k), value(v) {}
 
@@ -55,7 +55,7 @@ public:
 		V &value;
 	};
 
-	class Entries {
+	class SP_API Entries {
 	public:
 		friend class HashMap;
 
@@ -167,7 +167,7 @@ private:
 		return NULL;
 	}
 
-	class Entry : public SpineObject {
+	class SP_API Entry : public SpineObject {
 	public:
 		K _key;
 		V _value;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/IkConstraint.h

@@ -35,14 +35,14 @@
 
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
 class IkConstraintData;
 
 class Skeleton;
 
 class Bone;
 
-class IkConstraint : public Constraint {
+class SP_API IkConstraint : public Constraint {
 	friend class Skeleton;
 
 	friend class IkConstraintTimeline;

+ 3 - 3
spine-cpp/spine-cpp/include/spine/IkConstraintData.h

@@ -33,12 +33,12 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
     class BoneData;
     
-    class IkConstraintData : public SpineObject {
+    class SP_API IkConstraintData : public SpineObject {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class IkConstraint;

+ 13 - 5
spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h

@@ -33,8 +33,9 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class IkConstraintTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API IkConstraintTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -53,9 +54,16 @@ namespace Spine {
         void setFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch);
         
     private:
-        static const int PREV_TIME, PREV_MIX, PREV_BEND_DIRECTION, PREV_COMPRESS, PREV_STRETCH;
-        static const int MIX, BEND_DIRECTION, COMPRESS, STRETCH;
-        
+		static const int PREV_TIME;
+		static const int PREV_MIX;
+		static const int PREV_BEND_DIRECTION;
+		static const int PREV_COMPRESS;
+		static const int PREV_STRETCH;
+		static const int MIX;
+		static const int BEND_DIRECTION;
+		static const int COMPRESS;
+		static const int STRETCH;
+
         Vector<float> _frames;
         int _ikConstraintIndex;
     };

+ 3 - 3
spine-cpp/spine-cpp/include/spine/Json.h

@@ -34,12 +34,12 @@
 #include <spine/SpineObject.h>
 
 #ifndef SPINE_JSON_HAVE_PREV
-/* Spine doesn't use the "prev" link in the Json sibling lists. */
+/* spine doesn't use the "prev" link in the Json sibling lists. */
 #define SPINE_JSON_HAVE_PREV 0
 #endif
 
-namespace Spine {
-class Json : public SpineObject {
+namespace spine {
+class SP_API Json : public SpineObject {
 	friend class SkeletonJson;
 
 public:

+ 3 - 3
spine-cpp/spine-cpp/include/spine/LinkedMesh.h

@@ -32,12 +32,12 @@
 #define Spine_LinkedMesh_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class MeshAttachment;
 
-class LinkedMesh : public SpineObject {
+class SP_API LinkedMesh : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;

+ 12 - 11
spine-cpp/spine-cpp/include/spine/MathUtil.h

@@ -33,19 +33,20 @@
 
 #include <spine/SpineObject.h>
 
-#include <float.h>
 #include <string.h>
 
-namespace Spine {
-static const float PI = 3.1415926535897932385f;
-static const float PI_2 = PI * 2;
-static const float DEG_RAD = (PI / 180.0f);
-static const float RAD_DEG = (180.0f / PI);
+namespace spine {
 
-class MathUtil : public SpineObject {
-public:
+class SP_API MathUtil : public SpineObject {
+private:
 	MathUtil();
 
+public:
+	static const float Pi;
+	static const float Pi_2;
+	static const float Deg_Rad;
+	static const float Rad_Deg;
+
 	template<typename T>
 	static inline T min(T a, T b) { return a < b ? a : b; }
 
@@ -91,7 +92,7 @@ public:
 	static float pow(float a, float b);
 };
 
-struct Interpolation {
+struct SP_API Interpolation {
 	virtual float apply(float a) = 0;
 
 	virtual float interpolate(float start, float end, float a) {
@@ -101,7 +102,7 @@ struct Interpolation {
 	virtual ~Interpolation() {};
 };
 
-struct PowInterpolation: public Interpolation {
+struct SP_API PowInterpolation: public Interpolation {
 	PowInterpolation(int power): power(power) {
 	}
 
@@ -113,7 +114,7 @@ struct PowInterpolation: public Interpolation {
 	int power;
 };
 
-struct PowOutInterpolation: public Interpolation {
+struct SP_API PowOutInterpolation: public Interpolation {
 	PowOutInterpolation(int power): power(power) {
 	}
 

+ 5 - 5
spine-cpp/spine-cpp/include/spine/MeshAttachment.h

@@ -34,10 +34,11 @@
 #include <spine/VertexAttachment.h>
 #include <spine/Vector.h>
 #include <spine/Color.h>
+#include <spine/HasRendererObject.h>
 
-namespace Spine {
+namespace spine {
     /// Attachment that displays a texture region using a mesh.
-    class MeshAttachment : public VertexAttachment {
+    class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class AtlasAttachmentLoader;
@@ -47,6 +48,8 @@ namespace Spine {
     public:
         explicit MeshAttachment(const String& name);
 
+        virtual ~MeshAttachment();
+
         void updateUVs();
 
         virtual bool applyDeform(VertexAttachment* sourceAttachment);
@@ -65,8 +68,6 @@ namespace Spine {
         
         const String& getPath();
         void setPath(const String& inValue);
-        void* getRendererObject();
-        void setRendererObject(void* inValue);
         
         float getRegionU();
         void setRegionU(float inValue);
@@ -124,7 +125,6 @@ namespace Spine {
         Vector<float> _regionUVs;
         Vector<unsigned short> _triangles;
         Vector<unsigned short> _edges;
-        void* _rendererObject;
         String _path;
         float _regionU;
         float _regionV;

+ 1 - 1
spine-cpp/spine-cpp/include/spine/MixBlend.h

@@ -31,7 +31,7 @@
 #ifndef Spine_MixPose_h
 #define Spine_MixPose_h
 
-namespace Spine {
+namespace spine {
 ///
 /// Controls how a timeline is mixed with the setup or current pose.
 /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection)

+ 1 - 1
spine-cpp/spine-cpp/include/spine/MixDirection.h

@@ -31,7 +31,7 @@
 #ifndef Spine_MixDirection_h
 #define Spine_MixDirection_h
 
-namespace Spine {
+namespace spine {
 ///
 /// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose).
 /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection)

+ 2 - 2
spine-cpp/spine-cpp/include/spine/PathAttachment.h

@@ -33,8 +33,8 @@
 
 #include <spine/VertexAttachment.h>
 
-namespace Spine {
-    class PathAttachment : public VertexAttachment {
+namespace spine {
+    class SP_API PathAttachment : public VertexAttachment {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/PathConstraint.h

@@ -35,14 +35,14 @@
 
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
     class PathConstraintData;
     class Skeleton;
     class PathAttachment;
     class Bone;
     class Slot;
     
-    class PathConstraint : public Constraint {
+    class SP_API PathConstraint : public Constraint {
         friend class Skeleton;
         friend class PathConstraintMixTimeline;
         friend class PathConstraintPositionTimeline;

+ 3 - 3
spine-cpp/spine-cpp/include/spine/PathConstraintData.h

@@ -36,13 +36,13 @@
 #include <spine/RotateMode.h>
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
     class BoneData;
     class SlotData;
     
-    class PathConstraintData : public SpineObject {
+    class SP_API PathConstraintData : public SpineObject {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 9 - 4
spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h

@@ -33,8 +33,10 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class PathConstraintMixTimeline : public CurveTimeline {
+namespace spine {
+#define SP_PATHCONSTRAINTMIXTIMELINE_ENTRIES 5
+
+    class SP_API PathConstraintMixTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -50,8 +52,11 @@ namespace Spine {
         virtual int getPropertyId();
         
     private:
-        static const int PREV_TIME, PREV_ROTATE, PREV_TRANSLATE;
-        static const int ROTATE, TRANSLATE;
+		static const int PREV_TIME;
+		static const int PREV_ROTATE;
+		static const int PREV_TRANSLATE;
+		static const int ROTATE;
+		static const int TRANSLATE;
         
         Vector<float> _frames;
         int _pathConstraintIndex;

+ 5 - 3
spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h

@@ -33,8 +33,9 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class PathConstraintPositionTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API PathConstraintPositionTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -55,7 +56,8 @@ namespace Spine {
         void setFrame(int frameIndex, float time, float value);
         
     protected:
-        static const int PREV_TIME, PREV_VALUE;
+		static const int PREV_TIME;
+		static const int PREV_VALUE;
         static const int VALUE;
         
         Vector<float> _frames;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/PathConstraintPositionTimeline.h>
 
-namespace Spine {
-    class PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
+namespace spine {
+    class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/PointAttachment.h

@@ -33,7 +33,7 @@
 
 #include <spine/Attachment.h>
 
-namespace Spine {
+namespace spine {
     class Bone;
     
     /// 
@@ -43,7 +43,7 @@ namespace Spine {
     ///
     /// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide.
     /// 
-    class PointAttachment : public Attachment {
+    class SP_API PointAttachment : public Attachment {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Pool.h

@@ -36,9 +36,9 @@
 #include <spine/ContainerUtil.h>
 #include <spine/SpineObject.h>
 
-namespace Spine {
+namespace spine {
 template<typename T>
-class Pool : public SpineObject {
+class SP_API Pool : public SpineObject {
 public:
 	Pool() {
 	}

+ 1 - 1
spine-cpp/spine-cpp/include/spine/PositionMode.h

@@ -31,7 +31,7 @@
 #ifndef Spine_PositionMode_h
 #define Spine_PositionMode_h
 
-namespace Spine {
+namespace spine {
 enum PositionMode {
 	PositionMode_Fixed = 0,
 	PositionMode_Percent

+ 8 - 8
spine-cpp/spine-cpp/include/spine/RTTI.h

@@ -35,8 +35,8 @@
 
 #include <string>
 
-namespace Spine {
-class RTTI : public SpineObject {
+namespace spine {
+class SP_API RTTI : public SpineObject {
 public:
 	explicit RTTI(const std::string &className);
 
@@ -61,16 +61,16 @@ private:
 
 #define RTTI_DECL \
 public: \
-static const Spine::RTTI rtti; \
-virtual const Spine::RTTI& getRTTI() const;
+static const spine::RTTI rtti; \
+virtual const spine::RTTI& getRTTI() const;
 
 #define RTTI_IMPL_NOPARENT(name) \
-const Spine::RTTI name::rtti(#name); \
-const Spine::RTTI& name::getRTTI() const { return rtti; }
+const spine::RTTI name::rtti(#name); \
+const spine::RTTI& name::getRTTI() const { return rtti; }
 
 #define RTTI_IMPL(name, parent) \
-const Spine::RTTI name::rtti(#name, parent::rtti); \
-const Spine::RTTI& name::getRTTI() const { return rtti; }
+const spine::RTTI name::rtti(#name, parent::rtti); \
+const spine::RTTI& name::getRTTI() const { return rtti; }
 
 #endif /* Spine_RTTI_h */
 

+ 10 - 11
spine-cpp/spine-cpp/include/spine/RegionAttachment.h

@@ -36,14 +36,15 @@
 #include <spine/Color.h>
 
 #include <string>
+#include <spine/HasRendererObject.h>
 
 #define NUM_UVS 8
 
-namespace Spine {
+namespace spine {
     class Bone;
     
     /// Attachment that displays a texture region.
-    class RegionAttachment : public Attachment {
+    class SP_API RegionAttachment : public Attachment, public HasRendererObject {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class AtlasAttachmentLoader;
@@ -62,6 +63,7 @@ namespace Spine {
         /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
         /// @param offset The worldVertices index to begin writing values.
         /// @param stride The number of worldVertices entries between the value pairs written.
+		void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2);
         void computeWorldVertices(Bone& bone, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
         
         float getX();
@@ -83,24 +85,22 @@ namespace Spine {
 
         const String& getPath();
         void setPath(const String& inValue);
-        void* getRendererObject();
-        void setRendererObject(void* inValue);
+
         float getRegionOffsetX();
         void setRegionOffsetX(float inValue);
-        
-        // Pixels stripped from the bottom left, unrotated.
+
         float getRegionOffsetY();
         void setRegionOffsetY(float inValue);
+
         float getRegionWidth();
         void setRegionWidth(float inValue);
-        
-        // Unrotated, stripped size.
+
         float getRegionHeight();
         void setRegionHeight(float inValue);
+
         float getRegionOriginalWidth();
         void setRegionOriginalWidth(float inValue);
-        
-        // Unrotated, unstripped size.
+
         float getRegionOriginalHeight();
         void setRegionOriginalHeight(float inValue);
         
@@ -121,7 +121,6 @@ namespace Spine {
         float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
         Vector<float> _vertexOffset;
         Vector<float> _uvs;
-        void* _rendererObject;
         String _path;
         float _regionU;
         float _regionV;

+ 1 - 1
spine-cpp/spine-cpp/include/spine/RotateMode.h

@@ -31,7 +31,7 @@
 #ifndef Spine_RotateMode_h
 #define Spine_RotateMode_h
 
-namespace Spine {
+namespace spine {
 enum RotateMode {
 	RotateMode_Tangent = 0,
 	RotateMode_Chain,

+ 2 - 2
spine-cpp/spine-cpp/include/spine/RotateTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class RotateTimeline : public CurveTimeline {
+namespace spine {
+    class SP_API RotateTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class AnimationState;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/ScaleTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/TranslateTimeline.h>
 
-namespace Spine {
-    class ScaleTimeline : public TranslateTimeline {
+namespace spine {
+    class SP_API ScaleTimeline : public TranslateTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/ShearTimeline.h

@@ -33,8 +33,8 @@
 
 #include <spine/TranslateTimeline.h>
 
-namespace Spine {
-    class ShearTimeline : public TranslateTimeline {
+namespace spine {
+    class SP_API ShearTimeline : public TranslateTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 4 - 4
spine-cpp/spine-cpp/include/spine/Skeleton.h

@@ -34,12 +34,12 @@
 #include <spine/Vector.h>
 #include <spine/MathUtil.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
 #include <limits> // std::numeric_limits
 
-namespace Spine {
+namespace spine {
 class SkeletonData;
 
 class Bone;
@@ -58,7 +58,7 @@ class Skin;
 
 class Attachment;
 
-class Skeleton : public SpineObject {
+class SP_API Skeleton : public SpineObject {
 	friend class AnimationState;
 
 	friend class SkeletonBounds;
@@ -170,7 +170,7 @@ public:
 
 	Bone *getRootBone();
 
-	const SkeletonData *getData();
+	SkeletonData *getData();
 
 	Vector<Bone *> &getBones();
 

+ 3 - 3
spine-cpp/spine-cpp/include/spine/SkeletonBinary.h

@@ -34,10 +34,10 @@
 #include <spine/TransformMode.h>
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
-namespace Spine {
+namespace spine {
     class SkeletonData;
     class Atlas;
     class AttachmentLoader;
@@ -48,7 +48,7 @@ namespace Spine {
     class Animation;
     class CurveTimeline;
     
-    class SkeletonBinary : public SpineObject {
+    class SP_API SkeletonBinary : public SpineObject {
     public:
         static const int BONE_ROTATE;
         static const int BONE_TRANSLATE;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/SkeletonBounds.h

@@ -34,7 +34,7 @@
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
 
-namespace Spine {
+namespace spine {
     class Skeleton;
     class BoundingBoxAttachment;
     class Polygon;
@@ -43,7 +43,7 @@ namespace Spine {
     /// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon.
     /// The polygon vertices are provided along with convenience methods for doing hit detection.
     ///
-    class SkeletonBounds : public SpineObject {
+    class SP_API SkeletonBounds : public SpineObject {
     public:
         SkeletonBounds();
         

+ 6 - 4
spine-cpp/spine-cpp/include/spine/SkeletonClipping.h

@@ -34,11 +34,11 @@
 #include <spine/Vector.h>
 #include <spine/Triangulator.h>
 
-namespace Spine {
+namespace spine {
     class Slot;
     class ClippingAttachment;
     
-    class SkeletonClipping : public SpineObject {
+    class SP_API SkeletonClipping : public SpineObject {
     public:
         SkeletonClipping();
 
@@ -47,8 +47,10 @@ namespace Spine {
         void clipEnd(Slot& slot);
         
         void clipEnd();
-        
-        void clipTriangles(Vector<float>& vertices, size_t verticesLength, Vector<unsigned short>& triangles, size_t trianglesLength, Vector<float>& uvs);
+		
+		void clipTriangles(float* vertices, unsigned short* triangles, size_t trianglesLength, float* uvs, size_t stride);
+		
+        void clipTriangles(Vector<float>& vertices, Vector<unsigned short>& triangles, Vector<float>& uvs, size_t stride);
         
         bool isClipping();
         

+ 5 - 5
spine-cpp/spine-cpp/include/spine/SkeletonData.h

@@ -32,9 +32,9 @@
 #define Spine_SkeletonData_h
 
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class BoneData;
 
 class SlotData;
@@ -52,7 +52,7 @@ class TransformConstraintData;
 class PathConstraintData;
 
 /// Stores the setup pose and all of the stateless data for a skeleton.
-class SkeletonData : public SpineObject {
+class SP_API SkeletonData : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;
@@ -82,7 +82,7 @@ public:
 	Skin *findSkin(const String &skinName);
 
 	/// @return May be NULL.
-	EventData *findEvent(const String &eventDataName);
+	spine::EventData *findEvent(const String &eventDataName);
 
 	/// @return May be NULL.
 	Animation *findAnimation(const String &animationName);
@@ -119,7 +119,7 @@ public:
 
 	void setDefaultSkin(Skin *inValue);
 
-	Vector<EventData *> &getEvents();
+	Vector<spine::EventData *> &getEvents();
 
 	Vector<Animation *> &getAnimations();
 

+ 3 - 3
spine-cpp/spine-cpp/include/spine/SkeletonJson.h

@@ -33,9 +33,9 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class CurveTimeline;
 
 class VertexAttachment;
@@ -54,7 +54,7 @@ class LinkedMesh;
 
 class String;
 
-class SkeletonJson : public SpineObject {
+class SP_API SkeletonJson : public SpineObject {
 public:
 	explicit SkeletonJson(Atlas *atlas);
 

+ 6 - 6
spine-cpp/spine-cpp/include/spine/Skin.h

@@ -32,9 +32,9 @@
 #define Spine_Skin_h
 
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
 class Attachment;
 
 class Skeleton;
@@ -42,15 +42,15 @@ class Skeleton;
 /// Stores attachments by slot index and attachment name.
 /// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and
 /// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide.
-class Skin : public SpineObject {
+class SP_API Skin : public SpineObject {
 	friend class Skeleton;
 
 public:
-	class AttachmentMap : public SpineObject {
+	class SP_API AttachmentMap : public SpineObject {
 		friend class Skin;
 
 	public:
-		struct Entry {
+		struct SP_API Entry {
 			size_t _slotIndex;
 			String _name;
 			Attachment *_attachment;
@@ -62,7 +62,7 @@ public:
 			}
 		};
 
-		class Entries {
+		class SP_API Entries {
 			friend class AttachmentMap;
 
 		public:

+ 2 - 4
spine-cpp/spine-cpp/include/spine/Slot.h

@@ -37,7 +37,7 @@
 
 #include <string>
 
-namespace Spine {
+namespace spine {
 class SlotData;
 
 class Bone;
@@ -46,7 +46,7 @@ class Skeleton;
 
 class Attachment;
 
-class Slot : public SpineObject {
+class SP_API Slot : public SpineObject {
 	friend class VertexAttachment;
 
 	friend class Skeleton;
@@ -100,8 +100,6 @@ public:
 
 	bool hasDarkColor();
 
-	void setHasDarkColor(bool inValue);
-
 	/// May be NULL.
 	Attachment *getAttachment();
 

+ 3 - 3
spine-cpp/spine-cpp/include/spine/SlotData.h

@@ -33,13 +33,13 @@
 
 #include <spine/BlendMode.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
-namespace Spine {
+namespace spine {
 class BoneData;
 
-class SlotData : public SpineObject {
+class SP_API SlotData : public SpineObject {
 	friend class SkeletonBinary;
 
 	friend class SkeletonJson;

+ 1 - 1
spine-cpp/spine-cpp/include/spine/SpacingMode.h

@@ -31,7 +31,7 @@
 #ifndef Spine_SpacingMode_h
 #define Spine_SpacingMode_h
 
-namespace Spine {
+namespace spine {
 enum SpacingMode {
 	SpacingMode_Length = 0,
 	SpacingMode_Fixed,

+ 7 - 2
spine-cpp/spine-cpp/include/spine/SpineObject.h

@@ -32,12 +32,17 @@
 #define Spine_Object_h
 
 #include <new>
+#include <stddef.h>
 
-namespace Spine {
+#include <spine/dll.h>
+
+namespace spine {
 class String;
 
-class SpineObject {
+class SP_API SpineObject {
 public:
+	void *operator new(size_t sz);
+
 	void *operator new(size_t sz, const char *file, int line);
 
 	void *operator new(size_t sz, void *ptr);

+ 2 - 2
spine-cpp/spine-cpp/include/spine/String.h → spine-cpp/spine-cpp/include/spine/SpineString.h

@@ -42,8 +42,8 @@
 #pragma warning(disable:4996)
 #endif
 
-namespace Spine {
-class String : public SpineObject {
+namespace spine {
+class SP_API String : public SpineObject {
 public:
 	String() : _length(0), _buffer(NULL) {
 	}

+ 3 - 3
spine-cpp/spine-cpp/include/spine/TextureLoader.h

@@ -32,12 +32,12 @@
 #define Spine_TextureLoader_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
     class AtlasPage;
     
-    class TextureLoader : public SpineObject {
+    class SP_API TextureLoader : public SpineObject {
     public:
         TextureLoader();
         

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Timeline.h

@@ -37,12 +37,12 @@
 #include <spine/MixDirection.h>
 #include <spine/SpineObject.h>
 
-namespace Spine {
+namespace spine {
 class Skeleton;
 
 class Event;
 
-class Timeline : public SpineObject {
+class SP_API Timeline : public SpineObject {
 RTTI_DECL
 
 public:

+ 1 - 1
spine-cpp/spine-cpp/include/spine/TimelineType.h

@@ -31,7 +31,7 @@
 #ifndef Spine_TimelineType_h
 #define Spine_TimelineType_h
 
-namespace Spine {
+namespace spine {
 enum TimelineType {
 	TimelineType_Rotate = 0,
 	TimelineType_Translate,

+ 2 - 2
spine-cpp/spine-cpp/include/spine/TransformConstraint.h

@@ -35,12 +35,12 @@
 
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
     class TransformConstraintData;
     class Skeleton;
     class Bone;
     
-    class TransformConstraint : public Constraint {
+    class SP_API TransformConstraint : public Constraint {
         friend class Skeleton;
         friend class TransformConstraintTimeline;
         

+ 3 - 3
spine-cpp/spine-cpp/include/spine/TransformConstraintData.h

@@ -33,12 +33,12 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
-namespace Spine {
+namespace spine {
     class BoneData;
     
-    class TransformConstraintData : public SpineObject {
+    class SP_API TransformConstraintData : public SpineObject {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         

+ 12 - 4
spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h

@@ -33,8 +33,9 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class TransformConstraintTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TransformConstraintTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -52,8 +53,15 @@ namespace Spine {
         void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
         
     private:
-        static const int PREV_TIME, PREV_ROTATE, PREV_TRANSLATE, PREV_SCALE, PREV_SHEAR;
-        static const int ROTATE, TRANSLATE, SCALE, SHEAR;
+		static const int PREV_TIME;
+		static const int PREV_ROTATE;
+		static const int PREV_TRANSLATE;
+		static const int PREV_SCALE;
+		static const int PREV_SHEAR;
+		static const int ROTATE;
+		static const int TRANSLATE;
+		static const int SCALE;
+		static const int SHEAR;
         
         Vector<float> _frames;
         int _transformConstraintIndex;

+ 1 - 1
spine-cpp/spine-cpp/include/spine/TransformMode.h

@@ -31,7 +31,7 @@
 #ifndef Spine_TransformMode_h
 #define Spine_TransformMode_h
 
-namespace Spine {
+namespace spine {
     enum TransformMode {
         TransformMode_Normal = 0,
         TransformMode_OnlyTranslation,

+ 8 - 4
spine-cpp/spine-cpp/include/spine/TranslateTimeline.h

@@ -36,8 +36,9 @@
 #include <spine/Animation.h>
 #include <spine/TimelineType.h>
 
-namespace Spine {
-    class TranslateTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TranslateTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -58,8 +59,11 @@ namespace Spine {
         void setFrame(int frameIndex, float time, float x, float y);
         
     protected:
-        static const int PREV_TIME, PREV_X, PREV_Y;
-        static const int X, Y;
+		static const int PREV_TIME;
+		static const int PREV_X;
+		static const int PREV_Y;
+		static const int X;
+		static const int Y;
         
         Vector<float> _frames;
         int _boneIndex;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Triangulator.h

@@ -34,8 +34,8 @@
 #include <spine/Vector.h>
 #include <spine/Pool.h>
 
-namespace Spine {
-class Triangulator : public SpineObject {
+namespace spine {
+class SP_API Triangulator : public SpineObject {
 public:
 	~Triangulator();
 

+ 18 - 5
spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h

@@ -33,8 +33,9 @@
 
 #include <spine/CurveTimeline.h>
 
-namespace Spine {
-    class TwoColorTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TwoColorTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         
@@ -56,9 +57,21 @@ namespace Spine {
         void setSlotIndex(int inValue);
         
     private:
-        static const int PREV_TIME, PREV_R, PREV_G, PREV_B, PREV_A;
-        static const int PREV_R2, PREV_G2, PREV_B2;
-        static const int R, G, B, A, R2, G2, B2;
+		static const int PREV_TIME;
+		static const int PREV_R;
+		static const int PREV_G;
+		static const int PREV_B;
+		static const int PREV_A;
+		static const int PREV_R2;
+		static const int PREV_G2;
+		static const int PREV_B2;
+		static const int R;
+		static const int G;
+		static const int B;
+		static const int A;
+		static const int R2;
+		static const int G2;
+		static const int B2;
         
         Vector<float> _frames; // time, r, g, b, a, r2, g2, b2, ...
         int _slotIndex;

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Updatable.h

@@ -34,8 +34,8 @@
 #include <spine/RTTI.h>
 #include <spine/SpineObject.h>
 
-namespace Spine {
-class Updatable : public SpineObject {
+namespace spine {
+class SP_API Updatable : public SpineObject {
 RTTI_DECL
 
 public:

+ 9 - 5
spine-cpp/spine-cpp/include/spine/Vector.h

@@ -33,14 +33,14 @@
 
 #include <spine/Extension.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <stdlib.h>
 #include <memory>
 #include <assert.h>
 
-namespace Spine {
+namespace spine {
 template<typename T>
-class Vector : public SpineObject {
+class SP_API Vector : public SpineObject {
 public:
 	Vector() : _size(0), _capacity(0), _buffer(NULL) {
 	}
@@ -67,6 +67,10 @@ public:
 		_size = 0;
 	}
 
+	inline size_t getCapacity() const {
+		return _capacity;
+	}
+
 	inline size_t size() const {
 		return _size;
 	}
@@ -78,7 +82,7 @@ public:
 		if (_capacity < newSize) {
 			_capacity = (int) (_size * 1.75f);
 			if (_capacity < 8) _capacity = 8;
-			_buffer = Spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
+			_buffer = spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
 		}
 		if (oldSize < _size) {
 			for (size_t i = oldSize; i < _size; i++) {
@@ -102,7 +106,7 @@ public:
 			T valueCopy = inValue;
 			_capacity = (int) (_size * 1.75f);
 			if (_capacity < 8) _capacity = 8;
-			_buffer = Spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
+			_buffer = spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
 			construct(_buffer + _size++, valueCopy);
 		} else {
 			construct(_buffer + _size++, inValue);

+ 5 - 3
spine-cpp/spine-cpp/include/spine/VertexAttachment.h

@@ -35,11 +35,11 @@
 
 #include <spine/Vector.h>
 
-namespace Spine {
+namespace spine {
     class Slot;
     
     /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
-    class VertexAttachment : public Attachment {
+    class SP_API VertexAttachment : public Attachment {
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class DeformTimeline;
@@ -50,7 +50,8 @@ namespace Spine {
         explicit VertexAttachment(const String& name);
 
         virtual ~VertexAttachment();
-        
+		
+		void computeWorldVertices(Slot& slot, float* worldVertices);
         void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
         
         /// Transforms local vertices to world coordinates.
@@ -59,6 +60,7 @@ namespace Spine {
         /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count.
         /// @param offset The worldVertices index to begin writing values.
         /// @param stride The number of worldVertices entries between the value pairs written.
+		void computeWorldVertices(Slot& slot, size_t start, size_t count, float* worldVertices, size_t offset, size_t stride = 2);
         void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
         
         /// @return true if a deform originally applied to the specified attachment should be applied to this attachment.

+ 4 - 4
spine-cpp/spine-cpp/include/spine/VertexEffect.h

@@ -34,19 +34,19 @@
 #include <spine/SpineObject.h>
 #include <spine/MathUtil.h>
 
-namespace Spine {
+namespace spine {
 
 class Skeleton;
 class Color;
 
-class VertexEffect: public SpineObject {
+class SP_API VertexEffect: public SpineObject {
 public:
 	virtual void begin(Skeleton& skeleton) = 0;
 	virtual void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark) = 0;
 	virtual void end() = 0;
 };
 
-class JitterVertexEffect: public VertexEffect {
+class SP_API JitterVertexEffect: public VertexEffect {
 public:
 	JitterVertexEffect(float jitterX, float jitterY);
 
@@ -65,7 +65,7 @@ protected:
 	float _jitterY;
 };
 
-class SwirlVertexEffect: public VertexEffect {
+class SP_API SwirlVertexEffect: public VertexEffect {
 public:
 	SwirlVertexEffect(float radius, Interpolation &interpolation);
 

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Vertices.h

@@ -33,8 +33,8 @@
 
 #include <spine/Vector.h>
 
-namespace Spine {
-class Vertices : public SpineObject {
+namespace spine {
+class SP_API Vertices : public SpineObject {
 public:
 	Vector<size_t> _bones;
 	Vector<float> _vertices;

+ 52 - 0
spine-cpp/spine-cpp/include/spine/dll.h

@@ -0,0 +1,52 @@
+/******************************************************************************
+* Spine Runtimes Software License v2.5
+*
+* Copyright (c) 2013-2016, Esoteric Software
+* All rights reserved.
+*
+* You are granted a perpetual, non-exclusive, non-sublicensable, and
+* non-transferable license to use, install, execute, and perform the Spine
+* Runtimes software and derivative works solely for personal or internal
+* use. Without the written permission of Esoteric Software (see Section 2 of
+* the Spine Software License Agreement), you may not (a) modify, translate,
+* adapt, or develop new applications using the Spine Runtimes or otherwise
+* create derivative works or improvements of the Spine Runtimes or (b) remove,
+* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
+* or other intellectual property or proprietary rights notices on or in the
+* Software, including any copy thereof. Redistributions in binary or source
+* form must include this license and terms.
+*
+* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
+* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*****************************************************************************/
+
+#ifndef SPINE_SHAREDLIB_H
+#define SPINE_SHAREDLIB_H
+
+#ifdef _WIN32
+#define DLLIMPORT __declspec(dllimport)
+#define DLLEXPORT __declspec(dllexport)
+#else
+#ifndef DLLIMPORT
+#define DLLIMPORT
+#endif
+#ifndef DLLEXPORT
+#define DLLEXPORT
+#endif
+#endif
+
+#ifdef SPINEPLUGIN_API
+#define SP_API SPINEPLUGIN_API
+#else
+#define SP_API
+#endif
+
+#endif /* SPINE_SHAREDLIB_H */

+ 5 - 2
spine-cpp/spine-cpp/include/spine/spine.h

@@ -50,6 +50,7 @@
 #include <spine/Constraint.h>
 #include <spine/ContainerUtil.h>
 #include <spine/CurveTimeline.h>
+#include <spine/Debug.h>
 #include <spine/DeformTimeline.h>
 #include <spine/DrawOrderTimeline.h>
 #include <spine/Event.h>
@@ -57,6 +58,7 @@
 #include <spine/EventTimeline.h>
 #include <spine/Extension.h>
 #include <spine/HashMap.h>
+#include <spine/HasRendererObject.h>
 #include <spine/IkConstraint.h>
 #include <spine/IkConstraintData.h>
 #include <spine/IkConstraintTimeline.h>
@@ -64,8 +66,8 @@
 #include <spine/LinkedMesh.h>
 #include <spine/MathUtil.h>
 #include <spine/MeshAttachment.h>
-#include <spine/MixDirection.h>
 #include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
 #include <spine/PathAttachment.h>
 #include <spine/PathConstraint.h>
 #include <spine/PathConstraintData.h>
@@ -90,8 +92,9 @@
 #include <spine/Skin.h>
 #include <spine/Slot.h>
 #include <spine/SlotData.h>
+#include <spine/SpacingMode.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/TextureLoader.h>
 #include <spine/Timeline.h>
 #include <spine/TimelineType.h>

+ 5 - 2
spine-cpp/spine-cpp/src/spine/Animation.cpp

@@ -28,15 +28,18 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/Animation.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/Animation.h>
 #include <spine/Timeline.h>
 #include <spine/Skeleton.h>
 #include <spine/Event.h>
 
 #include <spine/ContainerUtil.h>
 
-using namespace Spine;
+using namespace spine;
 
 Animation::Animation(const String &name, Vector<Timeline *> &timelines, float duration) :
 		_timelines(timelines),

+ 42 - 38
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -28,23 +28,25 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/AnimationState.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AnimationState.h>
 #include <spine/Animation.h>
 #include <spine/Event.h>
 #include <spine/AnimationStateData.h>
 #include <spine/Skeleton.h>
 #include <spine/RotateTimeline.h>
-
 #include <spine/SkeletonData.h>
 #include <spine/Bone.h>
 #include <spine/BoneData.h>
 #include <spine/AttachmentTimeline.h>
 #include <spine/DrawOrderTimeline.h>
 
-using namespace Spine;
+using namespace spine;
 
-void dummyOnAnimationEventFunc(AnimationState *state, Spine::EventType type, TrackEntry *entry, Event *event = NULL) {
+void dummyOnAnimationEventFunc(AnimationState *state, spine::EventType type, TrackEntry *entry, Event *event = NULL) {
 	SP_UNUSED(state);
 	SP_UNUSED(type);
 	SP_UNUSED(entry);
@@ -56,9 +58,11 @@ TrackEntry::TrackEntry() : _animation(NULL), _next(NULL), _mixingFrom(NULL), _mi
 						   _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
 						   _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
 						   _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
-						   _onAnimationEventFunc(dummyOnAnimationEventFunc) {
+						   _listener(dummyOnAnimationEventFunc) {
 }
 
+TrackEntry::~TrackEntry() { }
+
 int TrackEntry::getTrackIndex() { return _trackIndex; }
 
 Animation *TrackEntry::getAnimation() { return _animation; }
@@ -157,8 +161,8 @@ void TrackEntry::resetRotationDirections() {
 	_timelinesRotation.clear();
 }
 
-void TrackEntry::setOnAnimationEventFunc(OnAnimationEventFunc inValue) {
-	_onAnimationEventFunc = inValue;
+void TrackEntry::setListener(AnimationStateListener inValue) {
+	_listener = inValue;
 }
 
 void TrackEntry::reset() {
@@ -171,7 +175,7 @@ void TrackEntry::reset() {
 	_timelineHoldMix.clear();
 	_timelinesRotation.clear();
 
-	_onAnimationEventFunc = dummyOnAnimationEventFunc;
+	_listener = dummyOnAnimationEventFunc;
 }
 
 EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) :
@@ -241,22 +245,22 @@ void EventQueue::drain() {
 			case EventType_Start:
 			case EventType_Interrupt:
 			case EventType_Complete:
-				trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL);
-				state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL);
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+				state._listener(&state, queueEntry->_type, trackEntry, NULL);
 				break;
 			case EventType_End:
-				trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL);
-				state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL);
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+				state._listener(&state, queueEntry->_type, trackEntry, NULL);
 				/* Yes, we want to fall through here */
 			case EventType_Dispose:
-				trackEntry->_onAnimationEventFunc(&state, EventType_Dispose, trackEntry, NULL);
-				state._onAnimationEventFunc(&state, EventType_Dispose, trackEntry, NULL);
+				trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL);
+				state._listener(&state, EventType_Dispose, trackEntry, NULL);
 				trackEntry->reset();
 				_trackEntryPool.free(trackEntry);
 				break;
 			case EventType_Event:
-				trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, queueEntry->_event);
-				state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+				state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
 				break;
 		}
 	}
@@ -265,17 +269,16 @@ void EventQueue::drain() {
 	_drainDisabled = false;
 }
 
-const int AnimationState::Subsequent = 0;
-const int AnimationState::First = 1;
-const int AnimationState::Hold = 2;
-const int AnimationState::HoldMix = 3;
+const int Subsequent = 0;
+const int First = 1;
+const int Hold = 2;
+const int HoldMix = 3;
 
 AnimationState::AnimationState(AnimationStateData *data) :
 		_data(data),
 		_queue(EventQueue::newEventQueue(*this, _trackEntryPool)),
 		_animationsChanged(false),
-		_rendererObject(NULL),
-		_onAnimationEventFunc(dummyOnAnimationEventFunc),
+		_listener(dummyOnAnimationEventFunc),
 		_timeScale(1) {
 }
 
@@ -413,7 +416,7 @@ bool AnimationState::apply(Skeleton &skeleton) {
 				Timeline *timeline = timelines[ii];
 				assert(timeline);
 
-				MixBlend timelineBlend = timelineMode[ii] == AnimationState::Subsequent ? blend : MixBlend_Setup;
+				MixBlend timelineBlend = timelineMode[ii] == Subsequent ? blend : MixBlend_Setup;
 
 				RotateTimeline *rotateTimeline = NULL;
 				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
@@ -609,16 +612,15 @@ void AnimationState::setTimeScale(float inValue) {
 	_timeScale = inValue;
 }
 
-void AnimationState::setOnAnimationEventFunc(OnAnimationEventFunc inValue) {
-	_onAnimationEventFunc = inValue;
+void AnimationState::setListener(AnimationStateListener inValue) {
+	_listener = inValue;
 }
 
-void AnimationState::setRendererObject(void *inValue) {
-	_rendererObject = inValue;
+void AnimationState::disableQueue() {
+	_queue->_drainDisabled = true;
 }
-
-void *AnimationState::getRendererObject() {
-	return _rendererObject;
+void AnimationState::enableQueue() {
+	_queue->_drainDisabled = false;
 }
 
 Animation *AnimationState::getEmptyAnimation() {
@@ -778,17 +780,17 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
 			MixBlend timelineBlend;
 			float alpha;
 			switch (timelineMode[i]) {
-				case AnimationState::Subsequent:
+				case Subsequent:
 					if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) continue;
 					if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue;
 					timelineBlend = blend;
 					alpha = alphaMix;
 					break;
-				case AnimationState::First:
+				case First:
 					timelineBlend = MixBlend_Setup;
 					alpha = alphaMix;
 					break;
-				case AnimationState::Hold:
+				case Hold:
 					timelineBlend = MixBlend_Setup;
 					alpha = alphaHold;
 					break;
@@ -944,6 +946,8 @@ void AnimationState::animationsChanged() {
 	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
 		TrackEntry *entry = _tracks[i];
 
+		if (!entry) continue;
+
 		while (entry->_mixingFrom != NULL)
 			entry = entry->_mixingFrom;
 
@@ -967,7 +971,7 @@ void AnimationState::setTimelineModes(TrackEntry *entry) {
 		for (size_t i = 0; i < timelinesCount; i++) {
 			int id = timelines[i]->getPropertyId();
 			if (!_propertyIDs.contains(id)) _propertyIDs.add(id);
-			timelineMode[i] = AnimationState::Hold;
+			timelineMode[i] = Hold;
 		}
 		return;
 	}
@@ -978,24 +982,24 @@ void AnimationState::setTimelineModes(TrackEntry *entry) {
 	for (; i < timelinesCount; ++i) {
 		int id = timelines[i]->getPropertyId();
 		if (_propertyIDs.contains(id)) {
-			timelineMode[i] = AnimationState::Subsequent;
+			timelineMode[i] = Subsequent;
 		} else {
 			_propertyIDs.add(id);
 
 			if (to == NULL || !hasTimeline(to, id)) {
-				timelineMode[i] = AnimationState::First;
+				timelineMode[i] = First;
 			} else {
 				for (TrackEntry *next = to->_mixingTo; next != NULL; next = next->_mixingTo) {
 					if (hasTimeline(next, id)) continue;
 					if (entry->_mixDuration > 0) {
-						timelineMode[i] = AnimationState::HoldMix;
+						timelineMode[i] = HoldMix;
 						timelineHoldMix[i] = entry;
 						i++;
 						goto continue_outer; // continue outer;
 					}
 					break;
 				}
-				timelineMode[i] = AnimationState::Hold;
+				timelineMode[i] = Hold;
 			}
 		}
 	}

+ 5 - 2
spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp

@@ -28,12 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/AnimationStateData.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AnimationStateData.h>
 #include <spine/SkeletonData.h>
 #include <spine/Animation.h>
 
-using namespace Spine;
+using namespace spine;
 
 AnimationStateData::AnimationStateData(SkeletonData *skeletonData) : _skeletonData(skeletonData), _defaultMix(0) {
 }

+ 18 - 12
spine-cpp/spine-cpp/src/spine/Atlas.cpp

@@ -28,15 +28,17 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
-#include <spine/Atlas.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/Atlas.h>
 #include <spine/TextureLoader.h>
-
 #include <spine/ContainerUtil.h>
 
 #include <ctype.h>
 
-using namespace Spine;
+using namespace spine;
 
 Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) {
 	int dirLength;
@@ -71,7 +73,7 @@ Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textu
 Atlas::~Atlas() {
 	if (_textureLoader) {
 		for (size_t i = 0, n = _pages.size(); i < n; ++i) {
-			_textureLoader->unload(_pages[i]->rendererObject);
+			_textureLoader->unload(_pages[i]->getRendererObject());
 		}
 	}
 	ContainerUtil::cleanUpVectorOfPointers(_pages);
@@ -97,6 +99,10 @@ AtlasRegion *Atlas::findRegion(const String &name) {
 	return NULL;
 }
 
+Vector<AtlasPage*> &Atlas::getPages() {
+	return _pages;
+}
+
 void Atlas::load(const char *begin, int length, const char *dir) {
 	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
 										"RGBA8888"};
@@ -133,15 +139,15 @@ void Atlas::load(const char *begin, int length, const char *dir) {
 			/* size is only optional for an atlas packed with an old TexturePacker. */
 			page->width = toInt(tuple);
 			page->height = toInt(tuple + 1);
-			assert(readTuple(&begin, end, tuple));
+			readTuple(&begin, end, tuple);
 
 			page->format = (Format) indexOf(formatNames, 8, tuple);
 
-			assert(readTuple(&begin, end, tuple));
+			readTuple(&begin, end, tuple);
 			page->minFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple);
 			page->magFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple + 1);
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 
 			page->uWrap = TextureWrap_ClampToEdge;
 			page->vWrap = TextureWrap_ClampToEdge;
@@ -169,14 +175,14 @@ void Atlas::load(const char *begin, int length, const char *dir) {
 			region->page = page;
 			region->name = String(mallocString(&str), true);
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 			region->rotate = equals(&str, "true") ? true : false;
 
-			assert(readTuple(&begin, end, tuple) == 2);
+			readTuple(&begin, end, tuple);
 			region->x = toInt(tuple);
 			region->y = toInt(tuple + 1);
 
-			assert(readTuple(&begin, end, tuple) == 2);
+			readTuple(&begin, end, tuple);
 			region->width = toInt(tuple);
 			region->height = toInt(tuple + 1);
 
@@ -212,7 +218,7 @@ void Atlas::load(const char *begin, int length, const char *dir) {
 					region->pads[2] = toInt(tuple + 2);
 					region->pads[3] = toInt(tuple + 3);
 
-					assert(readTuple(&begin, end, tuple));
+					readTuple(&begin, end, tuple);
 				}
 			}
 
@@ -223,7 +229,7 @@ void Atlas::load(const char *begin, int length, const char *dir) {
 			region->offsetX = (float)toInt(tuple);
 			region->offsetY = (float)toInt(tuple + 1);
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 
 			region->index = toInt(&str);
 

+ 13 - 6
spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp

@@ -28,8 +28,11 @@
 * POSSIBILITY OF SUCH DAMAGE.
 ******************************************************S**********************/
 
-#include <spine/AtlasAttachmentLoader.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AtlasAttachmentLoader.h>
 #include <spine/Skin.h>
 #include <spine/RegionAttachment.h>
 #include <spine/MeshAttachment.h>
@@ -40,7 +43,7 @@
 
 #include <spine/Atlas.h>
 
-namespace Spine {
+namespace spine {
 RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader)
 
 AtlasAttachmentLoader::AtlasAttachmentLoader(Atlas *atlas) : AttachmentLoader(), _atlas(atlas) {
@@ -50,14 +53,14 @@ RegionAttachment *AtlasAttachmentLoader::newRegionAttachment(Skin &skin, const S
 	SP_UNUSED(skin);
 
 	AtlasRegion *regionP = findRegion(path);
-	assert(regionP != NULL);
+	if (!regionP) return NULL;
 
 	AtlasRegion &region = *regionP;
 
 	RegionAttachment *attachmentP = new(__FILE__, __LINE__) RegionAttachment(name);
 
 	RegionAttachment &attachment = *attachmentP;
-	attachment._rendererObject = regionP;
+	attachment.setRendererObject(regionP);
 	attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
 	attachment._regionOffsetX = region.offsetX;
 	attachment._regionOffsetY = region.offsetY;
@@ -72,14 +75,14 @@ MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const Strin
 	SP_UNUSED(skin);
 
 	AtlasRegion *regionP = findRegion(path);
-	assert(regionP != NULL);
+	if (!regionP) return NULL;
 
 	AtlasRegion &region = *regionP;
 
 	MeshAttachment *attachmentP = new(__FILE__, __LINE__) MeshAttachment(name);
 
 	MeshAttachment &attachment = *attachmentP;
-	attachment._rendererObject = regionP;
+	attachment.setRendererObject(regionP);
 	attachment._regionU = region.u;
 	attachment._regionV = region.v;
 	attachment._regionU2 = region.u2;
@@ -115,6 +118,10 @@ ClippingAttachment *AtlasAttachmentLoader::newClippingAttachment(Skin &skin, con
 	return new(__FILE__, __LINE__) ClippingAttachment(name);
 }
 
+void AtlasAttachmentLoader::configureAttachment(Attachment* attachment) {
+	SP_UNUSED(attachment);
+}
+
 AtlasRegion *AtlasAttachmentLoader::findRegion(const String &name) {
 	return _atlas->findRegion(name);
 }

+ 5 - 1
spine-cpp/spine-cpp/src/spine/Attachment.cpp

@@ -28,11 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Attachment.h>
 
 #include <assert.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL_NOPARENT(Attachment)
 

+ 5 - 1
spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/AttachmentLoader.h>
 
 #include <spine/Skin.h>
@@ -38,7 +42,7 @@
 #include <spine/PointAttachment.h>
 #include <spine/ClippingAttachment.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL_NOPARENT(AttachmentLoader)
 

+ 5 - 1
spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/AttachmentTimeline.h>
 
 #include <spine/Skeleton.h>
@@ -38,7 +42,7 @@
 #include <spine/Slot.h>
 #include <spine/SlotData.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(AttachmentTimeline, Timeline)
 

+ 26 - 15
spine-cpp/spine-cpp/src/spine/Bone.cpp

@@ -28,12 +28,16 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Bone.h>
 
 #include <spine/BoneData.h>
 #include <spine/Skeleton.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(Bone, Updatable)
 
@@ -148,11 +152,11 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
 				s = MathUtil::abs(pa * pd - pb * pc) / s;
 				pb = pc * s;
 				pd = pa * s;
-				prx = MathUtil::atan2(pc, pa) * RAD_DEG;
+				prx = MathUtil::atan2(pc, pa) * MathUtil::Rad_Deg;
 			} else {
 				pa = 0;
 				pc = 0;
-				prx = 90 - MathUtil::atan2(pd, pb) * RAD_DEG;
+				prx = 90 - MathUtil::atan2(pd, pb) * MathUtil::Rad_Deg;
 			}
 			rx = rotation + shearX - prx;
 			ry = rotation + shearY - prx + 90;
@@ -179,7 +183,7 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
 			za *= s;
 			zc *= s;
 			s = MathUtil::sqrt(za * za + zc * zc);
-			r = PI / 2 + MathUtil::atan2(zc, za);
+			r = MathUtil::Pi / 2 + MathUtil::atan2(zc, za);
 			zb = MathUtil::cos(r) * s;
 			zd = MathUtil::sin(r) * s;
 			la = MathUtil::cosDeg(shearX) * scaleX;
@@ -233,14 +237,14 @@ float Bone::worldToLocalRotation(float worldRotation) {
 	float sin = MathUtil::sinDeg(worldRotation);
 	float cos = MathUtil::cosDeg(worldRotation);
 
-	return MathUtil::atan2(_a * sin - _c * cos, _d * cos - _b * sin) * RAD_DEG;
+	return MathUtil::atan2(_a * sin - _c * cos, _d * cos - _b * sin) * MathUtil::Rad_Deg;
 }
 
 float Bone::localToWorldRotation(float localRotation) {
 	float sin = MathUtil::sinDeg(localRotation);
 	float cos = MathUtil::cosDeg(localRotation);
 
-	return MathUtil::atan2(cos * _c + sin * _d, cos * _a + sin * _b) * RAD_DEG;
+	return MathUtil::atan2(cos * _c + sin * _d, cos * _a + sin * _b) * MathUtil::Rad_Deg;
 }
 
 void Bone::rotateWorld(float degrees) {
@@ -273,7 +277,7 @@ float Bone::getWorldToLocalRotationX() {
 	float a = _a;
 	float c = _c;
 
-	return MathUtil::atan2(pa * c - pc * a, pd * a - pb * c) * RAD_DEG;
+	return MathUtil::atan2(pa * c - pc * a, pd * a - pb * c) * MathUtil::Rad_Deg;
 }
 
 float Bone::getWorldToLocalRotationY() {
@@ -289,7 +293,7 @@ float Bone::getWorldToLocalRotationY() {
 	float b = _b;
 	float d = _d;
 
-	return MathUtil::atan2(pa * d - pc * b, pd * b - pb * d) * RAD_DEG;
+	return MathUtil::atan2(pa * d - pc * b, pd * b - pb * d) * MathUtil::Rad_Deg;
 }
 
 BoneData &Bone::getData() {
@@ -469,11 +473,11 @@ void Bone::setWorldY(float inValue) {
 }
 
 float Bone::getWorldRotationX() {
-	return MathUtil::atan2(_c, _a) * RAD_DEG;
+	return MathUtil::atan2(_c, _a) * MathUtil::MathUtil::Rad_Deg;
 }
 
 float Bone::getWorldRotationY() {
-	return MathUtil::atan2(_d, _b) * RAD_DEG;
+	return MathUtil::atan2(_d, _b) * MathUtil::Rad_Deg;
 }
 
 float Bone::getWorldScaleX() {
@@ -484,17 +488,24 @@ float Bone::getWorldScaleY() {
 	return MathUtil::sqrt(_b * _b + _d * _d);
 }
 
+bool Bone::isAppliedValid() {
+	return _appliedValid;
+}
+void Bone::setAppliedValid(bool valid) {
+	_appliedValid = valid;
+}
+
 void Bone::updateAppliedTransform() {
 	Bone *parent = _parent;
 	_appliedValid = 1;
 	if (!parent) {
 		_ax = _worldX;
 		_ay = _worldY;
-		_arotation = MathUtil::atan2(_c, _a) * RAD_DEG;
+		_arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg;
 		_ascaleX = MathUtil::sqrt(_a * _a + _c * _c);
 		_ascaleY = MathUtil::sqrt(_b * _b + _d * _d);
 		_ashearX = 0;
-		_ashearY = MathUtil::atan2(_a * _b + _c * _d, _a * _d - _b * _c) * RAD_DEG;
+		_ashearY = MathUtil::atan2(_a * _b + _c * _d, _a * _d - _b * _c) * MathUtil::Rad_Deg;
 	} else {
 		float pa = parent->_a, pb = parent->_b, pc = parent->_c, pd = parent->_d;
 		float pid = 1 / (pa * pd - pb * pc);
@@ -514,13 +525,13 @@ void Bone::updateAppliedTransform() {
 		if (_ascaleX > 0.0001f) {
 			float det = ra * rd - rb * rc;
 			_ascaleY = det / _ascaleX;
-			_ashearY = MathUtil::atan2(ra * rb + rc * rd, det) * RAD_DEG;
-			_arotation = MathUtil::atan2(rc, ra) * RAD_DEG;
+			_ashearY = MathUtil::atan2(ra * rb + rc * rd, det) * MathUtil::Rad_Deg;
+			_arotation = MathUtil::atan2(rc, ra) * MathUtil::Rad_Deg;
 		} else {
 			_ascaleX = 0;
 			_ascaleY = MathUtil::sqrt(rb * rb + rd * rd);
 			_ashearY = 0;
-			_arotation = 90 - MathUtil::atan2(rd, rb) * RAD_DEG;
+			_arotation = 90 - MathUtil::atan2(rd, rb) * MathUtil::Rad_Deg;
 		}
 	}
 }

+ 5 - 1
spine-cpp/spine-cpp/src/spine/BoneData.cpp

@@ -28,11 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/BoneData.h>
 
 #include <assert.h>
 
-using namespace Spine;
+using namespace spine;
 
 BoneData::BoneData(int index, const String &name, BoneData *parent) :
 		_index(index),

+ 5 - 1
spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp

@@ -28,9 +28,13 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/BoundingBoxAttachment.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(BoundingBoxAttachment, VertexAttachment)
 

+ 5 - 1
spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp

@@ -28,11 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ClippingAttachment.h>
 
 #include <spine/SlotData.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(ClippingAttachment, VertexAttachment)
 

+ 6 - 2
spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ColorTimeline.h>
 
 #include <spine/Skeleton.h>
@@ -38,7 +42,7 @@
 #include <spine/Slot.h>
 #include <spine/SlotData.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(ColorTimeline, CurveTimeline)
 
@@ -71,7 +75,7 @@ void ColorTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector
 				slot._color.set(slot._data._color);
 				return;
 			case MixBlend_First: {
-				Color color = slot._color, setup = slot._data._color;
+				Color &color = slot._color, setup = slot._data._color;
 				color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,
 						  (setup.a - color.a) * alpha);
 			}

+ 5 - 1
spine-cpp/spine-cpp/src/spine/Constraint.cpp

@@ -28,9 +28,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Constraint.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(Constraint, Updatable)
 

+ 5 - 1
spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp

@@ -28,11 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/CurveTimeline.h>
 
 #include <spine/MathUtil.h>
 
-using namespace Spine;
+using namespace spine;
 
 RTTI_IMPL(CurveTimeline, Timeline)
 

Some files were not shown because too many files changed in this diff