Browse Source

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

badlogic 6 years ago
parent
commit
02c6f9cc63
100 changed files with 656 additions and 389 deletions
  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
 Copyright (c) 2013-2016, Esoteric Software
 All rights reserved.
 All rights reserved.
 
 
 You are granted a perpetual, non-exclusive, non-sublicensable, and
 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
 Runtimes software and derivative works solely for personal or internal
 use. Without the written permission of Esoteric Software (see Section 2 of
 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,
 delete, alter, or obscure any trademarks or any copyright, trademark, patent,
 or other intellectual property or proprietary rights notices on or in the
 or other intellectual property or proprietary rights notices on or in the
 Software, including any copy thereof. Redistributions in binary or source
 Software, including any copy thereof. Redistributions in binary or source

+ 23 - 15
spine-cpp/README.md

@@ -1,39 +1,47 @@
 # spine-cpp
 # 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
 ## 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
 ## 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
 ## 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 }
   virtual void unload(void* texture) { // TODO }
 };
 };
+```
 
 
 ## Runtimes extending spine-cpp
 ## 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
 # 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
 ## 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.
 [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
 ## 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
 original "walk"": 330
 second "walk": 0d0
 second "walk": 0d0

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

@@ -34,7 +34,7 @@
 
 
 #pragma warning ( disable : 4710 )
 #pragma warning ( disable : 4710 )
 
 
-using namespace Spine;
+using namespace spine;
 
 
 void loadBinary(const String &binaryFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData,
 void loadBinary(const String &binaryFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData,
 				AnimationStateData *&stateData, Skeleton *&skeleton, AnimationState *&state) {
 				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) {
 int main(int argc, char **argv) {
-	DebugExtension *ext = new DebugExtension();
-	SpineExtension::setInstance(ext);
+	DebugExtension debug(SpineExtension::getInstance());
+	SpineExtension::setInstance(&debug);
 
 
 	testLoading();
 	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/MixBlend.h>
 #include <spine/MixDirection.h>
 #include <spine/MixDirection.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
-namespace Spine {
+namespace spine {
 class Timeline;
 class Timeline;
 
 
 class Skeleton;
 class Skeleton;
 
 
 class Event;
 class Event;
 
 
-class Animation : public SpineObject {
+class SP_API Animation : public SpineObject {
 	friend class AnimationState;
 	friend class AnimationState;
 
 
 	friend class TrackEntry;
 	friend class TrackEntry;

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

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

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

@@ -33,27 +33,27 @@
 
 
 #include <spine/HashMap.h>
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
 #include <assert.h>
 #include <assert.h>
 
 
-namespace Spine {
+namespace spine {
     class SkeletonData;
     class SkeletonData;
     class Animation;
     class Animation;
     
     
     /// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
     /// 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;
         friend class AnimationState;
         
         
     public:
     public:
+		explicit AnimationStateData(SkeletonData* skeletonData);
+		
         /// The SkeletonData to look up animations when they are specified by name.
         /// The SkeletonData to look up animations when they are specified by name.
         SkeletonData* getSkeletonData();
         SkeletonData* getSkeletonData();
         
         
         /// The mix duration to use when no mix duration has been specifically defined between two animations.
         /// The mix duration to use when no mix duration has been specifically defined between two animations.
         float getDefaultMix();
         float getDefaultMix();
         void setDefaultMix(float inValue);
         void setDefaultMix(float inValue);
-
-        explicit AnimationStateData(SkeletonData* skeletonData);
         
         
         /// Sets a mix duration by animation names.
         /// Sets a mix duration by animation names.
         void setMix(const String& fromName, const String& toName, float duration);
         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/Vector.h>
 #include <spine/Extension.h>
 #include <spine/Extension.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
+#include <spine/HasRendererObject.h>
 
 
-namespace Spine {
+namespace spine {
 enum Format {
 enum Format {
 	Format_Alpha,
 	Format_Alpha,
 	Format_Intensity,
 	Format_Intensity,
@@ -64,7 +65,7 @@ enum TextureWrap {
 	TextureWrap_Repeat
 	TextureWrap_Repeat
 };
 };
 
 
-class AtlasPage : public SpineObject {
+class SP_API AtlasPage : public SpineObject, public HasRendererObject {
 public:
 public:
 	String name;
 	String name;
 	Format format;
 	Format format;
@@ -72,16 +73,17 @@ public:
 	TextureFilter magFilter;
 	TextureFilter magFilter;
 	TextureWrap uWrap;
 	TextureWrap uWrap;
 	TextureWrap vWrap;
 	TextureWrap vWrap;
-	void *rendererObject;
 	int width, height;
 	int width, height;
 
 
 	explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
 	explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
 											   magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
 											   magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
 											   vWrap(TextureWrap_ClampToEdge) {
 											   vWrap(TextureWrap_ClampToEdge) {
 	}
 	}
+
+	virtual ~AtlasPage() { }
 };
 };
 
 
-class AtlasRegion : public SpineObject {
+class SP_API AtlasRegion : public SpineObject {
 public:
 public:
 	AtlasPage *page;
 	AtlasPage *page;
 	String name;
 	String name;
@@ -97,7 +99,7 @@ public:
 
 
 class TextureLoader;
 class TextureLoader;
 
 
-class Atlas : public SpineObject {
+class SP_API Atlas : public SpineObject {
 public:
 public:
 	Atlas(const String &path, TextureLoader *textureLoader);
 	Atlas(const String &path, TextureLoader *textureLoader);
 
 
@@ -112,6 +114,8 @@ public:
 	/// @return The region, or NULL.
 	/// @return The region, or NULL.
 	AtlasRegion *findRegion(const String &name);
 	AtlasRegion *findRegion(const String &name);
 
 
+	Vector<AtlasPage*> &getPages();
+
 private:
 private:
 	Vector<AtlasPage *> _pages;
 	Vector<AtlasPage *> _pages;
 	Vector<AtlasRegion *> _regions;
 	Vector<AtlasRegion *> _regions;

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

@@ -33,10 +33,10 @@
 
 
 #include <spine/AttachmentLoader.h>
 #include <spine/AttachmentLoader.h>
 #include <spine/Vector.h>
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
 
 
-namespace Spine {
+namespace spine {
     class Atlas;
     class Atlas;
     class AtlasRegion;
     class AtlasRegion;
     
     
@@ -44,10 +44,10 @@ namespace Spine {
     /// An AttachmentLoader that configures attachments using texture regions from an Atlas.
     /// 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.
     /// 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:
     public:
+		RTTI_DECL
+		
         explicit AtlasAttachmentLoader(Atlas* atlas);
         explicit AtlasAttachmentLoader(Atlas* atlas);
         
         
         virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
         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 PointAttachment* newPointAttachment(Skin& skin, const String& name);
         
         
         virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
         virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
+
+		virtual void configureAttachment(Attachment* attachment);
         
         
         AtlasRegion* findRegion(const String& name);
         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/RTTI.h>
 #include <spine/SpineObject.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
 RTTI_DECL
 
 
 public:
 public:

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

@@ -33,10 +33,11 @@
 
 
 #include <spine/RTTI.h>
 #include <spine/RTTI.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
-namespace Spine {
+namespace spine {
     class Skin;
     class Skin;
+    class Attachment;
     class RegionAttachment;
     class RegionAttachment;
     class MeshAttachment;
     class MeshAttachment;
     class BoundingBoxAttachment;
     class BoundingBoxAttachment;
@@ -44,7 +45,8 @@ namespace Spine {
     class PointAttachment;
     class PointAttachment;
     class ClippingAttachment;
     class ClippingAttachment;
     
     
-    class AttachmentLoader : public SpineObject {
+    class SP_API AttachmentLoader : public SpineObject {
+	public:
         RTTI_DECL
         RTTI_DECL
         
         
         AttachmentLoader();
         AttachmentLoader();
@@ -66,6 +68,8 @@ namespace Spine {
         virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
         virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
         
         
         virtual ClippingAttachment* newClippingAttachment(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/Vector.h>
 #include <spine/MixBlend.h>
 #include <spine/MixBlend.h>
 #include <spine/MixDirection.h>
 #include <spine/MixDirection.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
+
+namespace spine {
 
 
-namespace Spine {
     class Skeleton;
     class Skeleton;
     class Event;
     class Event;
     
     
-    class AttachmentTimeline : public Timeline {
+    class SP_API AttachmentTimeline : public Timeline {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         

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

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

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

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

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

@@ -35,7 +35,7 @@
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 
 
-namespace Spine {
+namespace spine {
 class BoneData;
 class BoneData;
 
 
 class Skeleton;
 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
 /// 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
 /// 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.
 /// 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 AnimationState;
 
 
 	friend class RotateTimeline;
 	friend class RotateTimeline;
@@ -221,6 +221,9 @@ public:
 	/// Returns the magnitide (always positive) of the world scale Y.
 	/// Returns the magnitide (always positive) of the world scale Y.
 	float getWorldScaleY();
 	float getWorldScaleY();
 
 
+	bool isAppliedValid();
+	void setAppliedValid(bool valid);
+
 private:
 private:
 	static bool yDown;
 	static bool yDown;
 
 

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

@@ -33,10 +33,10 @@
 
 
 #include <spine/TransformMode.h>
 #include <spine/TransformMode.h>
 #include <spine/SpineObject.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 SkeletonBinary;
 
 
 	friend class SkeletonJson;
 	friend class SkeletonJson;

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

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

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

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

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

@@ -32,8 +32,8 @@
 
 
 #include <spine/MathUtil.h>
 #include <spine/MathUtil.h>
 
 
-namespace Spine {
-class Color : public SpineObject {
+namespace spine {
+class SP_API Color : public SpineObject {
 public:
 public:
 	Color() : r(0), g(0), b(0), a(0) {
 	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>
 #include <spine/CurveTimeline.h>
 
 
-namespace Spine {
-class ColorTimeline : public CurveTimeline {
+namespace spine {
+class SP_API ColorTimeline : public CurveTimeline {
 	friend class SkeletonBinary;
 	friend class SkeletonBinary;
 
 
 	friend class SkeletonJson;
 	friend class SkeletonJson;
@@ -62,8 +62,15 @@ public:
 	Vector<float> &getFrames();
 	Vector<float> &getFrames();
 
 
 protected:
 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:
 private:
 	int _slotIndex;
 	int _slotIndex;

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

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

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

@@ -35,12 +35,12 @@
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 #include <spine/HashMap.h>
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
 #include <assert.h>
 #include <assert.h>
 
 
-namespace Spine {
-    class ContainerUtil : public SpineObject {
+namespace spine {
+    class SP_API ContainerUtil : public SpineObject {
     public:
     public:
         /// Finds an item by comparing each item's name.
         /// 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.
         /// 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/Timeline.h>
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 
 
-namespace Spine {
+namespace spine {
     /// Base class for frames that use an interpolation bezier curve.
     /// Base class for frames that use an interpolation bezier curve.
-    class CurveTimeline : public Timeline {
+    class SP_API CurveTimeline : public Timeline {
         RTTI_DECL
         RTTI_DECL
         
         
     public:
     public:

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

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

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

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

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

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

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

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

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

@@ -32,11 +32,11 @@
 #define Spine_EventData_h
 #define Spine_EventData_h
 
 
 #include <spine/SpineObject.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.
 /// Stores the setup pose values for an Event.
-class EventData : public SpineObject {
+class SP_API EventData : public SpineObject {
 	friend class SkeletonBinary;
 	friend class SkeletonBinary;
 
 
 	friend class SkeletonJson;
 	friend class SkeletonJson;

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

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

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

@@ -32,13 +32,14 @@
 #define Spine_Extension_h
 #define Spine_Extension_h
 
 
 #include <stdlib.h>
 #include <stdlib.h>
+#include <spine/dll.h>
 
 
 #define SP_UNUSED(x) (void)(x)
 #define SP_UNUSED(x) (void)(x)
 
 
-namespace Spine {
+namespace spine {
 class String;
 class String;
 
 
-class SpineExtension {
+class SP_API SpineExtension {
 public:
 public:
 	template<typename T>
 	template<typename T>
 	static T *alloc(size_t num, const char *file, int line) {
 	static T *alloc(size_t num, const char *file, int line) {
@@ -70,7 +71,6 @@ public:
 
 
 	virtual ~SpineExtension();
 	virtual ~SpineExtension();
 
 
-protected:
 	/// Implement this function to use your own memory allocator
 	/// Implement this function to use your own memory allocator
 	virtual void *_alloc(size_t size, const char *file, int line) = 0;
 	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;
 	virtual char *_readFile(const String &path, int *length) = 0;
 
 
+protected:
 	SpineExtension();
 	SpineExtension();
 
 
 private:
 private:
 	static SpineExtension *_instance;
 	static SpineExtension *_instance;
 };
 };
 
 
-class DefaultSpineExtension : public SpineExtension {
+class SP_API DefaultSpineExtension : public SpineExtension {
 public:
 public:
 	DefaultSpineExtension();
 	DefaultSpineExtension();
 
 
@@ -107,18 +108,11 @@ protected:
 	virtual char *_readFile(const String &path, int *length);
 	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 */
 #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)
 #pragma warning(disable:4291)
 #endif
 #endif
 
 
-namespace Spine {
+namespace spine {
 template<typename K, typename V>
 template<typename K, typename V>
-class HashMap : public SpineObject {
+class SP_API HashMap : public SpineObject {
 private:
 private:
 	class Entry;
 	class Entry;
 
 
 public:
 public:
-	class Pair {
+	class SP_API Pair {
 	public:
 	public:
 		explicit Pair(K &k, V &v) : key(k), value(v) {}
 		explicit Pair(K &k, V &v) : key(k), value(v) {}
 
 
@@ -55,7 +55,7 @@ public:
 		V &value;
 		V &value;
 	};
 	};
 
 
-	class Entries {
+	class SP_API Entries {
 	public:
 	public:
 		friend class HashMap;
 		friend class HashMap;
 
 
@@ -167,7 +167,7 @@ private:
 		return NULL;
 		return NULL;
 	}
 	}
 
 
-	class Entry : public SpineObject {
+	class SP_API Entry : public SpineObject {
 	public:
 	public:
 		K _key;
 		K _key;
 		V _value;
 		V _value;

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

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

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

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

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

@@ -33,8 +33,9 @@
 
 
 #include <spine/CurveTimeline.h>
 #include <spine/CurveTimeline.h>
 
 
-namespace Spine {
-    class IkConstraintTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API IkConstraintTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         
@@ -53,9 +54,16 @@ namespace Spine {
         void setFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch);
         void setFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch);
         
         
     private:
     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;
         Vector<float> _frames;
         int _ikConstraintIndex;
         int _ikConstraintIndex;
     };
     };

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

@@ -34,12 +34,12 @@
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
 
 
 #ifndef SPINE_JSON_HAVE_PREV
 #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
 #define SPINE_JSON_HAVE_PREV 0
 #endif
 #endif
 
 
-namespace Spine {
-class Json : public SpineObject {
+namespace spine {
+class SP_API Json : public SpineObject {
 	friend class SkeletonJson;
 	friend class SkeletonJson;
 
 
 public:
 public:

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

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

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

@@ -33,19 +33,20 @@
 
 
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
 
 
-#include <float.h>
 #include <string.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();
 	MathUtil();
 
 
+public:
+	static const float Pi;
+	static const float Pi_2;
+	static const float Deg_Rad;
+	static const float Rad_Deg;
+
 	template<typename T>
 	template<typename T>
 	static inline T min(T a, T b) { return a < b ? a : b; }
 	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);
 	static float pow(float a, float b);
 };
 };
 
 
-struct Interpolation {
+struct SP_API Interpolation {
 	virtual float apply(float a) = 0;
 	virtual float apply(float a) = 0;
 
 
 	virtual float interpolate(float start, float end, float a) {
 	virtual float interpolate(float start, float end, float a) {
@@ -101,7 +102,7 @@ struct Interpolation {
 	virtual ~Interpolation() {};
 	virtual ~Interpolation() {};
 };
 };
 
 
-struct PowInterpolation: public Interpolation {
+struct SP_API PowInterpolation: public Interpolation {
 	PowInterpolation(int power): power(power) {
 	PowInterpolation(int power): power(power) {
 	}
 	}
 
 
@@ -113,7 +114,7 @@ struct PowInterpolation: public Interpolation {
 	int power;
 	int power;
 };
 };
 
 
-struct PowOutInterpolation: public Interpolation {
+struct SP_API PowOutInterpolation: public Interpolation {
 	PowOutInterpolation(int power): power(power) {
 	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/VertexAttachment.h>
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 #include <spine/Color.h>
 #include <spine/Color.h>
+#include <spine/HasRendererObject.h>
 
 
-namespace Spine {
+namespace spine {
     /// Attachment that displays a texture region using a mesh.
     /// 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 SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         friend class AtlasAttachmentLoader;
         friend class AtlasAttachmentLoader;
@@ -47,6 +48,8 @@ namespace Spine {
     public:
     public:
         explicit MeshAttachment(const String& name);
         explicit MeshAttachment(const String& name);
 
 
+        virtual ~MeshAttachment();
+
         void updateUVs();
         void updateUVs();
 
 
         virtual bool applyDeform(VertexAttachment* sourceAttachment);
         virtual bool applyDeform(VertexAttachment* sourceAttachment);
@@ -65,8 +68,6 @@ namespace Spine {
         
         
         const String& getPath();
         const String& getPath();
         void setPath(const String& inValue);
         void setPath(const String& inValue);
-        void* getRendererObject();
-        void setRendererObject(void* inValue);
         
         
         float getRegionU();
         float getRegionU();
         void setRegionU(float inValue);
         void setRegionU(float inValue);
@@ -124,7 +125,6 @@ namespace Spine {
         Vector<float> _regionUVs;
         Vector<float> _regionUVs;
         Vector<unsigned short> _triangles;
         Vector<unsigned short> _triangles;
         Vector<unsigned short> _edges;
         Vector<unsigned short> _edges;
-        void* _rendererObject;
         String _path;
         String _path;
         float _regionU;
         float _regionU;
         float _regionV;
         float _regionV;

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

@@ -31,7 +31,7 @@
 #ifndef Spine_MixPose_h
 #ifndef Spine_MixPose_h
 #define Spine_MixPose_h
 #define Spine_MixPose_h
 
 
-namespace Spine {
+namespace spine {
 ///
 ///
 /// Controls how a timeline is mixed with the setup or current pose.
 /// Controls how a timeline is mixed with the setup or current pose.
 /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection)
 /// 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
 #ifndef Spine_MixDirection_h
 #define 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).
 /// 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)
 /// 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>
 #include <spine/VertexAttachment.h>
 
 
-namespace Spine {
-    class PathAttachment : public VertexAttachment {
+namespace spine {
+    class SP_API PathAttachment : public VertexAttachment {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         

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

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

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

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

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

@@ -33,8 +33,10 @@
 
 
 #include <spine/CurveTimeline.h>
 #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 SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         
@@ -50,8 +52,11 @@ namespace Spine {
         virtual int getPropertyId();
         virtual int getPropertyId();
         
         
     private:
     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;
         Vector<float> _frames;
         int _pathConstraintIndex;
         int _pathConstraintIndex;

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

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

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

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

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

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

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

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

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

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

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

@@ -35,8 +35,8 @@
 
 
 #include <string>
 #include <string>
 
 
-namespace Spine {
-class RTTI : public SpineObject {
+namespace spine {
+class SP_API RTTI : public SpineObject {
 public:
 public:
 	explicit RTTI(const std::string &className);
 	explicit RTTI(const std::string &className);
 
 
@@ -61,16 +61,16 @@ private:
 
 
 #define RTTI_DECL \
 #define RTTI_DECL \
 public: \
 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) \
 #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) \
 #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 */
 #endif /* Spine_RTTI_h */
 
 

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -34,10 +34,10 @@
 #include <spine/TransformMode.h>
 #include <spine/TransformMode.h>
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 #include <spine/Color.h>
 
 
-namespace Spine {
+namespace spine {
     class SkeletonData;
     class SkeletonData;
     class Atlas;
     class Atlas;
     class AttachmentLoader;
     class AttachmentLoader;
@@ -48,7 +48,7 @@ namespace Spine {
     class Animation;
     class Animation;
     class CurveTimeline;
     class CurveTimeline;
     
     
-    class SkeletonBinary : public SpineObject {
+    class SP_API SkeletonBinary : public SpineObject {
     public:
     public:
         static const int BONE_ROTATE;
         static const int BONE_ROTATE;
         static const int BONE_TRANSLATE;
         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/Vector.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
 
 
-namespace Spine {
+namespace spine {
     class Skeleton;
     class Skeleton;
     class BoundingBoxAttachment;
     class BoundingBoxAttachment;
     class Polygon;
     class Polygon;
@@ -43,7 +43,7 @@ namespace Spine {
     /// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon.
     /// 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.
     /// The polygon vertices are provided along with convenience methods for doing hit detection.
     ///
     ///
-    class SkeletonBounds : public SpineObject {
+    class SP_API SkeletonBounds : public SpineObject {
     public:
     public:
         SkeletonBounds();
         SkeletonBounds();
         
         

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

@@ -34,11 +34,11 @@
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 #include <spine/Triangulator.h>
 #include <spine/Triangulator.h>
 
 
-namespace Spine {
+namespace spine {
     class Slot;
     class Slot;
     class ClippingAttachment;
     class ClippingAttachment;
     
     
-    class SkeletonClipping : public SpineObject {
+    class SP_API SkeletonClipping : public SpineObject {
     public:
     public:
         SkeletonClipping();
         SkeletonClipping();
 
 
@@ -47,8 +47,10 @@ namespace Spine {
         void clipEnd(Slot& slot);
         void clipEnd(Slot& slot);
         
         
         void clipEnd();
         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();
         bool isClipping();
         
         

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -32,12 +32,17 @@
 #define Spine_Object_h
 #define Spine_Object_h
 
 
 #include <new>
 #include <new>
+#include <stddef.h>
 
 
-namespace Spine {
+#include <spine/dll.h>
+
+namespace spine {
 class String;
 class String;
 
 
-class SpineObject {
+class SP_API SpineObject {
 public:
 public:
+	void *operator new(size_t sz);
+
 	void *operator new(size_t sz, const char *file, int line);
 	void *operator new(size_t sz, const char *file, int line);
 
 
 	void *operator new(size_t sz, void *ptr);
 	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)
 #pragma warning(disable:4996)
 #endif
 #endif
 
 
-namespace Spine {
-class String : public SpineObject {
+namespace spine {
+class SP_API String : public SpineObject {
 public:
 public:
 	String() : _length(0), _buffer(NULL) {
 	String() : _length(0), _buffer(NULL) {
 	}
 	}

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

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

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

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

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

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

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

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

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

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

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

@@ -33,8 +33,9 @@
 
 
 #include <spine/CurveTimeline.h>
 #include <spine/CurveTimeline.h>
 
 
-namespace Spine {
-    class TransformConstraintTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TransformConstraintTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         
@@ -52,8 +53,15 @@ namespace Spine {
         void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
         void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
         
         
     private:
     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;
         Vector<float> _frames;
         int _transformConstraintIndex;
         int _transformConstraintIndex;

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

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

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

@@ -36,8 +36,9 @@
 #include <spine/Animation.h>
 #include <spine/Animation.h>
 #include <spine/TimelineType.h>
 #include <spine/TimelineType.h>
 
 
-namespace Spine {
-    class TranslateTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TranslateTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         
@@ -58,8 +59,11 @@ namespace Spine {
         void setFrame(int frameIndex, float time, float x, float y);
         void setFrame(int frameIndex, float time, float x, float y);
         
         
     protected:
     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;
         Vector<float> _frames;
         int _boneIndex;
         int _boneIndex;

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

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

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

@@ -33,8 +33,9 @@
 
 
 #include <spine/CurveTimeline.h>
 #include <spine/CurveTimeline.h>
 
 
-namespace Spine {
-    class TwoColorTimeline : public CurveTimeline {
+namespace spine {
+
+    class SP_API TwoColorTimeline : public CurveTimeline {
         friend class SkeletonBinary;
         friend class SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         
         
@@ -56,9 +57,21 @@ namespace Spine {
         void setSlotIndex(int inValue);
         void setSlotIndex(int inValue);
         
         
     private:
     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, ...
         Vector<float> _frames; // time, r, g, b, a, r2, g2, b2, ...
         int _slotIndex;
         int _slotIndex;

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

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

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

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

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

@@ -35,11 +35,11 @@
 
 
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 
 
-namespace Spine {
+namespace spine {
     class Slot;
     class Slot;
     
     
     /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
     /// 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 SkeletonBinary;
         friend class SkeletonJson;
         friend class SkeletonJson;
         friend class DeformTimeline;
         friend class DeformTimeline;
@@ -50,7 +50,8 @@ namespace Spine {
         explicit VertexAttachment(const String& name);
         explicit VertexAttachment(const String& name);
 
 
         virtual ~VertexAttachment();
         virtual ~VertexAttachment();
-        
+		
+		void computeWorldVertices(Slot& slot, float* worldVertices);
         void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
         void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
         
         
         /// Transforms local vertices to world coordinates.
         /// 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 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 offset The worldVertices index to begin writing values.
         /// @param stride The number of worldVertices entries between the value pairs written.
         /// @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);
         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.
         /// @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/SpineObject.h>
 #include <spine/MathUtil.h>
 #include <spine/MathUtil.h>
 
 
-namespace Spine {
+namespace spine {
 
 
 class Skeleton;
 class Skeleton;
 class Color;
 class Color;
 
 
-class VertexEffect: public SpineObject {
+class SP_API VertexEffect: public SpineObject {
 public:
 public:
 	virtual void begin(Skeleton& skeleton) = 0;
 	virtual void begin(Skeleton& skeleton) = 0;
 	virtual void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark) = 0;
 	virtual void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark) = 0;
 	virtual void end() = 0;
 	virtual void end() = 0;
 };
 };
 
 
-class JitterVertexEffect: public VertexEffect {
+class SP_API JitterVertexEffect: public VertexEffect {
 public:
 public:
 	JitterVertexEffect(float jitterX, float jitterY);
 	JitterVertexEffect(float jitterX, float jitterY);
 
 
@@ -65,7 +65,7 @@ protected:
 	float _jitterY;
 	float _jitterY;
 };
 };
 
 
-class SwirlVertexEffect: public VertexEffect {
+class SP_API SwirlVertexEffect: public VertexEffect {
 public:
 public:
 	SwirlVertexEffect(float radius, Interpolation &interpolation);
 	SwirlVertexEffect(float radius, Interpolation &interpolation);
 
 

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

@@ -33,8 +33,8 @@
 
 
 #include <spine/Vector.h>
 #include <spine/Vector.h>
 
 
-namespace Spine {
-class Vertices : public SpineObject {
+namespace spine {
+class SP_API Vertices : public SpineObject {
 public:
 public:
 	Vector<size_t> _bones;
 	Vector<size_t> _bones;
 	Vector<float> _vertices;
 	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/Constraint.h>
 #include <spine/ContainerUtil.h>
 #include <spine/ContainerUtil.h>
 #include <spine/CurveTimeline.h>
 #include <spine/CurveTimeline.h>
+#include <spine/Debug.h>
 #include <spine/DeformTimeline.h>
 #include <spine/DeformTimeline.h>
 #include <spine/DrawOrderTimeline.h>
 #include <spine/DrawOrderTimeline.h>
 #include <spine/Event.h>
 #include <spine/Event.h>
@@ -57,6 +58,7 @@
 #include <spine/EventTimeline.h>
 #include <spine/EventTimeline.h>
 #include <spine/Extension.h>
 #include <spine/Extension.h>
 #include <spine/HashMap.h>
 #include <spine/HashMap.h>
+#include <spine/HasRendererObject.h>
 #include <spine/IkConstraint.h>
 #include <spine/IkConstraint.h>
 #include <spine/IkConstraintData.h>
 #include <spine/IkConstraintData.h>
 #include <spine/IkConstraintTimeline.h>
 #include <spine/IkConstraintTimeline.h>
@@ -64,8 +66,8 @@
 #include <spine/LinkedMesh.h>
 #include <spine/LinkedMesh.h>
 #include <spine/MathUtil.h>
 #include <spine/MathUtil.h>
 #include <spine/MeshAttachment.h>
 #include <spine/MeshAttachment.h>
-#include <spine/MixDirection.h>
 #include <spine/MixBlend.h>
 #include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
 #include <spine/PathAttachment.h>
 #include <spine/PathAttachment.h>
 #include <spine/PathConstraint.h>
 #include <spine/PathConstraint.h>
 #include <spine/PathConstraintData.h>
 #include <spine/PathConstraintData.h>
@@ -90,8 +92,9 @@
 #include <spine/Skin.h>
 #include <spine/Skin.h>
 #include <spine/Slot.h>
 #include <spine/Slot.h>
 #include <spine/SlotData.h>
 #include <spine/SlotData.h>
+#include <spine/SpacingMode.h>
 #include <spine/SpineObject.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/TextureLoader.h>
 #include <spine/TextureLoader.h>
 #include <spine/Timeline.h>
 #include <spine/Timeline.h>
 #include <spine/TimelineType.h>
 #include <spine/TimelineType.h>

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

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

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

@@ -28,23 +28,25 @@
 * POSSIBILITY OF SUCH DAMAGE.
 * 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/Animation.h>
 #include <spine/Event.h>
 #include <spine/Event.h>
 #include <spine/AnimationStateData.h>
 #include <spine/AnimationStateData.h>
 #include <spine/Skeleton.h>
 #include <spine/Skeleton.h>
 #include <spine/RotateTimeline.h>
 #include <spine/RotateTimeline.h>
-
 #include <spine/SkeletonData.h>
 #include <spine/SkeletonData.h>
 #include <spine/Bone.h>
 #include <spine/Bone.h>
 #include <spine/BoneData.h>
 #include <spine/BoneData.h>
 #include <spine/AttachmentTimeline.h>
 #include <spine/AttachmentTimeline.h>
 #include <spine/DrawOrderTimeline.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(state);
 	SP_UNUSED(type);
 	SP_UNUSED(type);
 	SP_UNUSED(entry);
 	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),
 						   _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
 						   _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
 						   _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
 						   _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
 						   _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
-						   _onAnimationEventFunc(dummyOnAnimationEventFunc) {
+						   _listener(dummyOnAnimationEventFunc) {
 }
 }
 
 
+TrackEntry::~TrackEntry() { }
+
 int TrackEntry::getTrackIndex() { return _trackIndex; }
 int TrackEntry::getTrackIndex() { return _trackIndex; }
 
 
 Animation *TrackEntry::getAnimation() { return _animation; }
 Animation *TrackEntry::getAnimation() { return _animation; }
@@ -157,8 +161,8 @@ void TrackEntry::resetRotationDirections() {
 	_timelinesRotation.clear();
 	_timelinesRotation.clear();
 }
 }
 
 
-void TrackEntry::setOnAnimationEventFunc(OnAnimationEventFunc inValue) {
-	_onAnimationEventFunc = inValue;
+void TrackEntry::setListener(AnimationStateListener inValue) {
+	_listener = inValue;
 }
 }
 
 
 void TrackEntry::reset() {
 void TrackEntry::reset() {
@@ -171,7 +175,7 @@ void TrackEntry::reset() {
 	_timelineHoldMix.clear();
 	_timelineHoldMix.clear();
 	_timelinesRotation.clear();
 	_timelinesRotation.clear();
 
 
-	_onAnimationEventFunc = dummyOnAnimationEventFunc;
+	_listener = dummyOnAnimationEventFunc;
 }
 }
 
 
 EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) :
 EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) :
@@ -241,22 +245,22 @@ void EventQueue::drain() {
 			case EventType_Start:
 			case EventType_Start:
 			case EventType_Interrupt:
 			case EventType_Interrupt:
 			case EventType_Complete:
 			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;
 				break;
 			case EventType_End:
 			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 */
 				/* Yes, we want to fall through here */
 			case EventType_Dispose:
 			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();
 				trackEntry->reset();
 				_trackEntryPool.free(trackEntry);
 				_trackEntryPool.free(trackEntry);
 				break;
 				break;
 			case EventType_Event:
 			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;
 				break;
 		}
 		}
 	}
 	}
@@ -265,17 +269,16 @@ void EventQueue::drain() {
 	_drainDisabled = false;
 	_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) :
 AnimationState::AnimationState(AnimationStateData *data) :
 		_data(data),
 		_data(data),
 		_queue(EventQueue::newEventQueue(*this, _trackEntryPool)),
 		_queue(EventQueue::newEventQueue(*this, _trackEntryPool)),
 		_animationsChanged(false),
 		_animationsChanged(false),
-		_rendererObject(NULL),
-		_onAnimationEventFunc(dummyOnAnimationEventFunc),
+		_listener(dummyOnAnimationEventFunc),
 		_timeScale(1) {
 		_timeScale(1) {
 }
 }
 
 
@@ -413,7 +416,7 @@ bool AnimationState::apply(Skeleton &skeleton) {
 				Timeline *timeline = timelines[ii];
 				Timeline *timeline = timelines[ii];
 				assert(timeline);
 				assert(timeline);
 
 
-				MixBlend timelineBlend = timelineMode[ii] == AnimationState::Subsequent ? blend : MixBlend_Setup;
+				MixBlend timelineBlend = timelineMode[ii] == Subsequent ? blend : MixBlend_Setup;
 
 
 				RotateTimeline *rotateTimeline = NULL;
 				RotateTimeline *rotateTimeline = NULL;
 				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
 				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
@@ -609,16 +612,15 @@ void AnimationState::setTimeScale(float inValue) {
 	_timeScale = 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() {
 Animation *AnimationState::getEmptyAnimation() {
@@ -778,17 +780,17 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
 			MixBlend timelineBlend;
 			MixBlend timelineBlend;
 			float alpha;
 			float alpha;
 			switch (timelineMode[i]) {
 			switch (timelineMode[i]) {
-				case AnimationState::Subsequent:
+				case Subsequent:
 					if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) continue;
 					if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) continue;
 					if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue;
 					if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue;
 					timelineBlend = blend;
 					timelineBlend = blend;
 					alpha = alphaMix;
 					alpha = alphaMix;
 					break;
 					break;
-				case AnimationState::First:
+				case First:
 					timelineBlend = MixBlend_Setup;
 					timelineBlend = MixBlend_Setup;
 					alpha = alphaMix;
 					alpha = alphaMix;
 					break;
 					break;
-				case AnimationState::Hold:
+				case Hold:
 					timelineBlend = MixBlend_Setup;
 					timelineBlend = MixBlend_Setup;
 					alpha = alphaHold;
 					alpha = alphaHold;
 					break;
 					break;
@@ -944,6 +946,8 @@ void AnimationState::animationsChanged() {
 	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
 	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
 		TrackEntry *entry = _tracks[i];
 		TrackEntry *entry = _tracks[i];
 
 
+		if (!entry) continue;
+
 		while (entry->_mixingFrom != NULL)
 		while (entry->_mixingFrom != NULL)
 			entry = entry->_mixingFrom;
 			entry = entry->_mixingFrom;
 
 
@@ -967,7 +971,7 @@ void AnimationState::setTimelineModes(TrackEntry *entry) {
 		for (size_t i = 0; i < timelinesCount; i++) {
 		for (size_t i = 0; i < timelinesCount; i++) {
 			int id = timelines[i]->getPropertyId();
 			int id = timelines[i]->getPropertyId();
 			if (!_propertyIDs.contains(id)) _propertyIDs.add(id);
 			if (!_propertyIDs.contains(id)) _propertyIDs.add(id);
-			timelineMode[i] = AnimationState::Hold;
+			timelineMode[i] = Hold;
 		}
 		}
 		return;
 		return;
 	}
 	}
@@ -978,24 +982,24 @@ void AnimationState::setTimelineModes(TrackEntry *entry) {
 	for (; i < timelinesCount; ++i) {
 	for (; i < timelinesCount; ++i) {
 		int id = timelines[i]->getPropertyId();
 		int id = timelines[i]->getPropertyId();
 		if (_propertyIDs.contains(id)) {
 		if (_propertyIDs.contains(id)) {
-			timelineMode[i] = AnimationState::Subsequent;
+			timelineMode[i] = Subsequent;
 		} else {
 		} else {
 			_propertyIDs.add(id);
 			_propertyIDs.add(id);
 
 
 			if (to == NULL || !hasTimeline(to, id)) {
 			if (to == NULL || !hasTimeline(to, id)) {
-				timelineMode[i] = AnimationState::First;
+				timelineMode[i] = First;
 			} else {
 			} else {
 				for (TrackEntry *next = to->_mixingTo; next != NULL; next = next->_mixingTo) {
 				for (TrackEntry *next = to->_mixingTo; next != NULL; next = next->_mixingTo) {
 					if (hasTimeline(next, id)) continue;
 					if (hasTimeline(next, id)) continue;
 					if (entry->_mixDuration > 0) {
 					if (entry->_mixDuration > 0) {
-						timelineMode[i] = AnimationState::HoldMix;
+						timelineMode[i] = HoldMix;
 						timelineHoldMix[i] = entry;
 						timelineHoldMix[i] = entry;
 						i++;
 						i++;
 						goto continue_outer; // continue outer;
 						goto continue_outer; // continue outer;
 					}
 					}
 					break;
 					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.
 * 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/SkeletonData.h>
 #include <spine/Animation.h>
 #include <spine/Animation.h>
 
 
-using namespace Spine;
+using namespace spine;
 
 
 AnimationStateData::AnimationStateData(SkeletonData *skeletonData) : _skeletonData(skeletonData), _defaultMix(0) {
 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.
  * 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/TextureLoader.h>
-
 #include <spine/ContainerUtil.h>
 #include <spine/ContainerUtil.h>
 
 
 #include <ctype.h>
 #include <ctype.h>
 
 
-using namespace Spine;
+using namespace spine;
 
 
 Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) {
 Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) {
 	int dirLength;
 	int dirLength;
@@ -71,7 +73,7 @@ Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textu
 Atlas::~Atlas() {
 Atlas::~Atlas() {
 	if (_textureLoader) {
 	if (_textureLoader) {
 		for (size_t i = 0, n = _pages.size(); i < n; ++i) {
 		for (size_t i = 0, n = _pages.size(); i < n; ++i) {
-			_textureLoader->unload(_pages[i]->rendererObject);
+			_textureLoader->unload(_pages[i]->getRendererObject());
 		}
 		}
 	}
 	}
 	ContainerUtil::cleanUpVectorOfPointers(_pages);
 	ContainerUtil::cleanUpVectorOfPointers(_pages);
@@ -97,6 +99,10 @@ AtlasRegion *Atlas::findRegion(const String &name) {
 	return NULL;
 	return NULL;
 }
 }
 
 
+Vector<AtlasPage*> &Atlas::getPages() {
+	return _pages;
+}
+
 void Atlas::load(const char *begin, int length, const char *dir) {
 void Atlas::load(const char *begin, int length, const char *dir) {
 	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
 	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
 										"RGBA8888"};
 										"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. */
 			/* size is only optional for an atlas packed with an old TexturePacker. */
 			page->width = toInt(tuple);
 			page->width = toInt(tuple);
 			page->height = toInt(tuple + 1);
 			page->height = toInt(tuple + 1);
-			assert(readTuple(&begin, end, tuple));
+			readTuple(&begin, end, tuple);
 
 
 			page->format = (Format) indexOf(formatNames, 8, 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->minFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple);
 			page->magFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple + 1);
 			page->magFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple + 1);
 
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 
 
 			page->uWrap = TextureWrap_ClampToEdge;
 			page->uWrap = TextureWrap_ClampToEdge;
 			page->vWrap = 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->page = page;
 			region->name = String(mallocString(&str), true);
 			region->name = String(mallocString(&str), true);
 
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 			region->rotate = equals(&str, "true") ? true : false;
 			region->rotate = equals(&str, "true") ? true : false;
 
 
-			assert(readTuple(&begin, end, tuple) == 2);
+			readTuple(&begin, end, tuple);
 			region->x = toInt(tuple);
 			region->x = toInt(tuple);
 			region->y = toInt(tuple + 1);
 			region->y = toInt(tuple + 1);
 
 
-			assert(readTuple(&begin, end, tuple) == 2);
+			readTuple(&begin, end, tuple);
 			region->width = toInt(tuple);
 			region->width = toInt(tuple);
 			region->height = toInt(tuple + 1);
 			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[2] = toInt(tuple + 2);
 					region->pads[3] = toInt(tuple + 3);
 					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->offsetX = (float)toInt(tuple);
 			region->offsetY = (float)toInt(tuple + 1);
 			region->offsetY = (float)toInt(tuple + 1);
 
 
-			assert(readValue(&begin, end, &str));
+			readValue(&begin, end, &str);
 
 
 			region->index = toInt(&str);
 			region->index = toInt(&str);
 
 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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