Просмотр исходного кода

[ue4] Fixed up spine-cpp for use in UE4.

badlogic 7 лет назад
Родитель
Сommit
1454f8a97a
100 измененных файлов с 558 добавлено и 335 удалено
  1. 1 1
      spine-cpp/spine-cpp/include/spine/Animation.h
  2. 4 1
      spine-cpp/spine-cpp/include/spine/AnimationState.h
  3. 1 1
      spine-cpp/spine-cpp/include/spine/AnimationStateData.h
  4. 3 1
      spine-cpp/spine-cpp/include/spine/Atlas.h
  5. 1 1
      spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h
  6. 1 1
      spine-cpp/spine-cpp/include/spine/Attachment.h
  7. 1 1
      spine-cpp/spine-cpp/include/spine/AttachmentLoader.h
  8. 1 1
      spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h
  9. 3 0
      spine-cpp/spine-cpp/include/spine/Bone.h
  10. 1 1
      spine-cpp/spine-cpp/include/spine/BoneData.h
  11. 1 1
      spine-cpp/spine-cpp/include/spine/ContainerUtil.h
  12. 1 1
      spine-cpp/spine-cpp/include/spine/Debug.h
  13. 1 1
      spine-cpp/spine-cpp/include/spine/Event.h
  14. 1 1
      spine-cpp/spine-cpp/include/spine/EventData.h
  15. 1 1
      spine-cpp/spine-cpp/include/spine/IkConstraintData.h
  16. 1 1
      spine-cpp/spine-cpp/include/spine/LinkedMesh.h
  17. 6 5
      spine-cpp/spine-cpp/include/spine/MathUtil.h
  18. 1 1
      spine-cpp/spine-cpp/include/spine/PathConstraintData.h
  19. 1 1
      spine-cpp/spine-cpp/include/spine/Skeleton.h
  20. 1 1
      spine-cpp/spine-cpp/include/spine/SkeletonBinary.h
  21. 3 3
      spine-cpp/spine-cpp/include/spine/SkeletonData.h
  22. 1 1
      spine-cpp/spine-cpp/include/spine/SkeletonJson.h
  23. 1 1
      spine-cpp/spine-cpp/include/spine/Skin.h
  24. 1 1
      spine-cpp/spine-cpp/include/spine/SlotData.h
  25. 0 0
      spine-cpp/spine-cpp/include/spine/SpineString.h
  26. 1 1
      spine-cpp/spine-cpp/include/spine/TextureLoader.h
  27. 1 1
      spine-cpp/spine-cpp/include/spine/TransformConstraintData.h
  28. 1 1
      spine-cpp/spine-cpp/include/spine/Vector.h
  29. 5 2
      spine-cpp/spine-cpp/include/spine/spine.h
  30. 4 1
      spine-cpp/spine-cpp/src/spine/Animation.cpp
  31. 11 2
      spine-cpp/spine-cpp/src/spine/AnimationState.cpp
  32. 4 1
      spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp
  33. 8 2
      spine-cpp/spine-cpp/src/spine/Atlas.cpp
  34. 4 1
      spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp
  35. 4 0
      spine-cpp/spine-cpp/src/spine/Attachment.cpp
  36. 4 0
      spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp
  37. 4 0
      spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp
  38. 11 0
      spine-cpp/spine-cpp/src/spine/Bone.cpp
  39. 4 0
      spine-cpp/spine-cpp/src/spine/BoneData.cpp
  40. 4 0
      spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp
  41. 4 0
      spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp
  42. 4 0
      spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp
  43. 4 0
      spine-cpp/spine-cpp/src/spine/Constraint.cpp
  44. 4 0
      spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp
  45. 4 0
      spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp
  46. 4 0
      spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp
  47. 13 11
      spine-cpp/spine-cpp/src/spine/Event.cpp
  48. 16 14
      spine-cpp/spine-cpp/src/spine/EventData.cpp
  49. 4 0
      spine-cpp/spine-cpp/src/spine/EventTimeline.cpp
  50. 5 1
      spine-cpp/spine-cpp/src/spine/Extension.cpp
  51. 4 0
      spine-cpp/spine-cpp/src/spine/IkConstraint.cpp
  52. 4 0
      spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp
  53. 4 0
      spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp
  54. 8 4
      spine-cpp/spine-cpp/src/spine/Json.cpp
  55. 4 0
      spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp
  56. 4 0
      spine-cpp/spine-cpp/src/spine/MathUtil.cpp
  57. 4 0
      spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp
  58. 4 0
      spine-cpp/spine-cpp/src/spine/PathAttachment.cpp
  59. 4 0
      spine-cpp/spine-cpp/src/spine/PathConstraint.cpp
  60. 4 0
      spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp
  61. 4 0
      spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp
  62. 4 0
      spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp
  63. 4 0
      spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp
  64. 4 0
      spine-cpp/spine-cpp/src/spine/PointAttachment.cpp
  65. 5 1
      spine-cpp/spine-cpp/src/spine/RTTI.cpp
  66. 4 0
      spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp
  67. 4 0
      spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp
  68. 4 0
      spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp
  69. 4 0
      spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp
  70. 4 0
      spine-cpp/spine-cpp/src/spine/Skeleton.cpp
  71. 4 0
      spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp
  72. 4 0
      spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp
  73. 4 0
      spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp
  74. 6 2
      spine-cpp/spine-cpp/src/spine/SkeletonData.cpp
  75. 4 0
      spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp
  76. 4 0
      spine-cpp/spine-cpp/src/spine/Skin.cpp
  77. 4 0
      spine-cpp/spine-cpp/src/spine/Slot.cpp
  78. 4 0
      spine-cpp/spine-cpp/src/spine/SlotData.cpp
  79. 4 0
      spine-cpp/spine-cpp/src/spine/SpineObject.cpp
  80. 4 0
      spine-cpp/spine-cpp/src/spine/TextureLoader.cpp
  81. 4 0
      spine-cpp/spine-cpp/src/spine/Timeline.cpp
  82. 4 0
      spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp
  83. 4 0
      spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp
  84. 4 0
      spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp
  85. 4 0
      spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp
  86. 4 0
      spine-cpp/spine-cpp/src/spine/Triangulator.cpp
  87. 4 0
      spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp
  88. 4 0
      spine-cpp/spine-cpp/src/spine/Updatable.cpp
  89. 4 0
      spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp
  90. 4 0
      spine-cpp/spine-cpp/src/spine/VertexEffect.cpp
  91. 7 5
      spine-ue4/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp
  92. 11 10
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp
  93. 0 29
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp
  94. 42 46
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp
  95. 40 27
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp
  96. 18 16
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp
  97. 58 63
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp
  98. 2 2
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineAtlasAsset.h
  99. 41 61
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h
  100. 2 2
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h

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

@@ -35,7 +35,7 @@
 #include <spine/MixBlend.h>
 #include <spine/MixDirection.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class Timeline;

+ 4 - 1
spine-cpp/spine-cpp/include/spine/AnimationState.h

@@ -35,7 +35,7 @@
 #include <spine/Pool.h>
 #include <spine/MixBlend.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/HasRendererObject.h>
 
 namespace spine {
@@ -381,6 +381,9 @@ namespace spine {
         void setTimeScale(float inValue);
 
         void setListener(AnimationStateListener listener);
+
+		void disableQueue();
+		void enableQueue();
         
     private:
         static const int Subsequent, First, Dip, DipMix;

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

@@ -33,7 +33,7 @@
 
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 

+ 3 - 1
spine-cpp/spine-cpp/include/spine/Atlas.h

@@ -34,7 +34,7 @@
 #include <spine/Vector.h>
 #include <spine/Extension.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/HasRendererObject.h>
 
 namespace spine {
@@ -114,6 +114,8 @@ public:
 	/// @return The region, or NULL.
 	AtlasRegion *findRegion(const String &name);
 
+	Vector<AtlasPage*> &getPages();
+
 private:
 	Vector<AtlasPage *> _pages;
 	Vector<AtlasRegion *> _regions;

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

@@ -33,7 +33,7 @@
 
 #include <spine/AttachmentLoader.h>
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 
 namespace spine {

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

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

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

@@ -33,7 +33,7 @@
 
 #include <spine/RTTI.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class Skin;

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

@@ -36,7 +36,7 @@
 #include <spine/Vector.h>
 #include <spine/MixBlend.h>
 #include <spine/MixDirection.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class Skeleton;

+ 3 - 0
spine-cpp/spine-cpp/include/spine/Bone.h

@@ -221,6 +221,9 @@ public:
 	/// Returns the magnitide (always positive) of the world scale Y.
 	float getWorldScaleY();
 
+	bool isAppliedValid();
+	void setAppliedValid(bool valid);
+
 private:
 	static bool yDown;
 

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

@@ -33,7 +33,7 @@
 
 #include <spine/TransformMode.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class BoneData : public SpineObject {

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

@@ -35,7 +35,7 @@
 #include <spine/Vector.h>
 #include <spine/HashMap.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 

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

@@ -58,7 +58,7 @@ public:
 		for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
 			printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
 		}
-		printf("allocations: %lu, reallocations: %lu, frees: %lu\n", _allocations, _reallocations, _frees);
+		printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees);
 		if (_allocated.empty()) printf("No leaks detected");
 	}
 

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

@@ -32,7 +32,7 @@
 #define Spine_Event_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class EventData;

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

@@ -32,7 +32,7 @@
 #define Spine_EventData_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 /// Stores the setup pose values for an Event.

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

@@ -33,7 +33,7 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class BoneData;

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

@@ -32,7 +32,7 @@
 #define Spine_LinkedMesh_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class MeshAttachment;

+ 6 - 5
spine-cpp/spine-cpp/include/spine/MathUtil.h

@@ -37,15 +37,16 @@
 #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);
+float PI = 3.1415926535897932385f;
+float PI_2 = PI * 2;
+float DEG_RAD = (PI / 180.0f);
+float RAD_DEG = (180.0f / PI);
 
 class MathUtil : public SpineObject {
-public:
+private:
 	MathUtil();
 
+public:
 	template<typename T>
 	static inline T min(T a, T b) { return a < b ? a : b; }
 

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

@@ -36,7 +36,7 @@
 #include <spine/RotateMode.h>
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class BoneData;

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

@@ -34,7 +34,7 @@
 #include <spine/Vector.h>
 #include <spine/MathUtil.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
 #include <limits> // std::numeric_limits

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

@@ -34,7 +34,7 @@
 #include <spine/TransformMode.h>
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
 namespace spine {

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

@@ -32,7 +32,7 @@
 #define Spine_SkeletonData_h
 
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class BoneData;
@@ -82,7 +82,7 @@ public:
 	Skin *findSkin(const String &skinName);
 
 	/// @return May be NULL.
-	EventData *findEvent(const String &eventDataName);
+	spine::EventData *findEvent(const String &eventDataName);
 
 	/// @return May be NULL.
 	Animation *findAnimation(const String &animationName);
@@ -119,7 +119,7 @@ public:
 
 	void setDefaultSkin(Skin *inValue);
 
-	Vector<EventData *> &getEvents();
+	Vector<spine::EventData *> &getEvents();
 
 	Vector<Animation *> &getAnimations();
 

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

@@ -33,7 +33,7 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class CurveTimeline;

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

@@ -32,7 +32,7 @@
 #define Spine_Skin_h
 
 #include <spine/Vector.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
 class Attachment;

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

@@ -33,7 +33,7 @@
 
 #include <spine/BlendMode.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <spine/Color.h>
 
 namespace spine {

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


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

@@ -32,7 +32,7 @@
 #define Spine_TextureLoader_h
 
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class AtlasPage;

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

@@ -33,7 +33,7 @@
 
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 namespace spine {
     class BoneData;

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

@@ -33,7 +33,7 @@
 
 #include <spine/Extension.h>
 #include <spine/SpineObject.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 #include <stdlib.h>
 #include <memory>
 #include <assert.h>

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

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

+ 4 - 1
spine-cpp/spine-cpp/src/spine/Animation.cpp

@@ -28,8 +28,11 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/Animation.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/Animation.h>
 #include <spine/Timeline.h>
 #include <spine/Skeleton.h>
 #include <spine/Event.h>

+ 11 - 2
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -28,14 +28,16 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/AnimationState.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AnimationState.h>
 #include <spine/Animation.h>
 #include <spine/Event.h>
 #include <spine/AnimationStateData.h>
 #include <spine/Skeleton.h>
 #include <spine/RotateTimeline.h>
-
 #include <spine/SkeletonData.h>
 #include <spine/Bone.h>
 #include <spine/BoneData.h>
@@ -659,6 +661,13 @@ void AnimationState::setListener(AnimationStateListener inValue) {
 	_listener = inValue;
 }
 
+void AnimationState::disableQueue() {
+	_queue->_drainDisabled = true;
+}
+void AnimationState::enableQueue() {
+	_queue->_drainDisabled = false;
+}
+
 Animation *AnimationState::getEmptyAnimation() {
 	static Vector<Timeline *> timelines;
 	static Animation ret(String("<empty>"), timelines, 0);

+ 4 - 1
spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp

@@ -28,8 +28,11 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
-#include <spine/AnimationStateData.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AnimationStateData.h>
 #include <spine/SkeletonData.h>
 #include <spine/Animation.h>
 

+ 8 - 2
spine-cpp/spine-cpp/src/spine/Atlas.cpp

@@ -28,10 +28,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
-#include <spine/Atlas.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/Atlas.h>
 #include <spine/TextureLoader.h>
-
 #include <spine/ContainerUtil.h>
 
 #include <ctype.h>
@@ -92,6 +94,10 @@ AtlasRegion *Atlas::findRegion(const String &name) {
 	return NULL;
 }
 
+Vector<AtlasPage*> &Atlas::getPages() {
+	return _pages;
+}
+
 void Atlas::load(const char *begin, int length, const char *dir) {
 	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
 										"RGBA8888"};

+ 4 - 1
spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp

@@ -28,8 +28,11 @@
 * POSSIBILITY OF SUCH DAMAGE.
 ******************************************************S**********************/
 
-#include <spine/AtlasAttachmentLoader.h>
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
 
+#include <spine/AtlasAttachmentLoader.h>
 #include <spine/Skin.h>
 #include <spine/RegionAttachment.h>
 #include <spine/MeshAttachment.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Attachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Attachment.h>
 
 #include <assert.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/AttachmentLoader.h>
 
 #include <spine/Skin.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/AttachmentTimeline.h>
 
 #include <spine/Skeleton.h>

+ 11 - 0
spine-cpp/spine-cpp/src/spine/Bone.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Bone.h>
 
 #include <spine/BoneData.h>
@@ -505,6 +509,13 @@ float Bone::getWorldScaleY() {
 	return MathUtil::sqrt(_b * _b + _d * _d);
 }
 
+bool Bone::isAppliedValid() {
+	return _appliedValid;
+}
+void Bone::setAppliedValid(bool valid) {
+	_appliedValid = valid;
+}
+
 void Bone::updateAppliedTransform() {
 	Bone *parent = _parent;
 	_appliedValid = 1;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/BoneData.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/BoneData.h>
 
 #include <assert.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/BoundingBoxAttachment.h>
 
 using namespace spine;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ClippingAttachment.h>
 
 #include <spine/SlotData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ColorTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Constraint.cpp

@@ -28,6 +28,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Constraint.h>
 
 using namespace spine;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/CurveTimeline.h>
 
 #include <spine/MathUtil.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/DeformTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/DrawOrderTimeline.h>
 
 #include <spine/Skeleton.h>

+ 13 - 11
spine-cpp/spine-cpp/src/spine/Event.cpp

@@ -28,13 +28,15 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Event.h>
 
 #include <spine/EventData.h>
 
-using namespace spine;
-
-Event::Event(float time, const EventData &data) :
+spine::Event::Event(float time, const spine::EventData &data) :
 		_data(data),
 		_time(time),
 		_intValue(0),
@@ -42,34 +44,34 @@ Event::Event(float time, const EventData &data) :
 		_stringValue() {
 }
 
-const EventData &Event::getData() {
+const spine::EventData &spine::Event::getData() {
 	return _data;
 }
 
-float Event::getTime() {
+float spine::Event::getTime() {
 	return _time;
 }
 
-int Event::getIntValue() {
+int spine::Event::getIntValue() {
 	return _intValue;
 }
 
-void Event::setIntValue(int inValue) {
+void spine::Event::setIntValue(int inValue) {
 	_intValue = inValue;
 }
 
-float Event::getFloatValue() {
+float spine::Event::getFloatValue() {
 	return _floatValue;
 }
 
-void Event::setFloatValue(float inValue) {
+void spine::Event::setFloatValue(float inValue) {
 	_floatValue = inValue;
 }
 
-const String &Event::getStringValue() {
+const spine::String &spine::Event::getStringValue() {
 	return _stringValue;
 }
 
-void Event::setStringValue(const String &inValue) {
+void spine::Event::setStringValue(const spine::String &inValue) {
 	_stringValue = inValue;
 }

+ 16 - 14
spine-cpp/spine-cpp/src/spine/EventData.cpp

@@ -28,45 +28,47 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/EventData.h>
 
 #include <assert.h>
 
-using namespace spine;
-
-EventData::EventData(const String &name) :
+spine::EventData::EventData(const spine::String &name) :
 		_name(name),
-		_intValue(0),
-		_floatValue(0),
-		_stringValue() {
+		_intValue((int)0),
+		_floatValue(0.0f)
+		 {
 	assert(_name.length() > 0);
 }
 
 /// The name of the event, which is unique within the skeleton.
-const String &EventData::getName() const {
+const spine::String &spine::EventData::getName() const {
 	return _name;
 }
 
-int EventData::getIntValue() {
+int spine::EventData::getIntValue() {
 	return _intValue;
 }
 
-void EventData::setIntValue(int inValue) {
+void spine::EventData::setIntValue(int inValue) {
 	_intValue = inValue;
 }
 
-float EventData::getFloatValue() {
+float spine::EventData::getFloatValue() {
 	return _floatValue;
 }
 
-void EventData::setFloatValue(float inValue) {
+void spine::EventData::setFloatValue(float inValue) {
 	_floatValue = inValue;
 }
 
-const String &EventData::getStringValue() {
+const spine::String &spine::EventData::getStringValue() {
 	return _stringValue;
 }
 
-void EventData::setStringValue(const String &inValue) {
-	_stringValue = inValue;
+void spine::EventData::setStringValue(const spine::String &inValue) {
+	this->_stringValue = inValue;
 }

+ 4 - 0
spine-cpp/spine-cpp/src/spine/EventTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/EventTimeline.h>
 
 #include <spine/Skeleton.h>

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

@@ -28,8 +28,12 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Extension.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 

+ 4 - 0
spine-cpp/spine-cpp/src/spine/IkConstraint.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/IkConstraint.h>
 
 #include <spine/IkConstraintData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/IkConstraintData.h>
 
 #include <spine/BoneData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/IkConstraintTimeline.h>
 
 #include <spine/Skeleton.h>

+ 8 - 4
spine-cpp/spine-cpp/src/spine/Json.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 /* Json */
 /* JSON parser in CPP, shamelessly ripped from json.c in the spine-c runtime */
 
@@ -43,7 +47,7 @@
 
 #include <spine/Json.h>
 #include <spine/Extension.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 #include <assert.h>
 #include <math.h>
@@ -140,7 +144,7 @@ const char *Json::skip(const char *inValue) {
 const char *Json::parseValue(Json *item, const char *value) {
 	/* Referenced by constructor, parseArray(), and parseObject(). */
 	/* Always called with the result of skip(). */
-#if SPINE_JSON_DEBUG /* Checked at entry to graph, constructor, and after every parse call. */
+#ifdef SPINE_JSON_DEBUG /* Checked at entry to graph, constructor, and after every parse call. */
 	if (!value) {
 		/* Fail on null. */
 		return NULL;
@@ -390,7 +394,7 @@ const char *Json::parseNumber(Json *item, const char *num) {
 const char *Json::parseArray(Json *item, const char *value) {
 	Json *child;
 
-#if SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
+#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
 	if (*value != '[') {
 		ep = value;
 		return 0;
@@ -446,7 +450,7 @@ const char *Json::parseArray(Json *item, const char *value) {
 const char *Json::parseObject(Json *item, const char *value) {
 	Json *child;
 
-#if SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
+#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
 	if (*value != '{') {
 		ep = value;
 		return 0;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/LinkedMesh.h>
 
 #include <spine/MeshAttachment.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/MathUtil.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/MathUtil.h>
 #include <math.h>
 #include <random>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/MeshAttachment.h>
 #include <spine/HasRendererObject.h>
 

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathAttachment.h>
 
 using namespace spine;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathConstraint.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathConstraint.h>
 
 #include <spine/PathConstraintData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathConstraintData.h>
 
 #include <spine/BoneData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathConstraintMixTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathConstraintPositionTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PathConstraintSpacingTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/PointAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/PointAttachment.h>
 
 #include <spine/Bone.h>

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

@@ -28,8 +28,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/RTTI.h>
-#include <spine/String.h>
+#include <spine/SpineString.h>
 
 using namespace spine;
 

+ 4 - 0
spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/RegionAttachment.h>
 
 #include <spine/Bone.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/RotateTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ScaleTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/ShearTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Skeleton.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Skeleton.h>
 
 #include <spine/SkeletonData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SkeletonBinary.h>
 
 #include <spine/SkeletonData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SkeletonBounds.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SkeletonClipping.h>
 
 #include <spine/Slot.h>

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

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SkeletonData.h>
 
 #include <spine/BoneData.h>
@@ -88,7 +92,7 @@ Skin *SkeletonData::findSkin(const String &skinName) {
 	return ContainerUtil::findWithName(_skins, skinName);
 }
 
-EventData *SkeletonData::findEvent(const String &eventDataName) {
+spine::EventData *SkeletonData::findEvent(const String &eventDataName) {
 	return ContainerUtil::findWithName(_events, eventDataName);
 }
 
@@ -140,7 +144,7 @@ void SkeletonData::setDefaultSkin(Skin *inValue) {
 	_defaultSkin = inValue;
 }
 
-Vector<EventData *> &SkeletonData::getEvents() {
+Vector<spine::EventData *> &SkeletonData::getEvents() {
 	return _events;
 }
 

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SkeletonJson.h>
 
 #include <spine/CurveTimeline.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Skin.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Skin.h>
 
 #include <spine/Attachment.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Slot.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Slot.h>
 
 #include <spine/SlotData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SlotData.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SlotData.h>
 
 #include <assert.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SpineObject.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/SpineObject.h>
 #include <spine/Extension.h>
 

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TextureLoader.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TextureLoader.h>
 
 namespace spine {

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Timeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Timeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TransformConstraint.h>
 
 #include <spine/TransformConstraintData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TransformConstraintData.h>
 
 #include <spine/BoneData.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TransformConstraintTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TranslateTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Triangulator.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Triangulator.h>
 
 #include <spine/MathUtil.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/TwoColorTimeline.h>
 
 #include <spine/Skeleton.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/Updatable.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/Updatable.h>
 
 using namespace spine;

+ 4 - 0
spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp

@@ -28,6 +28,10 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/VertexAttachment.h>
 
 #include <spine/Slot.h>

+ 4 - 0
spine-cpp/spine-cpp/src/spine/VertexEffect.cpp

@@ -28,6 +28,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
 #include <spine/VertexEffect.h>
 #include <spine/MathUtil.h>
 #include <spine/Skeleton.h>

+ 7 - 5
spine-ue4/Plugins/SpinePlugin/Source/SpineEditorPlugin/Private/SpineAtlasImportFactory.cpp

@@ -43,6 +43,8 @@
 
 #define LOCTEXT_NAMESPACE "Spine"
 
+using namespace spine;
+
 USpineAtlasAssetFactory::USpineAtlasAssetFactory (const FObjectInitializer& objectInitializer): Super(objectInitializer) {
 	bCreateNew = false;
 	bEditAfterNew = true;
@@ -128,16 +130,16 @@ UTexture2D* resolveTexture (USpineAtlasAsset* Asset, const FString& PageFileName
 }
 
 void USpineAtlasAssetFactory::LoadAtlas (USpineAtlasAsset* Asset, const FString& CurrentSourcePath, const FString& LongPackagePath) {
-	spAtlas* atlas = Asset->GetAtlas(true);
+	Atlas* atlas = Asset->GetAtlas(true);
 	Asset->atlasPages.Empty();
 	
 	const FString targetTexturePath = LongPackagePath / TEXT("Textures");
 	
-	spAtlasPage* page = atlas->pages;
-	while (page) {
-		const FString sourceTextureFilename = FPaths::Combine(*CurrentSourcePath, UTF8_TO_TCHAR(page->name));
+	Vector<AtlasPage*> &pages = atlas->getPages();
+	for (size_t i = 0, n = pages.size(); i < n; i++) {
+		AtlasPage* page = pages[i];
+		const FString sourceTextureFilename = FPaths::Combine(*CurrentSourcePath, UTF8_TO_TCHAR(page->name.buffer()));
 		UTexture2D* texture = resolveTexture(Asset, sourceTextureFilename, targetTexturePath);
-		page = page->next;
 		Asset->atlasPages.Add(texture);
 	}
 }

+ 11 - 10
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineAtlasAsset.cpp

@@ -36,6 +36,8 @@
 
 #define LOCTEXT_NAMESPACE "Spine"
 
+using namespace spine;
+
 FString USpineAtlasAsset::GetRawData () const {
 	return rawData;
 }
@@ -87,27 +89,26 @@ void USpineAtlasAsset::Serialize (FArchive& Ar) {
 
 void USpineAtlasAsset::BeginDestroy () {
 	if (atlas) {
-		spAtlas_dispose(atlas);
+		delete atlas;
 		atlas = nullptr;
 	}
 	Super::BeginDestroy();
 }
 
-spAtlas* USpineAtlasAsset::GetAtlas (bool ForceReload) {
+Atlas* USpineAtlasAsset::GetAtlas (bool ForceReload) {
 	if (!atlas || ForceReload) {
 		if (atlas) {
-			spAtlas_dispose(atlas);
+			delete atlas;
 			atlas = nullptr;
 		}
 		std::string t = TCHAR_TO_UTF8(*rawData);
-		atlas = spAtlas_create(t.c_str(), strlen(t.c_str()), "", nullptr);
-		spAtlasPage* page = atlas->pages;
-		int i = 0;
-		while (page) {
-			int num = atlasPages.Num();
+
+		atlas = new (__FILE__, __LINE__) Atlas(t.c_str(), strlen(t.c_str()), "", nullptr);
+		Vector<AtlasPage*> &pages = atlas->getPages();
+		for (size_t i = 0, n = pages.size(), j = 0; i < n; i++) {
+			AtlasPage* page = pages[i];
 			if (atlasPages.Num() > 0 && atlasPages.Num() > i)
-				page->rendererObject = atlasPages[i++];
-			page = page->next;
+				page->setRendererObject(atlasPages[j++]);
 		}
 	}
 	return this->atlas;

+ 0 - 29
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpinePlugin.cpp

@@ -37,39 +37,10 @@ class FSpinePlugin : public SpinePlugin {
 
 IMPLEMENT_MODULE( FSpinePlugin, SpinePlugin )
 
-// These should be filled with UE4's specific allocator functions.
-extern "C" {
-    void _spSetMalloc( void* ( *_malloc ) ( size_t size ) );
-    void _spSetFree( void( *_free ) ( void* ptr ) );
-    void _spSetRealloc( void* ( *_realloc ) ( void* ptr, size_t size ) );
-}
-
-static void * SpineMalloc( size_t size ) {
-    return FMemory::Malloc( size );
-}
-
-static void * SpineRealloc( void* ptr, size_t size ) {
-    return FMemory::Realloc( ptr, size );
-}
-
 void FSpinePlugin::StartupModule() {
-	// Needed for consoles, see https://github.com/EsotericSoftware/spine-runtimes/pull/1089
-#if !UE_EDITOR && !PLATFORM_WINDOWS && !PLATFORM_MAC && !PLATFORM_LINUX && !PLATFORM_IOS && !PLATFORM_ANDROID && !PLATFORM_HTML5
-    _spSetMalloc( &SpineMalloc );
-    _spSetRealloc( &SpineRealloc );
-    _spSetFree( FMemory::Free );
-#endif
 }
 
 void FSpinePlugin::ShutdownModule() { }
 
-// These are not used in the Spine UE4 plugin, see SpineAtlasAsset on how atlas page textures
-// are loaded, See SpineSkeletonRendererComponent on how these textures are used for rendering.
-extern "C" {
-	void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) { }
-	void _spAtlasPage_disposeTexture (spAtlasPage* self) { }
-	char* _spUtil_readFile (const char* path, int* length) { return 0; }
-}
-
 
 

+ 42 - 46
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp

@@ -32,38 +32,40 @@
 
 #define LOCTEXT_NAMESPACE "Spine"
 
-void UTrackEntry::SetTrackEntry(spTrackEntry* entry) {
+using namespace spine;
+
+void UTrackEntry::SetTrackEntry(TrackEntry* entry) {
 	this->entry = entry;
-	if (entry) entry->rendererObject = (void*)this;
+	if (entry) entry->setRendererObject((void*)this);
 }
 
-void callback(spAnimationState* state, spEventType type, spTrackEntry* entry, spEvent* event) {
-	USpineSkeletonAnimationComponent* component = (USpineSkeletonAnimationComponent*)state->rendererObject;
+void callback(AnimationState* state, EventType type, TrackEntry* entry, Event* event) {
+	USpineSkeletonAnimationComponent* component = (USpineSkeletonAnimationComponent*)state->getRendererObject();
 		
-	if (entry->rendererObject) {			
-		UTrackEntry* uEntry = (UTrackEntry*)entry->rendererObject;
-		if (type == SP_ANIMATION_START) {
+	if (entry->getRendererObject()) {			
+		UTrackEntry* uEntry = (UTrackEntry*)entry->getRendererObject();
+		if (type == EventType_Start) {
 			component->AnimationStart.Broadcast(uEntry);
 			uEntry->AnimationStart.Broadcast(uEntry);
 		}
-		else if (type == SP_ANIMATION_INTERRUPT) {
+		else if (type == EventType_Interrupt) {
 			component->AnimationInterrupt.Broadcast(uEntry);
 			uEntry->AnimationInterrupt.Broadcast(uEntry);
-		} else if (type == SP_ANIMATION_EVENT) {
+		} else if (type == EventType_Event) {
 			FSpineEvent evt;
 			evt.SetEvent(event);
 			component->AnimationEvent.Broadcast(uEntry, evt);
 			uEntry->AnimationEvent.Broadcast(uEntry, evt);
 		}
-		else if (type == SP_ANIMATION_COMPLETE) {
+		else if (type == EventType_Complete) {
 			component->AnimationComplete.Broadcast(uEntry);
 			uEntry->AnimationComplete.Broadcast(uEntry);
 		}
-		else if (type == SP_ANIMATION_END) {
+		else if (type == EventType_End) {
 			component->AnimationEnd.Broadcast(uEntry);
 			uEntry->AnimationEnd.Broadcast(uEntry);
 		}
-		else if (type == SP_ANIMATION_DISPOSE) {
+		else if (type == EventType_Dispose) {
 			component->AnimationDispose.Broadcast(uEntry);
 			uEntry->AnimationDispose.Broadcast(uEntry);
 			uEntry->SetTrackEntry(nullptr);
@@ -93,10 +95,10 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe
 	CheckState();
 
 	if (state) {
-		spAnimationState_update(state, DeltaTime);
-		spAnimationState_apply(state, skeleton);
+		state->update(DeltaTime);
+		state->apply(*skeleton);
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
-		spSkeleton_updateWorldTransform(skeleton);
+		skeleton->updateWorldTransform();
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 	}
 }
@@ -106,12 +108,12 @@ void USpineSkeletonAnimationComponent::CheckState () {
 		DisposeState();
 		
 		if (Atlas && SkeletonData) {
-			spSkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
-			skeleton = spSkeleton_create(data);
-			spAnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
-			state = spAnimationState_create(stateData);
-			state->rendererObject = (void*)this;
-			state->listener = callback;
+			spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
+			skeleton = new (__FILE__, __LINE__) Skeleton(data);
+			AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
+			state = new (__FILE__, __LINE__) AnimationState(stateData);
+			state->setRendererObject((void*)this);
+			state->setListener(callback);
 			trackEntries.Empty();
 		}
 		
@@ -122,12 +124,12 @@ void USpineSkeletonAnimationComponent::CheckState () {
 
 void USpineSkeletonAnimationComponent::DisposeState () {	
 	if (state) {
-		spAnimationState_dispose(state);
+		delete state;
 		state = nullptr;
 	}
 
 	if (skeleton) {
-		spSkeleton_dispose(skeleton);
+		delete skeleton;
 		skeleton = nullptr;
 	}
 
@@ -141,27 +143,21 @@ void USpineSkeletonAnimationComponent::FinishDestroy () {
 
 void USpineSkeletonAnimationComponent::SetTimeScale(float timeScale) {
 	CheckState();
-	if (state) state->timeScale = timeScale;	
+	if (state) state->setTimeScale(timeScale);
 }
 
 float USpineSkeletonAnimationComponent::GetTimeScale() {
 	CheckState();
-	if (state) return state->timeScale;
+	if (state) return state->getTimeScale();
 	return 1;
 }
 
-// we need to disable the queue when setting or adding animations, see #1037
-extern "C" {
-	void _spAnimationState_disableQueue(spAnimationState* state);
-	void _spAnimationState_enableQueue(spAnimationState* state);
-}
-
 UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FString animationName, bool loop) {
 	CheckState();
-	if (state && spSkeletonData_findAnimation(skeleton->data, TCHAR_TO_UTF8(*animationName))) {
-		_spAnimationState_disableQueue(state);
-		spTrackEntry* entry = spAnimationState_setAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0);
-		_spAnimationState_enableQueue(state);
+	if (state && skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*animationName))) {
+		state->disableQueue();
+		TrackEntry* entry = state->setAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop);
+		state->enableQueue();
 		UTrackEntry* uEntry = NewObject<UTrackEntry>();
 		uEntry->SetTrackEntry(entry);
 		trackEntries.Add(uEntry);
@@ -172,10 +168,10 @@ UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FSt
 
 UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FString animationName, bool loop, float delay) {
 	CheckState();
-	if (state && spSkeletonData_findAnimation(skeleton->data, TCHAR_TO_UTF8(*animationName))) {
-		_spAnimationState_disableQueue(state);
-		spTrackEntry* entry = spAnimationState_addAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0, delay);		
-		_spAnimationState_enableQueue(state);
+	if (state && skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*animationName))) {
+		state->disableQueue();
+		TrackEntry* entry = state->addAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop, delay);		
+		state->enableQueue();
 		UTrackEntry* uEntry = NewObject<UTrackEntry>();
 		uEntry->SetTrackEntry(entry);
 		trackEntries.Add(uEntry);
@@ -186,7 +182,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FSt
 UTrackEntry* USpineSkeletonAnimationComponent::SetEmptyAnimation (int trackIndex, float mixDuration) {
 	CheckState();
 	if (state) {
-		spTrackEntry* entry = spAnimationState_setEmptyAnimation(state, trackIndex, mixDuration);
+		TrackEntry* entry = state->setEmptyAnimation(trackIndex, mixDuration);
 		UTrackEntry* uEntry = NewObject<UTrackEntry>();
 		uEntry->SetTrackEntry(entry);
 		trackEntries.Add(uEntry);
@@ -197,7 +193,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::SetEmptyAnimation (int trackIndex
 UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex, float mixDuration, float delay) {
 	CheckState();
 	if (state) {
-		spTrackEntry* entry = spAnimationState_addEmptyAnimation(state, trackIndex, mixDuration, delay);
+		TrackEntry* entry = state->addEmptyAnimation(trackIndex, mixDuration, delay);
 		UTrackEntry* uEntry = NewObject<UTrackEntry>();
 		uEntry->SetTrackEntry(entry);
 		trackEntries.Add(uEntry);
@@ -208,9 +204,9 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex
 UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
 	CheckState();
 	if (state) {
-		spTrackEntry* entry = spAnimationState_getCurrent(state, trackIndex);
-		if (entry->rendererObject) {
-			return (UTrackEntry*)entry->rendererObject;
+		TrackEntry* entry = state->getCurrent(trackIndex);
+		if (entry->getRendererObject()) {
+			return (UTrackEntry*)entry->getRendererObject();
 		} else {
 			UTrackEntry* uEntry = NewObject<UTrackEntry>();
 			uEntry->SetTrackEntry(entry);
@@ -223,14 +219,14 @@ UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
 void USpineSkeletonAnimationComponent::ClearTracks () {
 	CheckState();
 	if (state) {
-		spAnimationState_clearTracks(state);
+		state->clearTracks();
 	}
 }
 
 void USpineSkeletonAnimationComponent::ClearTrack (int trackIndex) {
 	CheckState();
 	if (state) {
-		spAnimationState_clearTrack(state, trackIndex);
+		state->clearTrack(trackIndex);
 	}
 }
 

+ 40 - 27
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp

@@ -30,8 +30,12 @@
 
 #include "SpinePluginPrivatePCH.h"
 
+#include "spine/spine.h"
+
 #define LOCTEXT_NAMESPACE "Spine"
 
+using namespace spine;
+
 USpineSkeletonComponent::USpineSkeletonComponent () {
 	PrimaryComponentTick.bCanEverTick = true;
 	bTickInEditor = true;
@@ -40,22 +44,31 @@ USpineSkeletonComponent::USpineSkeletonComponent () {
 
 bool USpineSkeletonComponent::SetSkin(const FString& skinName) {
 	CheckState();
-	if (skeleton) return spSkeleton_setSkinByName(skeleton, TCHAR_TO_UTF8(*skinName)) != 0;
+	if (skeleton) {
+		Skin* skin = skeleton->getData()->findSkin(TCHAR_TO_UTF8(*skinName));
+		if (!skin) return false;
+		skeleton->setSkin(skin);
+		return true;
+	}
 	else return false;
 }
 
 bool USpineSkeletonComponent::SetAttachment (const FString& slotName, const FString& attachmentName) {
 	CheckState();
-	if (skeleton) return spSkeleton_setAttachment(skeleton, TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName)) != 0;
+	if (skeleton) {
+		if (!skeleton->getAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName))) return false;
+		skeleton->setAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName));
+		return true;
+	}
 	return false;
 }
 
 FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneName) {
 	CheckState();
 	if (skeleton) {
-		spBone* bone = spSkeleton_findBone(skeleton, TCHAR_TO_UTF8(*BoneName));		
+		Bone* bone = skeleton->findBone(TCHAR_TO_UTF8(*BoneName));		
 		if (!bone) return FTransform();
-		if (!bone->appliedValid) this->InternalTick(0, false);		
+		if (!bone->isAppliedValid()) this->InternalTick(0, false);		
 
 		// Need to fetch the renderer component to get world transform of actor plus
 		// offset by renderer component and its parent component(s). If no renderer
@@ -68,12 +81,12 @@ FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneNa
 			else baseTransform = owner->GetActorTransform();
 		}
 
-		FVector position(bone->worldX, 0, bone->worldY);
+		FVector position(bone->getWorldX(), 0, bone->getWorldY());
 		FMatrix localTransform;
 		localTransform.SetIdentity();
-		localTransform.SetAxis(2, FVector(bone->a, 0, bone->c));
-		localTransform.SetAxis(0, FVector(bone->b, 0, bone->d));
-		localTransform.SetOrigin(FVector(bone->worldX, 0, bone->worldY));				
+		localTransform.SetAxis(2, FVector(bone->getA(), 0, bone->getC()));
+		localTransform.SetAxis(0, FVector(bone->getB(), 0, bone->getD()));
+		localTransform.SetOrigin(FVector(bone->getWorldX(), 0, bone->getWorldY()));				
 		localTransform = localTransform * baseTransform.ToMatrixWithScale();
 
 		FTransform result;
@@ -86,9 +99,9 @@ FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneNa
 void USpineSkeletonComponent::SetBoneWorldPosition (const FString& BoneName, const FVector& position) {
 	CheckState();
 	if (skeleton) {
-		spBone* bone = spSkeleton_findBone(skeleton, TCHAR_TO_UTF8(*BoneName));
+		Bone* bone = skeleton->findBone(TCHAR_TO_UTF8(*BoneName));
 		if (!bone) return;
-		if (!bone->appliedValid) this->InternalTick(0, false);
+		if (!bone->isAppliedValid()) this->InternalTick(0, false);
 
 		// Need to fetch the renderer component to get world transform of actor plus
 		// offset by renderer component and its parent component(s). If no renderer
@@ -104,57 +117,57 @@ void USpineSkeletonComponent::SetBoneWorldPosition (const FString& BoneName, con
 		baseTransform = baseTransform.Inverse();
 		FVector localPosition = baseTransform.TransformPosition(position);
 		float localX = 0, localY = 0;
-		if (bone->parent) {
-			spBone_worldToLocal(bone->parent, localPosition.X, localPosition.Z, &localX, &localY);
+		if (bone->getParent()) {
+			bone->getParent()->worldToLocal(localPosition.X, localPosition.Z, localX, localY);
 		} else {
-			spBone_worldToLocal(bone, localPosition.X, localPosition.Z, &localX, &localY);
+			bone->worldToLocal(localPosition.X, localPosition.Z, localX, localY);
 		}
-		bone->x = localX;
-		bone->y = localY;
+		bone->setX(localX);
+		bone->setY(localY);
 	}
 }
 
 void USpineSkeletonComponent::UpdateWorldTransform() {
 	CheckState();
 	if (skeleton) {
-		spSkeleton_updateWorldTransform(skeleton);
+		skeleton->updateWorldTransform();
 	}
 }
 
 void USpineSkeletonComponent::SetToSetupPose () {
 	CheckState();
-	if (skeleton) spSkeleton_setToSetupPose(skeleton);
+	if (skeleton) skeleton->setToSetupPose();
 }
 
 void USpineSkeletonComponent::SetBonesToSetupPose () {
 	CheckState();
-	if (skeleton) spSkeleton_setBonesToSetupPose(skeleton);
+	if (skeleton) skeleton->setBonesToSetupPose();
 }
 
 void USpineSkeletonComponent::SetSlotsToSetupPose () {
 	CheckState();
-	if (skeleton) spSkeleton_setSlotsToSetupPose(skeleton);
+	if (skeleton) skeleton->setSlotsToSetupPose();
 }
 
 void USpineSkeletonComponent::SetFlipX (bool flipX) {
 	CheckState();
-	if (skeleton) skeleton->flipX = flipX ? 1 : 0;
+	if (skeleton) skeleton->setFlipX(flipX);
 }
 
 bool USpineSkeletonComponent::GetFlipX() {
 	CheckState();
-	if (skeleton) return skeleton->flipX != 0;
+	if (skeleton) return skeleton->getFlipX();
 	return false;
 }
 
 void USpineSkeletonComponent::SetFlipY(bool flipY) {
 	CheckState();
-	if (skeleton) skeleton->flipY = flipY ? 1 : 0;
+	if (skeleton) skeleton->setFlipY(flipY);
 }
 
 bool USpineSkeletonComponent::GetFlipY() {
 	CheckState();
-	if (skeleton) return skeleton->flipY != 0;
+	if (skeleton) return skeleton->getFlipY();
 	return false;
 }
 
@@ -172,7 +185,7 @@ void USpineSkeletonComponent::InternalTick(float DeltaTime, bool CallDelegates)
 
 	if (skeleton) {
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
-		spSkeleton_updateWorldTransform(skeleton);
+		skeleton->updateWorldTransform();
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 	}
 }
@@ -182,8 +195,8 @@ void USpineSkeletonComponent::CheckState () {
 		DisposeState();
 		
 		if (Atlas && SkeletonData) {
-			spSkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
-			skeleton = spSkeleton_create(data);
+			spine::SkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
+			skeleton = new (__FILE__, __LINE__) Skeleton(data);
 		}
 		
 		lastAtlas = Atlas;
@@ -193,7 +206,7 @@ void USpineSkeletonComponent::CheckState () {
 
 void USpineSkeletonComponent::DisposeState () {
 	if (skeleton) {
-		spSkeleton_dispose(skeleton);
+		delete skeleton;
 		skeleton = nullptr;
 	}
 }

+ 18 - 16
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp

@@ -36,6 +36,8 @@
 
 #define LOCTEXT_NAMESPACE "Spine"
 
+using namespace spine;
+
 FName USpineSkeletonDataAsset::GetSkeletonDataFileName () const {
 #if WITH_EDITORONLY_DATA
 	TArray<FString> files;
@@ -83,34 +85,34 @@ void USpineSkeletonDataAsset::Serialize (FArchive& Ar) {
 
 void USpineSkeletonDataAsset::BeginDestroy () {
 	if (this->skeletonData) {
-		spSkeletonData_dispose(this->skeletonData);
+		delete this->skeletonData;
 		this->skeletonData = nullptr;
 	}
 	if (this->animationStateData) {
-		spAnimationStateData_dispose(this->animationStateData);
+		delete this->animationStateData;
 		this->animationStateData = nullptr;
 	}
 	Super::BeginDestroy();
 }
 
-spSkeletonData* USpineSkeletonDataAsset::GetSkeletonData (spAtlas* Atlas, bool ForceReload) {
+SkeletonData* USpineSkeletonDataAsset::GetSkeletonData (Atlas* Atlas, bool ForceReload) {
 	if (!skeletonData || ForceReload) {
 		if (skeletonData) {
-			spSkeletonData_dispose(skeletonData);
+			delete skeletonData;
 			skeletonData = nullptr;
 		}		
 		int dataLen = rawData.Num();
 		if (skeletonDataFileName.GetPlainNameString().Contains(TEXT(".json"))) {
-			spSkeletonJson* json = spSkeletonJson_create(Atlas);
-			this->skeletonData = spSkeletonJson_readSkeletonData(json, (const char*)rawData.GetData());
-			spSkeletonJson_dispose(json);
+			SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(Atlas);
+			this->skeletonData = json->readSkeletonData((const char*)rawData.GetData());
+			delete json;
 		} else {
-			spSkeletonBinary* binary = spSkeletonBinary_create(Atlas);
-			this->skeletonData = spSkeletonBinary_readSkeletonData(binary, (const unsigned char*)rawData.GetData(), (int)rawData.Num());
-			spSkeletonBinary_dispose(binary);
+			SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(Atlas);
+			this->skeletonData = binary->readSkeletonData((const unsigned char*)rawData.GetData(), (int)rawData.Num());
+			delete binary;
 		}
 		if (animationStateData) {
-			spAnimationStateData_dispose(animationStateData);
+			delete animationStateData;
 			GetAnimationStateData(Atlas);
 		}
 		lastAtlas = Atlas;
@@ -118,19 +120,19 @@ spSkeletonData* USpineSkeletonDataAsset::GetSkeletonData (spAtlas* Atlas, bool F
 	return this->skeletonData;
 }
 
-spAnimationStateData* USpineSkeletonDataAsset::GetAnimationStateData(spAtlas* atlas) {
+AnimationStateData* USpineSkeletonDataAsset::GetAnimationStateData(Atlas* atlas) {
 	if (!animationStateData) {
-		spSkeletonData* skeletonData = GetSkeletonData(atlas, false);
-		animationStateData = spAnimationStateData_create(skeletonData);
+		SkeletonData* skeletonData = GetSkeletonData(atlas, false);
+		animationStateData = new (__FILE__, __LINE__) AnimationStateData(skeletonData);
 	}
 	for (auto& data : MixData) {
 		if (!data.From.IsEmpty() && !data.To.IsEmpty()) {
 			const char* fromChar = TCHAR_TO_UTF8(*data.From);
 			const char* toChar = TCHAR_TO_UTF8(*data.To);
-			spAnimationStateData_setMixByName(animationStateData, fromChar, toChar, data.Mix);
+			animationStateData->setMix(fromChar, toChar, data.Mix);
 		}
 	}
-	animationStateData->defaultMix = DefaultMix;
+	animationStateData->setDefaultMix(DefaultMix);
 	return this->animationStateData;
 }
 

+ 58 - 63
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp

@@ -35,6 +35,8 @@
 
 #define LOCTEXT_NAMESPACE "Spine"
 
+using namespace spine;
+
 USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectInitializer& ObjectInitializer) 
 : URuntimeMeshComponent(ObjectInitializer) {
 	PrimaryComponentTick.bCanEverTick = true;
@@ -55,13 +57,10 @@ USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectI
 	
 	TextureParameterName = FName(TEXT("SpriteTexture"));
 
-	worldVertices = spFloatArray_create(1024 * 2);
-	clipper = spSkeletonClipping_create();
+	worldVertices.ensureCapacity(1024 * 2);
 }
 
 void USpineSkeletonRendererComponent::FinishDestroy() {
-	if (clipper) spSkeletonClipping_dispose(clipper);
-	if (worldVertices) spFloatArray_dispose(worldVertices);
 	Super::FinishDestroy();
 }
 
@@ -78,7 +77,7 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
 		USpineSkeletonComponent* skeleton = Cast<USpineSkeletonComponent>(owner->GetComponentByClass(skeletonClass));
 		
 		if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->GetSkeleton() && skeleton->Atlas) {
-			spColor_setFromFloats(&skeleton->GetSkeleton()->color, Color.R, Color.G, Color.B, Color.A);
+			skeleton->GetSkeleton()->getColor().set(Color.R, Color.G, Color.B, Color.A);
 
 			if (atlasNormalBlendMaterials.Num() != skeleton->Atlas->atlasPages.Num()) {
 				atlasNormalBlendMaterials.SetNum(0);
@@ -89,9 +88,9 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
 				pageToMultiplyBlendMaterial.Empty();
 				atlasScreenBlendMaterials.SetNum(0);
 				pageToScreenBlendMaterial.Empty();
-				
-				spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
+								
 				for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
+					AtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->getPages()[i];
 					
 					UMaterialInstanceDynamic* material = UMaterialInstanceDynamic::Create(NormalBlendMaterial, owner);
 					material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
@@ -111,18 +110,17 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
 					material = UMaterialInstanceDynamic::Create(ScreenBlendMaterial, owner);
 					material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
 					atlasScreenBlendMaterials.Add(material);
-					pageToScreenBlendMaterial.Add(currPage, material);
-					
-					currPage = currPage->next;
+					pageToScreenBlendMaterial.Add(currPage, material);					
 				}
 			} else {
 				pageToNormalBlendMaterial.Empty();
 				pageToAdditiveBlendMaterial.Empty();
 				pageToMultiplyBlendMaterial.Empty();
 				pageToScreenBlendMaterial.Empty();
-				
-				spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
+								
 				for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
+					AtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->getPages()[i];
+
 					UTexture2D* texture = skeleton->Atlas->atlasPages[i];
 					UTexture* oldTexture = nullptr;
 					
@@ -157,8 +155,6 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
 						atlasScreenBlendMaterials[i] = material;
 					}
 					pageToScreenBlendMaterial.Add(currPage, atlasScreenBlendMaterials[i]);
-					
-					currPage = currPage->next;
 				}
 			}
 			UpdateMesh(skeleton->GetSkeleton());
@@ -189,7 +185,7 @@ void USpineSkeletonRendererComponent::Flush (int &Idx, TArray<FVector> &Vertices
 	Idx++;
 }
 
-void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
+void USpineSkeletonRendererComponent::UpdateMesh(Skeleton* Skeleton) {
 	TArray<FVector> vertices;
 	TArray<int32> indices;
 	TArray<FVector2D> uvs;
@@ -205,43 +201,42 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
 	float depthOffset = 0;
 	unsigned short quadIndices[] = { 0, 1, 2, 0, 2, 3 };
 
-	for (int i = 0; i < Skeleton->slotsCount; ++i) {
-		float* attachmentVertices = worldVertices->items;
+	for (int i = 0; i < Skeleton->getSlots().size(); ++i) {
+		Vector<float> &attachmentVertices = worldVertices;
 		unsigned short* attachmentIndices = nullptr;
 		int numVertices;
 		int numIndices;
-		spAtlasRegion* attachmentAtlasRegion = nullptr;
-		spColor attachmentColor;
-		spColor_setFromFloats(&attachmentColor, 1, 1, 1, 1);
+		AtlasRegion* attachmentAtlasRegion = nullptr;
+		spine::Color attachmentColor;
+		attachmentColor.set(1, 1, 1, 1);
 		float* attachmentUvs = nullptr;
 
-		spSlot* slot = Skeleton->drawOrder[i];
-		spAttachment* attachment = slot->attachment;
+		Slot* slot = Skeleton->getDrawOrder()[i];
+		Attachment* attachment = slot->getAttachment();
 		if (!attachment) continue;
-		if (attachment->type != SP_ATTACHMENT_REGION && attachment->type != SP_ATTACHMENT_MESH && attachment->type != SP_ATTACHMENT_CLIPPING) continue;
+		if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) continue;		
 		
-		if (attachment->type == SP_ATTACHMENT_REGION) {
-			spRegionAttachment* regionAttachment = (spRegionAttachment*)attachment;
-			spColor_setFromColor(&attachmentColor, &regionAttachment->color);
-			attachmentAtlasRegion = (spAtlasRegion*)regionAttachment->rendererObject;
-			spRegionAttachment_computeWorldVertices(regionAttachment, slot->bone, attachmentVertices, 0, 2);
+		if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
+			RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
+			attachmentColor.set(regionAttachment->getColor());
+			attachmentAtlasRegion = (AtlasRegion*)regionAttachment->getRendererObject();
+			regionAttachment->computeWorldVertices(slot->getBone(), attachmentVertices, 0, 2);
 			attachmentIndices = quadIndices;
-			attachmentUvs = regionAttachment->uvs;
+			attachmentUvs = regionAttachment->getUVs().buffer();
 			numVertices = 4;
 			numIndices = 6;
-		} else if (attachment->type == SP_ATTACHMENT_MESH) {
-			spMeshAttachment* mesh = (spMeshAttachment*)attachment;
-			spColor_setFromColor(&attachmentColor, &mesh->color);
-			attachmentAtlasRegion = (spAtlasRegion*)mesh->rendererObject;			
-			if (mesh->super.worldVerticesLength > worldVertices->size) spFloatArray_setSize(worldVertices, mesh->super.worldVerticesLength);
-			spVertexAttachment_computeWorldVertices(&mesh->super, slot, 0, mesh->super.worldVerticesLength, attachmentVertices, 0, 2);
-			attachmentIndices = mesh->triangles;
-			attachmentUvs = mesh->uvs;
-			numVertices = mesh->super.worldVerticesLength >> 1;
-			numIndices = mesh->trianglesCount;
+		} else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
+			MeshAttachment* mesh = (MeshAttachment*)attachment;
+			attachmentColor.set(mesh->getColor());
+			attachmentAtlasRegion = (AtlasRegion*)mesh->getRendererObject();			
+			mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices, 0, 2);
+			attachmentIndices = mesh->getTriangles().buffer();
+			attachmentUvs = mesh->getUVs().buffer();
+			numVertices = mesh->getWorldVerticesLength() >> 1;
+			numIndices = mesh->getTriangles().size();
 		} else /* clipping */ {
-			spClippingAttachment* clip = (spClippingAttachment*)slot->attachment;
-			spSkeletonClipping_clipStart(clipper, slot, clip);
+			ClippingAttachment* clip = (ClippingAttachment*)attachment;
+			clipper.clipStart(*slot, clip);
 			continue;
 		}
 
@@ -249,20 +244,20 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
 		// to the correct skeleton data yet, we won't find any regions.
 		// ignore regions for which we can't find a material
 		UMaterialInstanceDynamic* material = nullptr;
-		switch (slot->data->blendMode) {
-		case SP_BLEND_MODE_NORMAL:
+		switch (slot->getData().getBlendMode()) {
+		case BlendMode_Normal:
 			if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
 			material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
 			break;
-		case SP_BLEND_MODE_ADDITIVE:
+		case BlendMode_Additive:
 			if (!pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
 			material = pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
 			break;
-		case SP_BLEND_MODE_MULTIPLY:
+		case BlendMode_Multiply:
 			if (!pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
 			material = pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
 			break;
-		case SP_BLEND_MODE_SCREEN:
+		case BlendMode_Screen:
 			if (!pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
 			material = pageToScreenBlendMaterial[attachmentAtlasRegion->page];
 			break;
@@ -271,14 +266,14 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
 			material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
 		}
 
-		if (spSkeletonClipping_isClipping(clipper)) {
-			spSkeletonClipping_clipTriangles(clipper, attachmentVertices, numVertices << 1, attachmentIndices, numIndices, attachmentUvs, 2);
-			attachmentVertices = clipper->clippedVertices->items;
-			numVertices = clipper->clippedVertices->size >> 1;
-			attachmentIndices = clipper->clippedTriangles->items;
-			numIndices = clipper->clippedTriangles->size;
-			attachmentUvs = clipper->clippedUVs->items;
-			if (clipper->clippedTriangles->size == 0) continue;
+		if (clipper.isClipping()) {
+			clipper.clipTriangles(attachmentVertices.buffer(), attachmentIndices, numIndices, attachmentUvs, 2);
+			attachmentVertices = clipper.getClippedVertices();
+			numVertices = clipper.getClippedVertices().size() >> 1;
+			attachmentIndices = clipper.getClippedTriangles().buffer();
+			numIndices = clipper.getClippedTriangles().size();
+			attachmentUvs = clipper.getClippedUVs().buffer();
+			if (clipper.getClippedTriangles().size() == 0) continue;
 		}
 
 		if (lastMaterial != material) {
@@ -289,14 +284,14 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
 
 		SetMaterial(meshSection, material);
 
-		uint8 r = static_cast<uint8>(Skeleton->color.r * slot->color.r * attachmentColor.r * 255);
-		uint8 g = static_cast<uint8>(Skeleton->color.g * slot->color.g * attachmentColor.g * 255);
-		uint8 b = static_cast<uint8>(Skeleton->color.b * slot->color.b * attachmentColor.b * 255);
-		uint8 a = static_cast<uint8>(Skeleton->color.a * slot->color.a * attachmentColor.a * 255);
+		uint8 r = static_cast<uint8>(Skeleton->getColor().r * slot->getColor().r * attachmentColor.r * 255);
+		uint8 g = static_cast<uint8>(Skeleton->getColor().g * slot->getColor().g * attachmentColor.g * 255);
+		uint8 b = static_cast<uint8>(Skeleton->getColor().b * slot->getColor().b * attachmentColor.b * 255);
+		uint8 a = static_cast<uint8>(Skeleton->getColor().a * slot->getColor().a * attachmentColor.a * 255);
 
-		float dr = slot->darkColor ? slot->darkColor->r : 0.0f;
-		float dg = slot->darkColor ? slot->darkColor->g : 0.0f;
-		float db = slot->darkColor ? slot->darkColor->b : 0.0f;		
+		float dr = slot->hasDarkColor() ? slot->getDarkColor().r : 0.0f;
+		float dg = slot->hasDarkColor() ? slot->getDarkColor().g : 0.0f;
+		float db = slot->hasDarkColor() ? slot->getDarkColor().b : 0.0f;		
 
 		for (int j = 0; j < numVertices << 1; j += 2) {
 			colors.Add(FColor(r, g, b, a));
@@ -312,11 +307,11 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
 		idx += numVertices;
 		depthOffset += this->DepthOffset;
 
-		spSkeletonClipping_clipEnd(clipper, slot);			
+		clipper.clipEnd(*slot);			
 	}
 	
 	Flush(meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
-	spSkeletonClipping_clipEnd2(clipper);
+	clipper.clipEnd();
 }
 
 #undef LOCTEXT_NAMESPACE

+ 2 - 2
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineAtlasAsset.h

@@ -39,7 +39,7 @@ class SPINEPLUGIN_API USpineAtlasAsset: public UObject {
 	GENERATED_BODY()
 	
 public:
-	spAtlas* GetAtlas (bool ForceReload = false);
+	spine::Atlas* GetAtlas (bool ForceReload = false);
 	
 	UPROPERTY(EditAnywhere, BlueprintReadWrite)
 	TArray<UTexture2D*> atlasPages;
@@ -51,7 +51,7 @@ public:
 	virtual void BeginDestroy () override;
 	
 protected:
-	spAtlas* atlas = nullptr;
+	spine::Atlas* atlas = nullptr;
 	
 	UPROPERTY()
 	FString rawData;

+ 41 - 61
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h

@@ -40,14 +40,14 @@ struct SPINEPLUGIN_API FSpineEvent {
 	GENERATED_BODY();
 
 public:
-	void SetEvent(spEvent* event) {
-		Name = FString(UTF8_TO_TCHAR(event->data->name));
-		if (event->stringValue) {			
-			StringValue = FString(UTF8_TO_TCHAR(event->stringValue));
+	void SetEvent(spine::Event* event) {
+		Name = FString(UTF8_TO_TCHAR(event->getData().getName().buffer()));
+		if (!event->getStringValue().isEmpty()) {			
+			StringValue = FString(UTF8_TO_TCHAR(event->getStringValue().buffer()));
 		}
-		this->IntValue = event->intValue;
-		this->FloatValue = event->floatValue;
-		this->Time = event->time;
+		this->IntValue = event->getIntValue();
+		this->FloatValue = event->getFloatValue();
+		this->Time = event->getTime();
 	}
 
 	UPROPERTY(BlueprintReadonly)
@@ -81,101 +81,81 @@ public:
 	
 	UTrackEntry () { }		
 
-	void SetTrackEntry (spTrackEntry* entry);
-	spTrackEntry* GetTrackEntry() { return entry; }
+	void SetTrackEntry (spine::TrackEntry* entry);
+	spine::TrackEntry* GetTrackEntry() { return entry; }
 	
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	int GetTrackIndex () { return entry ? entry->trackIndex : 0; }
+	int GetTrackIndex () { return entry ? entry->getTrackIndex() : 0; }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	bool GetLoop () { return entry ? entry->loop != 0 : false; }
+	bool GetLoop () { return entry ? entry->getLoop() : false; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetLoop (bool loop) { if (entry) entry->loop = loop ? 1 : 0; }
+		void SetLoop(bool loop) { if (entry) entry->setLoop(loop); }
 	
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetEventThreshold () { return entry ? entry->eventThreshold : 0; }
+	float GetEventThreshold () { return entry ? entry->getEventThreshold() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetEventThreshold(float eventThreshold) { if (entry) entry->eventThreshold = eventThreshold; }
+	void SetEventThreshold(float eventThreshold) { if (entry) entry->setEventThreshold(eventThreshold); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetAttachmentThreshold() { return entry ? entry->attachmentThreshold : 0; }
+	float GetAttachmentThreshold() { return entry ? entry->getAttachmentThreshold() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetAttachmentThreshold(float attachmentThreshold) { if (entry) entry->attachmentThreshold = attachmentThreshold; }
+	void SetAttachmentThreshold(float attachmentThreshold) { if (entry) entry->setAttachmentThreshold(attachmentThreshold); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetDrawOrderThreshold() { return entry ? entry->drawOrderThreshold : 0; }
+	float GetDrawOrderThreshold() { return entry ? entry->getDrawOrderThreshold() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetDrawOrderThreshold(float drawOrderThreshold) { if (entry) entry->drawOrderThreshold = drawOrderThreshold; }
+	void SetDrawOrderThreshold(float drawOrderThreshold) { if (entry) entry->setDrawOrderThreshold(drawOrderThreshold); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetAnimationStart() { return entry ? entry->animationStart : 0; }
+	float GetAnimationStart() { return entry ? entry->getAnimationStart() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetAnimationStart(float animationStart) { if (entry) entry->animationStart = animationStart; }
+	void SetAnimationStart(float animationStart) { if (entry) entry->setAnimationStart(animationStart); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetAnimationEnd() { return entry ? entry->animationEnd : 0; }
+	float GetAnimationEnd() { return entry ? entry->getAnimationEnd() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetAnimationEnd(float animationEnd) { if (entry) entry->animationEnd = animationEnd; }
+	void SetAnimationEnd(float animationEnd) { if (entry) entry->setAnimationEnd(animationEnd); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetAnimationLast() { return entry ? entry->animationLast : 0; }
+	float GetAnimationLast() { return entry ? entry->getAnimationLast() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetAnimationLast(float animationLast) { if (entry) entry->animationLast = animationLast; }
+	void SetAnimationLast(float animationLast) { if (entry) entry->setAnimationLast(animationLast); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetNextAnimationLast() { return entry ? entry->nextAnimationLast : 0; }
+	float GetDelay() { return entry ? entry->getDelay() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetNextAnimationLast(float nextAnimationLast) { if (entry) entry->nextAnimationLast = nextAnimationLast; }
+	void SetDelay(float delay) { if (entry) entry->setDelay(delay); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetDelay() { return entry ? entry->delay : 0; }
+	float GetTrackTime() { return entry ? entry->getTrackTime() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetDelay(float delay) { if (entry) entry->delay = delay; }
+	void SetTrackTime(float trackTime) { if (entry) entry->setTrackTime(trackTime); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetTrackTime() { return entry ? entry->trackTime : 0; }
+	float GetTrackEnd() { return entry ? entry->getTrackEnd() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetTrackTime(float trackTime) { if (entry) entry->trackTime = trackTime; }
+	void SetTrackEnd(float trackEnd) { if (entry) entry->setTrackEnd(trackEnd); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetTrackLast() { return entry ? entry->trackLast : 0; }
+	float GetTimeScale() { return entry ? entry->getTimeScale() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetTrackLast(float trackLast) { if (entry) entry->trackLast = trackLast; }
+	void SetTimeScale(float timeScale) { if (entry) entry->setTimeScale(timeScale); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetNextTrackLast() { return entry ? entry->nextTrackLast : 0; }
+	float GetAlpha() { return entry ? entry->getAlpha() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetNextTrackLast(float nextTrackLast) { if (entry) entry->nextTrackLast = nextTrackLast; }
+	void SetAlpha(float alpha) { if (entry) entry->setAlpha(alpha); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetTrackEnd() { return entry ? entry->trackEnd : 0; }
+	float GetMixTime() { return entry ? entry->getMixTime() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetTrackEnd(float trackEnd) { if (entry) entry->trackEnd = trackEnd; }
+	void SetMixTime(float mixTime) { if (entry) entry->setMixTime(mixTime); }
 
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetTimeScale() { return entry ? entry->timeScale : 0; }
+	float GetMixDuration() { return entry ? entry->getMixDuration() : 0; }
 	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetTimeScale(float timeScale) { if (entry) entry->timeScale = timeScale; }
-
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetAlpha() { return entry ? entry->alpha : 0; }
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetAlpha(float alpha) { if (entry) entry->alpha = alpha; }
-
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetMixTime() { return entry ? entry->mixTime : 0; }
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetMixTime(float mixTime) { if (entry) entry->mixTime = mixTime; }
-
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetMixDuration() { return entry ? entry->mixDuration : 0; }
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetMixDuration(float mixDuration) { if (entry) entry->mixDuration = mixDuration; }
-
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	float GetInterruptAlpha() { return entry ? entry->interruptAlpha : 0; }
-	UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
-	void SetInterruptAlpha(float interruptAlpha) { if (entry) entry->interruptAlpha = interruptAlpha; }
+	void SetMixDuration(float mixDuration) { if (entry) entry->setMixDuration(mixDuration); }
 
 	UPROPERTY(BlueprintAssignable, Category = "Components|Spine|TrackEntry")
 	FSpineAnimationStartDelegate AnimationStart;
@@ -196,7 +176,7 @@ public:
 	FSpineAnimationDisposeDelegate AnimationDispose;
 
 protected:
-	spTrackEntry* entry = nullptr;
+	spine::TrackEntry* entry = nullptr;
 };
 
 class USpineAtlasAsset;
@@ -205,7 +185,7 @@ class SPINEPLUGIN_API USpineSkeletonAnimationComponent: public USpineSkeletonCom
 	GENERATED_BODY()
 
 public:
-	spAnimationState* GetAnimationState () { return state; };
+	spine::AnimationState* GetAnimationState () { return state; };
 		
 	USpineSkeletonAnimationComponent ();
 	
@@ -269,7 +249,7 @@ protected:
 	virtual void InternalTick(float DeltaTime, bool CallDelegates = true) override;
 	virtual void DisposeState () override;
 	
-	spAnimationState* state;
+	spine::AnimationState* state;
 
 	// keep track of track entries so they won't get GCed while
 	// in transit within a blueprint

+ 2 - 2
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h

@@ -52,7 +52,7 @@ public:
 	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
 	USpineSkeletonDataAsset* SkeletonData;
 	
-	spSkeleton* GetSkeleton () { return skeleton; };
+	spine::Skeleton* GetSkeleton () { return skeleton; };
 	
 	UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
 	bool SetSkin (const FString& SkinName);
@@ -109,7 +109,7 @@ protected:
 	virtual void InternalTick(float DeltaTime, bool CallDelegates = true);
 	virtual void DisposeState ();
 
-	spSkeleton* skeleton;
+	spine::Skeleton* skeleton;
 	USpineAtlasAsset* lastAtlas = nullptr;
 	USpineSkeletonDataAsset* lastData = nullptr;	
 };

Некоторые файлы не были показаны из-за большого количества измененных файлов