dm 7 years ago
commit
445ff4ace5
100 changed files with 11158 additions and 0 deletions
  1. 7 0
      .gitignore
  2. 25 0
      Android.mk
  3. 43 0
      CMakeLists.txt
  4. 119 0
      dependencies/spine/include/spine/Animation.h
  5. 450 0
      dependencies/spine/include/spine/AnimationState.h
  6. 88 0
      dependencies/spine/include/spine/AnimationStateData.h
  7. 159 0
      dependencies/spine/include/spine/Atlas.h
  8. 74 0
      dependencies/spine/include/spine/AtlasAttachmentLoader.h
  9. 54 0
      dependencies/spine/include/spine/Attachment.h
  10. 76 0
      dependencies/spine/include/spine/AttachmentLoader.h
  11. 74 0
      dependencies/spine/include/spine/AttachmentTimeline.h
  12. 46 0
      dependencies/spine/include/spine/AttachmentType.h
  13. 43 0
      dependencies/spine/include/spine/BlendMode.h
  14. 249 0
      dependencies/spine/include/spine/Bone.h
  15. 120 0
      dependencies/spine/include/spine/BoneData.h
  16. 46 0
      dependencies/spine/include/spine/BoundingBoxAttachment.h
  17. 58 0
      dependencies/spine/include/spine/ClippingAttachment.h
  18. 94 0
      dependencies/spine/include/spine/Color.h
  19. 81 0
      dependencies/spine/include/spine/ColorTimeline.h
  20. 53 0
      dependencies/spine/include/spine/Constraint.h
  21. 128 0
      dependencies/spine/include/spine/ContainerUtil.h
  22. 77 0
      dependencies/spine/include/spine/CurveTimeline.h
  23. 117 0
      dependencies/spine/include/spine/Debug.h
  24. 70 0
      dependencies/spine/include/spine/DeformTimeline.h
  25. 64 0
      dependencies/spine/include/spine/DrawOrderTimeline.h
  26. 87 0
      dependencies/spine/include/spine/Event.h
  27. 87 0
      dependencies/spine/include/spine/EventData.h
  28. 65 0
      dependencies/spine/include/spine/EventTimeline.h
  29. 118 0
      dependencies/spine/include/spine/Extension.h
  30. 59 0
      dependencies/spine/include/spine/HasRendererObject.h
  31. 185 0
      dependencies/spine/include/spine/HashMap.h
  32. 106 0
      dependencies/spine/include/spine/IkConstraint.h
  33. 93 0
      dependencies/spine/include/spine/IkConstraintData.h
  34. 72 0
      dependencies/spine/include/spine/IkConstraintTimeline.h
  35. 114 0
      dependencies/spine/include/spine/Json.h
  36. 56 0
      dependencies/spine/include/spine/LinkedMesh.h
  37. 130 0
      dependencies/spine/include/spine/MathUtil.h
  38. 142 0
      dependencies/spine/include/spine/MeshAttachment.h
  39. 46 0
      dependencies/spine/include/spine/MixBlend.h
  40. 44 0
      dependencies/spine/include/spine/MixDirection.h
  41. 60 0
      dependencies/spine/include/spine/PathAttachment.h
  42. 110 0
      dependencies/spine/include/spine/PathConstraint.h
  43. 105 0
      dependencies/spine/include/spine/PathConstraintData.h
  44. 69 0
      dependencies/spine/include/spine/PathConstraintMixTimeline.h
  45. 68 0
      dependencies/spine/include/spine/PathConstraintPositionTimeline.h
  46. 52 0
      dependencies/spine/include/spine/PathConstraintSpacingTimeline.h
  47. 73 0
      dependencies/spine/include/spine/PointAttachment.h
  48. 75 0
      dependencies/spine/include/spine/Pool.h
  49. 41 0
      dependencies/spine/include/spine/PositionMode.h
  50. 76 0
      dependencies/spine/include/spine/RTTI.h
  51. 133 0
      dependencies/spine/include/spine/RegionAttachment.h
  52. 42 0
      dependencies/spine/include/spine/RotateMode.h
  53. 71 0
      dependencies/spine/include/spine/RotateTimeline.h
  54. 52 0
      dependencies/spine/include/spine/ScaleTimeline.h
  55. 52 0
      dependencies/spine/include/spine/ShearTimeline.h
  56. 247 0
      dependencies/spine/include/spine/Skeleton.h
  57. 130 0
      dependencies/spine/include/spine/SkeletonBinary.h
  58. 108 0
      dependencies/spine/include/spine/SkeletonBounds.h
  59. 80 0
      dependencies/spine/include/spine/SkeletonClipping.h
  60. 179 0
      dependencies/spine/include/spine/SkeletonData.h
  61. 92 0
      dependencies/spine/include/spine/SkeletonJson.h
  62. 149 0
      dependencies/spine/include/spine/Skin.h
  63. 127 0
      dependencies/spine/include/spine/Slot.h
  64. 114 0
      dependencies/spine/include/spine/SlotData.h
  65. 42 0
      dependencies/spine/include/spine/SpacingMode.h
  66. 60 0
      dependencies/spine/include/spine/SpineObject.h
  67. 213 0
      dependencies/spine/include/spine/SpineString.h
  68. 52 0
      dependencies/spine/include/spine/TextureLoader.h
  69. 72 0
      dependencies/spine/include/spine/Timeline.h
  70. 54 0
      dependencies/spine/include/spine/TimelineType.h
  71. 93 0
      dependencies/spine/include/spine/TransformConstraint.h
  72. 82 0
      dependencies/spine/include/spine/TransformConstraintData.h
  73. 71 0
      dependencies/spine/include/spine/TransformConstraintTimeline.h
  74. 45 0
      dependencies/spine/include/spine/TransformMode.h
  75. 73 0
      dependencies/spine/include/spine/TranslateTimeline.h
  76. 65 0
      dependencies/spine/include/spine/Triangulator.h
  77. 81 0
      dependencies/spine/include/spine/TwoColorTimeline.h
  78. 50 0
      dependencies/spine/include/spine/Updatable.h
  79. 223 0
      dependencies/spine/include/spine/Vector.h
  80. 91 0
      dependencies/spine/include/spine/VertexAttachment.h
  81. 106 0
      dependencies/spine/include/spine/VertexEffect.h
  82. 44 0
      dependencies/spine/include/spine/Vertices.h
  83. 52 0
      dependencies/spine/include/spine/dll.h
  84. 114 0
      dependencies/spine/include/spine/spine.h
  85. 141 0
      dependencies/spine/src/spine/Animation.cpp
  86. 1022 0
      dependencies/spine/src/spine/AnimationState.cpp
  87. 86 0
      dependencies/spine/src/spine/AnimationStateData.cpp
  88. 357 0
      dependencies/spine/src/spine/Atlas.cpp
  89. 129 0
      dependencies/spine/src/spine/AtlasAttachmentLoader.cpp
  90. 52 0
      dependencies/spine/src/spine/Attachment.cpp
  91. 53 0
      dependencies/spine/src/spine/AttachmentLoader.cpp
  92. 125 0
      dependencies/spine/src/spine/AttachmentTimeline.cpp
  93. 537 0
      dependencies/spine/src/spine/Bone.cpp
  94. 140 0
      dependencies/spine/src/spine/BoneData.cpp
  95. 42 0
      dependencies/spine/src/spine/BoundingBoxAttachment.cpp
  96. 52 0
      dependencies/spine/src/spine/ClippingAttachment.cpp
  97. 144 0
      dependencies/spine/src/spine/ColorTimeline.cpp
  98. 45 0
      dependencies/spine/src/spine/Constraint.cpp
  99. 129 0
      dependencies/spine/src/spine/CurveTimeline.cpp
  100. 297 0
      dependencies/spine/src/spine/DeformTimeline.cpp

+ 7 - 0
.gitignore

@@ -0,0 +1,7 @@
+examples/HelloSpine/proj.win32/Debug_*
+examples/HelloSpine/proj.win32/.vs/
+examples/HelloSpine/proj.cmake/build_emsc/
+examples/HelloSpine/proj.android/build/
+examples/HelloSpine/proj.android/.externalNativeBuild/
+examples/HelloSpine/proj.android/.gradle/
+examples/HelloSpine/data/*.dll

+ 25 - 0
Android.mk

@@ -0,0 +1,25 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := oxygine-spine_static
+LOCAL_MODULE_FILENAME := liboxygine-spine
+LOCAL_CPP_EXTENSION := .cpp
+
+SPINE_SRC := $(LOCAL_PATH)/dependencies/spine/
+
+LOCAL_SRC_FILES := \
+				$(subst $(LOCAL_PATH)/,, \
+				$(wildcard $(SPINE_SRC)/src/spine/*.cpp) \
+				)
+
+LOCAL_SRC_FILES += src/oxygine-spine/spine.cpp
+
+
+LOCAL_C_INCLUDES := $(SPINE_SRC)/include \
+					$(LOCAL_PATH)/../oxygine-framework/oxygine/src/
+
+LOCAL_EXPORT_C_INCLUDES += $(SPINE_SRC)/include \
+						   $(LOCAL_PATH)/src 
+					
+include $(BUILD_STATIC_LIBRARY)

+ 43 - 0
CMakeLists.txt

@@ -0,0 +1,43 @@
+cmake_minimum_required (VERSION 2.6)
+project (OXYGINE_SPINE)
+
+set(OXYGINE_SPINE_INCLUDE_DIRS 
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/dependencies/spine/include
+	)
+
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+
+set(OXYGINE_SPINE_DEFINITIONS	
+	-DOXYGINE_SPINE=1)
+
+
+file(GLOB OX_SPINE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/oxygine-spine/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/oxygine-spine/*.h)
+#source_group(lib FILES ${OX_SPINE_SRC})
+
+
+file(GLOB SPINE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/spine/src/spine/*.cpp)
+
+
+source_group(lib FILES ${SPINE_SRC})
+
+add_library(oxygine-spine STATIC ${OX_SPINE_SRC} ${SPINE_SRC})
+
+set(OXYGINE_SPINE_LIBS
+		oxygine-spine)	
+
+if(EMSCRIPTEN)
+	set(linkFlags "-Wno-warn-absolute-paths")
+	set_target_properties(oxygine-spine PROPERTIES LINK_FLAGS "${linkFlags}")
+endif(EMSCRIPTEN)
+
+include_directories(${OXYGINE_SPINE_INCLUDE_DIRS})
+include_directories(../oxygine-framework/oxygine/src)
+
+
+
+set(OXYGINE_SPINE_INCLUDE_DIRS ${OXYGINE_SPINE_INCLUDE_DIRS} PARENT_SCOPE)
+set(OXYGINE_SPINE_LIBS ${OXYGINE_SPINE_LIBS} PARENT_SCOPE)
+set(OXYGINE_SPINE_DEFINITIONS ${OXYGINE_SPINE_DEFINITIONS} PARENT_SCOPE)

+ 119 - 0
dependencies/spine/include/spine/Animation.h

@@ -0,0 +1,119 @@
+/******************************************************************************
+ * 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_Animation_h
+#define Spine_Animation_h
+
+#include <spine/Vector.h>
+#include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class Timeline;
+
+class Skeleton;
+
+class Event;
+
+class SP_API Animation : public SpineObject {
+	friend class AnimationState;
+
+	friend class TrackEntry;
+
+	friend class AnimationStateData;
+
+	friend class AttachmentTimeline;
+
+	friend class ColorTimeline;
+
+	friend class DeformTimeline;
+
+	friend class DrawOrderTimeline;
+
+	friend class EventTimeline;
+
+	friend class IkConstraintTimeline;
+
+	friend class PathConstraintMixTimeline;
+
+	friend class PathConstraintPositionTimeline;
+
+	friend class PathConstraintSpacingTimeline;
+
+	friend class RotateTimeline;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TransformConstraintTimeline;
+
+	friend class TranslateTimeline;
+
+	friend class TwoColorTimeline;
+
+public:
+	Animation(const String &name, Vector<Timeline *> &timelines, float duration);
+
+	~Animation();
+
+	/// Applies all the animation's timelines to the specified skeleton.
+	/// See also Timeline::apply(Skeleton&, float, float, Vector, float, MixPose, MixDirection)
+	void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector<Event *> *pEvents, float alpha,
+			   MixBlend blend, MixDirection direction);
+
+	const String &getName();
+
+	Vector<Timeline *> &getTimelines();
+
+	float getDuration();
+
+	void setDuration(float inValue);
+
+
+
+private:
+	Vector<Timeline *> _timelines;
+	float _duration;
+	String _name;
+
+	/// @param target After the first and before the last entry.
+	static int binarySearch(Vector<float> &values, float target, int step);
+
+	/// @param target After the first and before the last entry.
+	static int binarySearch(Vector<float> &values, float target);
+
+	static int linearSearch(Vector<float> &values, float target, int step);
+};
+}
+
+#endif /* Spine_Animation_h */

+ 450 - 0
dependencies/spine/include/spine/AnimationState.h

@@ -0,0 +1,450 @@
+/******************************************************************************
+ * 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_AnimationState_h
+#define Spine_AnimationState_h
+
+#include <spine/Vector.h>
+#include <spine/Pool.h>
+#include <spine/MixBlend.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/HasRendererObject.h>
+
+namespace spine {
+    enum EventType {
+        EventType_Start,
+        EventType_Interrupt,
+        EventType_End,
+        EventType_Complete,
+        EventType_Dispose,
+        EventType_Event
+    };
+    
+    class AnimationState;
+    class TrackEntry;
+
+    class Animation;
+    class Event;
+    class AnimationStateData;
+    class Skeleton;
+    class RotateTimeline;
+    
+    typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
+    
+    /// State for the playback of an animation
+    class SP_API TrackEntry : public SpineObject, public HasRendererObject {
+        friend class EventQueue;
+        friend class AnimationState;
+        
+    public:
+        TrackEntry();
+
+        virtual ~TrackEntry();
+        
+        /// The index of the track where this entry is either current or queued.
+        int getTrackIndex();
+        
+        /// The animation to apply for this track entry.
+        Animation* getAnimation();
+        
+        ///
+        /// If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration.
+        bool getLoop();
+        void setLoop(bool inValue);
+
+        ///
+        /// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
+        /// of being mixed out.
+        ///
+        /// When mixing between animations that key the same property, if a lower track also keys that property then the value will
+        /// briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
+        /// while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation
+        /// at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
+        /// keys the property, only when a higher track also keys the property.
+        ///
+        /// Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the
+        /// previous animation.
+        bool getHoldPrevious();
+        void setHoldPrevious(bool inValue);
+        
+        ///
+        /// Seconds to postpone playing the animation. When a track entry is the current track entry, delay postpones incrementing
+        /// the track time. When a track entry is queued, delay is the time from the start of the previous animation to when the
+        /// track entry will become the current track entry.
+        float getDelay();
+        void setDelay(float inValue);
+        
+        ///
+        /// Current time in seconds this track entry has been the current track entry. The track time determines
+        /// TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping.
+        float getTrackTime();
+        void setTrackTime(float inValue);
+        
+        ///
+        /// The track time in seconds when this animation will be removed from the track. Defaults to the animation duration for
+        /// non-looping animations and to int.MaxValue for looping animations. If the track end time is reached and no
+        /// other animations are queued for playback, and mixing from any previous animations is complete, properties keyed by the animation,
+        /// are set to the setup pose and the track is cleared.
+        ///
+        /// It may be desired to use AnimationState.addEmptyAnimation(int, float, float) to mix the properties back to the
+        /// setup pose over time, rather than have it happen instantly.
+        ///
+        float getTrackEnd();
+        void setTrackEnd(float inValue);
+        
+        ///
+        /// Seconds when this animation starts, both initially and after looping. Defaults to 0.
+        ///
+        /// When changing the animation start time, it often makes sense to set TrackEntry.AnimationLast to the same value to
+        /// prevent timeline keys before the start time from triggering.
+        ///
+        float getAnimationStart();
+        void setAnimationStart(float inValue);
+        
+        ///
+        /// Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
+        /// loop back to TrackEntry.AnimationStart at this time. Defaults to the animation duration.
+        float getAnimationEnd();
+        void setAnimationEnd(float inValue);
+        
+        ///
+        /// The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
+        /// animation is applied, event timelines will fire all events between the animation last time (exclusive) and animation time
+        /// (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied.
+        float getAnimationLast();
+        void setAnimationLast(float inValue);
+        
+        ///
+        /// Uses TrackEntry.TrackTime to compute the animation time between TrackEntry.AnimationStart. and
+        /// TrackEntry.AnimationEnd. When the track time is 0, the animation time is equal to the animation start time.
+        ///
+        float getAnimationTime();
+        
+        ///
+        /// Multiplier for the delta time when the animation state is updated, causing time for this animation to play slower or
+        /// faster. Defaults to 1.
+        ///
+        float getTimeScale();
+        void setTimeScale(float inValue);
+        
+        ///
+        /// Values less than 1 mix this animation with the last skeleton pose. Defaults to 1, which overwrites the last skeleton pose with
+        /// this animation.
+        ///
+        /// Typically track 0 is used to completely pose the skeleton, then alpha can be used on higher tracks. It doesn't make sense
+        /// to use alpha on track 0 if the skeleton pose is from the last frame render.
+        ///
+        float getAlpha();
+        void setAlpha(float inValue);
+        
+        ///
+        /// When the mix percentage (mix time / mix duration) is less than the event threshold, event timelines for the animation
+        /// being mixed out will be applied. Defaults to 0, so event timelines are not applied for an animation being mixed out.
+        float getEventThreshold();
+        void setEventThreshold(float inValue);
+        
+        ///
+        /// When the mix percentage (mix time / mix duration) is less than the attachment threshold, attachment timelines for the
+        /// animation being mixed out will be applied. Defaults to 0, so attachment timelines are not applied for an animation being
+        /// mixed out.
+        float getAttachmentThreshold();
+        void setAttachmentThreshold(float inValue);
+        
+        ///
+        /// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the
+        /// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being
+        /// mixed out.
+        ///
+        float getDrawOrderThreshold();
+        void setDrawOrderThreshold(float inValue);
+        
+        ///
+        /// The animation queued to start after this animation, or NULL.
+        TrackEntry* getNext();
+        
+        ///
+        /// Returns true if at least one loop has been completed.
+        bool isComplete();
+        
+        ///
+        /// Seconds from 0 to the mix duration when mixing from the previous animation to this animation. May be slightly more than
+        /// TrackEntry.MixDuration when the mix is complete.
+        float getMixTime();
+        void setMixTime(float inValue);
+        
+        ///
+        /// Seconds for mixing from the previous animation to this animation. Defaults to the value provided by
+        /// AnimationStateData based on the animation before this animation (if any).
+        ///
+        /// The mix duration can be set manually rather than use the value from AnimationStateData.GetMix.
+        /// In that case, the mixDuration must be set before AnimationState.update(float) is next called.
+        ///
+        /// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay
+        /// less than or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
+        ///
+        ///
+        ///
+        float getMixDuration();
+        void setMixDuration(float inValue);
+
+
+        MixBlend getMixBlend();
+        void setMixBlend(MixBlend blend);
+        
+        ///
+        /// The track entry for the previous animation when mixing from the previous animation to this animation, or NULL if no
+        /// mixing is currently occuring. When mixing from multiple animations, MixingFrom makes up a double linked list with MixingTo.
+        TrackEntry* getMixingFrom();
+
+        ///
+        /// The track entry for the next animation when mixing from this animation, or NULL if no mixing is currently occuring.
+        /// When mixing from multiple animations, MixingTo makes up a double linked list with MixingFrom.
+        TrackEntry* getMixingTo();
+        
+        ///
+        /// Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
+        /// long way around when using alpha and starting animations on other tracks.
+        ///
+        /// Mixing involves finding a rotation between two others, which has two possible solutions: the short way or the long way around.
+        /// The two rotations likely change over time, so which direction is the short or long way also changes.
+        /// If the short way was always chosen, bones would flip to the other side when that direction became the long way.
+        /// TrackEntry chooses the short way the first time it is applied and remembers that direction.
+        void resetRotationDirections();
+        
+        void setListener(AnimationStateListener listener);
+
+    private:
+        Animation* _animation;
+        
+        TrackEntry* _next;
+        TrackEntry* _mixingFrom;
+        TrackEntry* _mixingTo;
+        int _trackIndex;
+
+        bool _loop, _holdPrevious;
+        float _eventThreshold, _attachmentThreshold, _drawOrderThreshold;
+        float _animationStart, _animationEnd, _animationLast, _nextAnimationLast;
+        float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale;
+        float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha;
+        MixBlend _mixBlend;
+        Vector<int> _timelineMode;
+        Vector<TrackEntry*> _timelineHoldMix;
+        Vector<float> _timelinesRotation;
+        AnimationStateListener _listener;
+        
+        void reset();
+    };
+    
+    class SP_API EventQueueEntry : public SpineObject {
+        friend class EventQueue;
+        
+    public:
+        EventType _type;
+        TrackEntry* _entry;
+        Event* _event;
+        
+        EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL);
+    };
+    
+    class SP_API EventQueue : public SpineObject {
+        friend class AnimationState;
+        
+    private:
+        Vector<EventQueueEntry> _eventQueueEntries;
+        AnimationState& _state;
+        Pool<TrackEntry>& _trackEntryPool;
+        bool _drainDisabled;
+        
+        static EventQueue* newEventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
+
+        static EventQueueEntry newEventQueueEntry(EventType eventType, TrackEntry* entry, Event* event = NULL);
+        
+        EventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
+        
+        ~EventQueue();
+        
+        void start(TrackEntry* entry);
+
+        void interrupt(TrackEntry* entry);
+
+        void end(TrackEntry* entry);
+
+        void dispose(TrackEntry* entry);
+
+        void complete(TrackEntry* entry);
+
+        void event(TrackEntry* entry, Event* event);
+
+        /// Raises all events in the queue and drains the queue.
+        void drain();
+    };
+    
+    class SP_API AnimationState : public SpineObject, public HasRendererObject {
+        friend class TrackEntry;
+        friend class EventQueue;
+        
+    public:
+        explicit AnimationState(AnimationStateData* data);
+        
+        ~AnimationState();
+        
+        ///
+        /// Increments the track entry times, setting queued animations as current if needed
+        /// @param delta delta time
+        void update(float delta);
+        
+        ///
+        /// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
+        /// animation state can be applied to multiple skeletons to pose them identically.
+        bool apply(Skeleton& skeleton);
+        
+        ///
+        /// Removes all animations from all tracks, leaving skeletons in their previous pose.
+        /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
+        /// rather than leaving them in their previous pose.
+        void clearTracks();
+        
+        ///
+        /// Removes all animations from the tracks, leaving skeletons in their previous pose.
+        /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
+        /// rather than leaving them in their previous pose.
+        void clearTrack(size_t trackIndex);
+        
+        /// Sets an animation by name. setAnimation(int, Animation, bool)
+        TrackEntry* setAnimation(size_t trackIndex, const String& animationName, bool loop);
+        
+        /// Sets the current animation for a track, discarding any queued animations.
+        /// @param loop If true, the animation will repeat.
+        /// If false, it will not, instead its last frame is applied if played beyond its duration.
+        /// In either case TrackEntry.TrackEnd determines when the track is cleared.
+        /// @return
+        /// A track entry to allow further customization of animation playback. References to the track entry must not be kept
+        /// after AnimationState.Dispose.
+        TrackEntry* setAnimation(size_t trackIndex, Animation* animation, bool loop);
+        
+        /// Queues an animation by name.
+        /// addAnimation(int, Animation, bool, float)
+        TrackEntry* addAnimation(size_t trackIndex, const String& animationName, bool loop, float delay);
+        
+        /// Adds an animation to be played delay seconds after the current or last queued animation
+        /// for a track. If the track is empty, it is equivalent to calling setAnimation.
+        /// @param delay
+        /// Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
+        /// duration of the previous track minus any mix duration plus the negative delay.
+        ///
+        /// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
+        /// after AnimationState.Dispose
+        TrackEntry* addAnimation(size_t trackIndex, Animation* animation, bool loop, float delay);
+        
+        ///
+        /// Sets an empty animation for a track, discarding any queued animations, and mixes to it over the specified mix duration.
+        TrackEntry* setEmptyAnimation(size_t trackIndex, float mixDuration);
+        
+        ///
+        /// Adds an empty animation to be played after the current or last queued animation for a track, and mixes to it over the
+        /// specified mix duration.
+        /// @return
+        /// A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
+        ///
+        /// @param trackIndex Track number.
+        /// @param mixDuration Mix duration.
+        /// @param delay Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
+        /// duration of the previous track minus any mix duration plus the negative delay.
+        TrackEntry* addEmptyAnimation(size_t trackIndex, float mixDuration, float delay);
+        
+        ///
+        /// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.
+        void setEmptyAnimations(float mixDuration);
+        
+        /// @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
+        TrackEntry* getCurrent(size_t trackIndex);
+        
+        AnimationStateData* getData();
+        
+        /// A list of tracks that have animations, which may contain NULLs.
+        Vector<TrackEntry*> &getTracks();
+
+        float getTimeScale();
+        void setTimeScale(float inValue);
+
+        void setListener(AnimationStateListener listener);
+
+		void disableQueue();
+		void enableQueue();
+        
+    private:
+        
+        AnimationStateData* _data;
+
+        Pool<TrackEntry> _trackEntryPool;
+        Vector<TrackEntry*> _tracks;
+        Vector<Event*> _events;
+        EventQueue* _queue;
+
+        Vector<int> _propertyIDs;
+        bool _animationsChanged;
+
+        AnimationStateListener _listener;
+        
+        float _timeScale;
+
+        static Animation* getEmptyAnimation();
+        
+        static void applyRotateTimeline(RotateTimeline* rotateTimeline, Skeleton& skeleton, float time, float alpha, MixBlend pose, Vector<float>& timelinesRotation, size_t i, bool firstFrame);
+        
+        /// Returns true when all mixing from entries are complete.
+        bool updateMixingFrom(TrackEntry* to, float delta);
+        
+        float applyMixingFrom(TrackEntry* to, Skeleton& skeleton, MixBlend currentPose);
+        
+        void queueEvents(TrackEntry* entry, float animationTime);
+        
+        /// Sets the active TrackEntry for a given track number.
+        void setCurrent(size_t index, TrackEntry* current, bool interrupt);
+
+        TrackEntry* expandToIndex(size_t index);
+
+        /// Object-pooling version of new TrackEntry. Obtain an unused TrackEntry from the pool and clear/initialize its values.
+        /// @param last May be NULL.
+        TrackEntry* newTrackEntry(size_t trackIndex, Animation* animation, bool loop, TrackEntry* last);
+
+        /// Dispose all track entries queued after the given TrackEntry.
+        void disposeNext(TrackEntry* entry);
+
+        void animationsChanged();
+
+        void setTimelineModes(TrackEntry* entry);
+
+        bool hasTimeline(TrackEntry* entry, int inId);
+    };
+}
+
+#endif /* Spine_AnimationState_h */

+ 88 - 0
dependencies/spine/include/spine/AnimationStateData.h

@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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_AnimationStateData_h
+#define Spine_AnimationStateData_h
+
+#include <spine/HashMap.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+#include <assert.h>
+
+namespace spine {
+    class SkeletonData;
+    class Animation;
+    
+    /// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
+    class SP_API AnimationStateData : public SpineObject {
+        friend class AnimationState;
+        
+    public:
+		explicit AnimationStateData(SkeletonData* skeletonData);
+		
+        /// The SkeletonData to look up animations when they are specified by name.
+        SkeletonData* getSkeletonData();
+        
+        /// The mix duration to use when no mix duration has been specifically defined between two animations.
+        float getDefaultMix();
+        void setDefaultMix(float inValue);
+        
+        /// Sets a mix duration by animation names.
+        void setMix(const String& fromName, const String& toName, float duration);
+        
+        /// Sets a mix duration when changing from the specified animation to the other.
+        /// See TrackEntry.MixDuration.
+        void setMix(Animation* from, Animation* to, float duration);
+        
+        ///
+        /// The mix duration to use when changing from the specified animation to the other,
+        /// or the DefaultMix if no mix duration has been set.
+        ///
+        float getMix(Animation* from, Animation* to);
+
+    private:
+        class AnimationPair : public SpineObject {
+        public:
+            Animation* _a1;
+            Animation* _a2;
+
+            explicit AnimationPair(Animation* a1 = NULL, Animation* a2 = NULL);
+            
+            bool operator==(const AnimationPair &other) const;
+        };
+        
+        SkeletonData* _skeletonData;
+        float _defaultMix;
+        HashMap<AnimationPair, float> _animationToMixTime;
+    };
+}
+
+#endif /* Spine_AnimationStateData_h */

+ 159 - 0
dependencies/spine/include/spine/Atlas.h

@@ -0,0 +1,159 @@
+/******************************************************************************
+ * 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_Atlas_h
+#define Spine_Atlas_h
+
+#include <spine/Vector.h>
+#include <spine/Extension.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/HasRendererObject.h>
+
+namespace spine {
+enum Format {
+	Format_Alpha,
+	Format_Intensity,
+	Format_LuminanceAlpha,
+	Format_RGB565,
+	Format_RGBA4444,
+	Format_RGB888,
+	Format_RGBA8888
+};
+
+enum TextureFilter {
+	TextureFilter_Unknown,
+	TextureFilter_Nearest,
+	TextureFilter_Linear,
+	TextureFilter_MipMap,
+	TextureFilter_MipMapNearestNearest,
+	TextureFilter_MipMapLinearNearest,
+	TextureFilter_MipMapNearestLinear,
+	TextureFilter_MipMapLinearLinear
+};
+
+enum TextureWrap {
+	TextureWrap_MirroredRepeat,
+	TextureWrap_ClampToEdge,
+	TextureWrap_Repeat
+};
+
+class SP_API AtlasPage : public SpineObject, public HasRendererObject {
+public:
+	String name;
+	Format format;
+	TextureFilter minFilter;
+	TextureFilter magFilter;
+	TextureWrap uWrap;
+	TextureWrap vWrap;
+	int width, height;
+
+	explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
+											   magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
+											   vWrap(TextureWrap_ClampToEdge) {
+	}
+
+	virtual ~AtlasPage() { }
+};
+
+class SP_API AtlasRegion : public SpineObject {
+public:
+	AtlasPage *page;
+	String name;
+	int x, y, width, height;
+	float u, v, u2, v2;
+	float offsetX, offsetY;
+	int originalWidth, originalHeight;
+	int index;
+	bool rotate;
+	Vector<int> splits;
+	Vector<int> pads;
+};
+
+class TextureLoader;
+
+class SP_API Atlas : public SpineObject {
+public:
+	Atlas(const String &path, TextureLoader *textureLoader);
+
+	Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader);
+
+	~Atlas();
+
+	void flipV();
+
+	/// Returns the first region found with the specified name. This method uses String comparison to find the region, so the result
+	/// should be cached rather than calling this method multiple times.
+	/// @return The region, or NULL.
+	AtlasRegion *findRegion(const String &name);
+
+	Vector<AtlasPage*> &getPages();
+
+private:
+	Vector<AtlasPage *> _pages;
+	Vector<AtlasRegion *> _regions;
+	TextureLoader *_textureLoader;
+
+	void load(const char *begin, int length, const char *dir);
+
+	class Str {
+	public:
+		const char *begin;
+		const char *end;
+	};
+
+	static void trim(Str *str);
+
+	/// Tokenize string without modification. Returns 0 on failure
+	static int readLine(const char **begin, const char *end, Str *str);
+
+	/// Moves str->begin past the first occurence of c. Returns 0 on failure
+	static int beginPast(Str *str, char c);
+
+	/// Returns 0 on failure
+	static int readValue(const char **begin, const char *end, Str *str);
+
+	/// Returns the number of tuple values read (1, 2, 4, or 0 for failure)
+	static int readTuple(const char **begin, const char *end, Str tuple[]);
+
+	static char *mallocString(Str *str);
+
+	static int indexOf(const char **array, int count, Str *str);
+
+	static int equals(Str *str, const char *other);
+
+	static int toInt(Str *str);
+
+	static Atlas *abortAtlas(Atlas *atlas);
+};
+}
+
+#endif /* Spine_Atlas_h */
+

+ 74 - 0
dependencies/spine/include/spine/AtlasAttachmentLoader.h

@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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_AtlasAttachmentLoader_h
+#define Spine_AtlasAttachmentLoader_h
+
+#include <spine/AttachmentLoader.h>
+#include <spine/Vector.h>
+#include <spine/SpineString.h>
+
+
+namespace spine {
+    class Atlas;
+    class AtlasRegion;
+    
+    ///
+    /// An AttachmentLoader that configures attachments using texture regions from an Atlas.
+    /// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide.
+    ///
+	class SP_API AtlasAttachmentLoader : public AttachmentLoader {
+    public:
+		RTTI_DECL
+		
+        explicit AtlasAttachmentLoader(Atlas* atlas);
+        
+        virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
+        
+        virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path);
+        
+        virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name);
+        
+        virtual PathAttachment* newPathAttachment(Skin& skin, const String& name);
+        
+        virtual PointAttachment* newPointAttachment(Skin& skin, const String& name);
+        
+        virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
+
+		virtual void configureAttachment(Attachment* attachment);
+        
+        AtlasRegion* findRegion(const String& name);
+        
+    private:
+        Atlas* _atlas;
+    };
+}
+
+#endif /* Spine_AtlasAttachmentLoader_h */

+ 54 - 0
dependencies/spine/include/spine/Attachment.h

@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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_Attachment_h
+#define Spine_Attachment_h
+
+#include <spine/RTTI.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class SP_API Attachment : public SpineObject {
+RTTI_DECL
+
+public:
+	explicit Attachment(const String &name);
+
+	virtual ~Attachment();
+
+	const String &getName() const;
+
+private:
+	const String _name;
+};
+}
+
+#endif /* Spine_Attachment_h */

+ 76 - 0
dependencies/spine/include/spine/AttachmentLoader.h

@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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_AttachmentLoader_h
+#define Spine_AttachmentLoader_h
+
+#include <spine/RTTI.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+    class Skin;
+    class Attachment;
+    class RegionAttachment;
+    class MeshAttachment;
+    class BoundingBoxAttachment;
+    class PathAttachment;
+    class PointAttachment;
+    class ClippingAttachment;
+    
+    class SP_API AttachmentLoader : public SpineObject {
+	public:
+        RTTI_DECL
+        
+        AttachmentLoader();
+        
+        virtual ~AttachmentLoader();
+        
+        /// @return May be NULL to not load any attachment.
+        virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path) = 0;
+        
+        /// @return May be NULL to not load any attachment.
+        virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path) = 0;
+        
+        /// @return May be NULL to not load any attachment.
+        virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name) = 0;
+        
+        /// @return May be NULL to not load any attachment
+        virtual PathAttachment* newPathAttachment(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 void configureAttachment(Attachment* attachment) = 0;
+    };
+}
+
+#endif /* Spine_AttachmentLoader_h */

+ 74 - 0
dependencies/spine/include/spine/AttachmentTimeline.h

@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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_AttachmentTimeline_h
+#define Spine_AttachmentTimeline_h
+
+#include <spine/Timeline.h>
+#include <spine/SpineObject.h>
+#include <spine/Vector.h>
+#include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+
+    class Skeleton;
+    class Event;
+    
+    class SP_API AttachmentTimeline : public Timeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit AttachmentTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, const String& attachmentName);
+        
+		size_t getSlotIndex();
+        void setSlotIndex(size_t inValue);
+        const Vector<float>& getFrames();
+        const Vector<String>& getAttachmentNames();
+		size_t getFrameCount();
+    private:
+        size_t _slotIndex;
+        Vector<float> _frames;
+        Vector<String> _attachmentNames;
+    };
+}
+
+#endif /* Spine_AttachmentTimeline_h */

+ 46 - 0
dependencies/spine/include/spine/AttachmentType.h

@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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_AttachmentType_h
+#define Spine_AttachmentType_h
+
+namespace spine {
+    enum AttachmentType {
+        AttachmentType_Region,
+        AttachmentType_Boundingbox,
+        AttachmentType_Mesh,
+        AttachmentType_Linkedmesh,
+        AttachmentType_Path,
+        AttachmentType_Point,
+        AttachmentType_Clipping
+    };
+}
+
+#endif /* Spine_AttachmentType_h */

+ 43 - 0
dependencies/spine/include/spine/BlendMode.h

@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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_BlendMode_h
+#define Spine_BlendMode_h
+
+namespace spine {
+enum BlendMode {
+	BlendMode_Normal = 0,
+	BlendMode_Additive,
+	BlendMode_Multiply,
+	BlendMode_Screen
+};
+}
+
+#endif /* Spine_BlendMode_h */

+ 249 - 0
dependencies/spine/include/spine/Bone.h

@@ -0,0 +1,249 @@
+/******************************************************************************
+ * 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_Bone_h
+#define Spine_Bone_h
+
+#include <spine/Updatable.h>
+#include <spine/SpineObject.h>
+#include <spine/Vector.h>
+
+namespace spine {
+class BoneData;
+
+class Skeleton;
+
+/// Stores a bone's current pose.
+///
+/// A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
+/// local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
+/// constraint or application code modifies the world transform after it was computed from the local transform.
+class SP_API Bone : public Updatable {
+	friend class AnimationState;
+
+	friend class RotateTimeline;
+
+	friend class IkConstraint;
+
+	friend class TransformConstraint;
+
+	friend class VertexAttachment;
+
+	friend class PathConstraint;
+
+	friend class Skeleton;
+
+	friend class RegionAttachment;
+
+	friend class PointAttachment;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TranslateTimeline;
+
+RTTI_DECL
+
+public:
+	static void setYDown(bool inValue);
+
+	static bool isYDown();
+
+	/// @param parent May be NULL.
+	Bone(BoneData &data, Skeleton &skeleton, Bone *parent = NULL);
+
+	/// Same as updateWorldTransform. This method exists for Bone to implement Spine::Updatable.
+	virtual void update();
+
+	/// Computes the world transform using the parent bone and this bone's local transform.
+	void updateWorldTransform();
+
+	/// Computes the world transform using the parent bone and the specified local transform.
+	void updateWorldTransform(float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY);
+
+	void setToSetupPose();
+
+	void worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY);
+
+	void localToWorld(float localX, float localY, float &outWorldX, float &outWorldY);
+
+	float worldToLocalRotation(float worldRotation);
+
+	float localToWorldRotation(float localRotation);
+
+	///
+	/// Rotates the world transform the specified amount and sets isAppliedValid to false.
+	///
+	/// @param degrees Degrees.
+	void rotateWorld(float degrees);
+
+	float getWorldToLocalRotationX();
+
+	float getWorldToLocalRotationY();
+
+	BoneData &getData();
+
+	Skeleton &getSkeleton();
+
+	Bone *getParent();
+
+	Vector<Bone *> &getChildren();
+
+	/// The local X translation.
+	float getX();
+
+	void setX(float inValue);
+
+	/// The local Y translation.
+	float getY();
+
+	void setY(float inValue);
+
+	/// The local rotation.
+	float getRotation();
+
+	void setRotation(float inValue);
+
+	/// The local scaleX.
+	float getScaleX();
+
+	void setScaleX(float inValue);
+
+	/// The local scaleY.
+	float getScaleY();
+
+	void setScaleY(float inValue);
+
+	/// The local shearX.
+	float getShearX();
+
+	void setShearX(float inValue);
+
+	/// The local shearY.
+	float getShearY();
+
+	void setShearY(float inValue);
+
+	/// The rotation, as calculated by any constraints.
+	float getAppliedRotation();
+
+	void setAppliedRotation(float inValue);
+
+	/// The applied local x translation.
+	float getAX();
+
+	void setAX(float inValue);
+
+	/// The applied local y translation.
+	float getAY();
+
+	void setAY(float inValue);
+
+	/// The applied local scaleX.
+	float getAScaleX();
+
+	void setAScaleX(float inValue);
+
+	/// The applied local scaleY.
+	float getAScaleY();
+
+	void setAScaleY(float inValue);
+
+	/// The applied local shearX.
+	float getAShearX();
+
+	void setAShearX(float inValue);
+
+	/// The applied local shearY.
+	float getAShearY();
+
+	void setAShearY(float inValue);
+
+	float getA();
+
+	void setA(float inValue);
+
+	float getB();
+
+	void setB(float inValue);
+
+	float getC();
+
+	void setC(float inValue);
+
+	float getD();
+
+	void setD(float inValue);
+
+	float getWorldX();
+
+	void setWorldX(float inValue);
+
+	float getWorldY();
+
+	void setWorldY(float inValue);
+
+	float getWorldRotationX();
+
+	float getWorldRotationY();
+
+	/// Returns the magnitide (always positive) of the world scale X.
+	float getWorldScaleX();
+
+	/// Returns the magnitide (always positive) of the world scale Y.
+	float getWorldScaleY();
+
+	bool isAppliedValid();
+	void setAppliedValid(bool valid);
+
+private:
+	static bool yDown;
+
+	BoneData &_data;
+	Skeleton &_skeleton;
+	Bone *_parent;
+	Vector<Bone *> _children;
+	float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY;
+	float _ax, _ay, _arotation, _ascaleX, _ascaleY, _ashearX, _ashearY;
+	bool _appliedValid;
+	float _a, _b, _worldX;
+	float _c, _d, _worldY;
+	bool _sorted;
+
+	/// Computes the individual applied transform values from the world transform. This can be useful to perform processing using
+	/// the applied transform after the world transform has been modified directly (eg, by a constraint)..
+	///
+	/// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation.
+	void updateAppliedTransform();
+};
+}
+
+#endif /* Spine_Bone_h */

+ 120 - 0
dependencies/spine/include/spine/BoneData.h

@@ -0,0 +1,120 @@
+/******************************************************************************
+ * 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_BoneData_h
+#define Spine_BoneData_h
+
+#include <spine/TransformMode.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class SP_API BoneData : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+	friend class AnimationState;
+
+	friend class RotateTimeline;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TranslateTimeline;
+
+public:
+	BoneData(int index, const String &name, BoneData *parent = NULL);
+
+	/// The index of the bone in Skeleton.Bones
+	int getIndex();
+
+	/// The name of the bone, which is unique within the skeleton.
+	const String &getName();
+
+	/// May be NULL.
+	BoneData *getParent();
+
+	float getLength();
+
+	void setLength(float inValue);
+
+	/// Local X translation.
+	float getX();
+
+	void setX(float inValue);
+
+	/// Local Y translation.
+	float getY();
+
+	void setY(float inValue);
+
+	/// Local rotation.
+	float getRotation();
+
+	void setRotation(float inValue);
+
+	/// Local scaleX.
+	float getScaleX();
+
+	void setScaleX(float inValue);
+
+	/// Local scaleY.
+	float getScaleY();
+
+	void setScaleY(float inValue);
+
+	/// Local shearX.
+	float getShearX();
+
+	void setShearX(float inValue);
+
+	/// Local shearY.
+	float getShearY();
+
+	void setShearY(float inValue);
+
+	/// The transform mode for how parent world transforms affect this bone.
+	TransformMode getTransformMode();
+
+	void setTransformMode(TransformMode inValue);
+
+private:
+	const int _index;
+	const String _name;
+	BoneData *_parent;
+	float _length;
+	float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY;
+	TransformMode _transformMode;
+};
+}
+
+#endif /* Spine_BoneData_h */

+ 46 - 0
dependencies/spine/include/spine/BoundingBoxAttachment.h

@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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_BoundingBoxAttachment_h
+#define Spine_BoundingBoxAttachment_h
+
+#include <spine/VertexAttachment.h>
+#include <spine/SpineObject.h>
+
+namespace spine {
+    /// Attachment that has a polygon for bounds checking.
+    class SP_API BoundingBoxAttachment : public VertexAttachment {
+        RTTI_DECL
+        
+        explicit BoundingBoxAttachment(const String& name);
+    };
+}
+
+#endif /* Spine_BoundingBoxAttachment_h */

+ 58 - 0
dependencies/spine/include/spine/ClippingAttachment.h

@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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_ClippingAttachment_h
+#define Spine_ClippingAttachment_h
+
+#include <spine/VertexAttachment.h>
+
+namespace spine {
+    class SlotData;
+    
+    class SP_API ClippingAttachment : public VertexAttachment {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        friend class SkeletonClipping;
+        
+        RTTI_DECL
+        
+    public:
+        explicit ClippingAttachment(const String& name);
+        
+        SlotData* getEndSlot();
+        void setEndSlot(SlotData* inValue);
+        
+    private:
+        SlotData* _endSlot;
+    };
+}
+
+#endif /* Spine_ClippingAttachment_h */

+ 94 - 0
dependencies/spine/include/spine/Color.h

@@ -0,0 +1,94 @@
+/******************************************************************************
+ * 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_COLOR_H
+#define SPINE_COLOR_H
+
+#include <spine/MathUtil.h>
+
+namespace spine {
+class SP_API Color : public SpineObject {
+public:
+	Color() : r(0), g(0), b(0), a(0) {
+	}
+
+	Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) {
+		clamp();
+	}
+
+	inline Color &set(float _r, float _g, float _b, float _a) {
+		this->r = _r;
+		this->g = _g;
+		this->b = _b;
+		this->a = _a;
+		clamp();
+		return *this;
+	}
+
+	inline Color &set(const Color &other) {
+		r = other.r;
+		g = other.g;
+		b = other.b;
+		a = other.a;
+		clamp();
+		return *this;
+	}
+
+	inline Color &add(float _r, float _g, float _b, float _a) {
+		this->r += _r;
+		this->g += _g;
+		this->b += _b;
+		this->a += _a;
+		clamp();
+		return *this;
+	}
+
+	inline Color &add(const Color &other) {
+		r += other.r;
+		g += other.g;
+		b += other.b;
+		a += other.a;
+		clamp();
+		return *this;
+	}
+
+	inline Color &clamp() {
+		r = MathUtil::clamp(this->r, 0, 1);
+		g = MathUtil::clamp(this->g, 0, 1);
+		b = MathUtil::clamp(this->b, 0, 1);
+		a = MathUtil::clamp(this->a, 0, 1);
+		return *this;
+	}
+
+	float r, g, b, a;
+};
+}
+
+
+#endif //SPINE_COLOR_H

+ 81 - 0
dependencies/spine/include/spine/ColorTimeline.h

@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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_ColorTimeline_h
+#define Spine_ColorTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+class SP_API ColorTimeline : public CurveTimeline {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+RTTI_DECL
+
+public:
+	static const int ENTRIES;
+
+	explicit ColorTimeline(int frameCount);
+
+	virtual void
+	apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
+		  MixDirection direction);
+
+	virtual int getPropertyId();
+
+	/// Sets the time and value of the specified keyframe.
+	void setFrame(int frameIndex, float time, float r, float g, float b, float a);
+
+	int getSlotIndex();
+
+	void setSlotIndex(int inValue);
+
+	Vector<float> &getFrames();
+
+protected:
+	static const int PREV_TIME;
+	static const int PREV_R;
+	static const int PREV_G;
+	static const int PREV_B;
+	static const int PREV_A;
+	static const int R;
+	static const int G;
+	static const int B;
+	static const int A;
+
+private:
+	int _slotIndex;
+	Vector<float> _frames;
+};
+}
+
+#endif /* Spine_ColorTimeline_h */

+ 53 - 0
dependencies/spine/include/spine/Constraint.h

@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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_Constraint_h
+#define Spine_Constraint_h
+
+#include <spine/Updatable.h>
+
+namespace spine {
+/// The interface for all constraints.
+class SP_API Constraint : public Updatable {
+RTTI_DECL
+
+public:
+	Constraint();
+
+	virtual ~Constraint();
+
+	virtual void update() = 0;
+
+	/// The ordinal for the order a skeleton's constraints will be applied.
+	virtual int getOrder() = 0;
+};
+}
+
+#endif /* Spine_Constraint_h */

+ 128 - 0
dependencies/spine/include/spine/ContainerUtil.h

@@ -0,0 +1,128 @@
+/******************************************************************************
+ * 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_ContainerUtil_h
+#define Spine_ContainerUtil_h
+
+#include <spine/Extension.h>
+#include <spine/Vector.h>
+#include <spine/HashMap.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+#include <assert.h>
+
+namespace spine {
+    class SP_API ContainerUtil : public SpineObject {
+    public:
+        /// Finds an item by comparing each item's name.
+        /// It is more efficient to cache the results of this method than to call it multiple times.
+        /// @return May be NULL.
+        template<typename T>
+        static T* findWithName(Vector<T*>& items, const String& name) {
+            assert(name.length() > 0);
+            
+            for (size_t i = 0; i < items.size(); ++i) {
+                T* item = items[i];
+                if (item->getName() == name) {
+                    return item;
+                }
+            }
+            
+            return NULL;
+        }
+        
+        /// @return -1 if the item was not found.
+        template<typename T>
+        static int findIndexWithName(Vector<T*>& items, const String& name) {
+            assert(name.length() > 0);
+            
+            for (size_t i = 0, len = items.size(); i < len; ++i) {
+                T* item = items[i];
+                if (item->getName() == name) {
+                    return static_cast<int>(i);
+                }
+            }
+            
+            return -1;
+        }
+        
+        /// 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.
+        /// @return May be NULL.
+        template<typename T>
+        static T* findWithDataName(Vector<T*>& items, const String& name) {
+            assert(name.length() > 0);
+            
+            for (size_t i = 0; i < items.size(); ++i) {
+                T* item = items[i];
+                if (item->getData().getName() == name) {
+                    return item;
+                }
+            }
+            
+            return NULL;
+        }
+        
+        /// @return -1 if the item was not found.
+        template<typename T>
+        static int findIndexWithDataName(Vector<T*>& items, const String& name) {
+            assert(name.length() > 0);
+            
+            for (size_t i = 0, len = items.size(); i < len; ++i) {
+                T* item = items[i];
+                if (item->getData().getName() == name) {
+                    return static_cast<int>(i);
+                }
+            }
+            
+            return -1;
+        }
+        
+        template<typename T>
+        static void cleanUpVectorOfPointers(Vector<T*>& items) {
+            for (size_t i = 0; i < items.size(); ) {
+                T* item = items[i];
+                
+                delete item;
+
+                items.removeAt(i);
+            }
+        }
+        
+    private:
+        // ctor, copy ctor, and assignment should be private in a Singleton
+        ContainerUtil();
+        ContainerUtil(const ContainerUtil&);
+        ContainerUtil& operator=(const ContainerUtil&);
+    };
+}
+
+#endif /* Spine_ContainerUtil_h */

+ 77 - 0
dependencies/spine/include/spine/CurveTimeline.h

@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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_CurveTimeline_h
+#define Spine_CurveTimeline_h
+
+#include <spine/Timeline.h>
+#include <spine/Vector.h>
+
+namespace spine {
+    /// Base class for frames that use an interpolation bezier curve.
+    class SP_API CurveTimeline : public Timeline {
+        RTTI_DECL
+        
+    public:
+        explicit CurveTimeline(int frameCount);
+
+        virtual ~CurveTimeline();
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction) = 0;
+        
+        virtual int getPropertyId() = 0;
+        
+        size_t getFrameCount();
+        
+        void setLinear(size_t frameIndex);
+        
+        void setStepped(size_t frameIndex);
+        
+        /// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
+        /// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
+        /// the difference between the keyframe's values.
+        void setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2);
+        
+        float getCurvePercent(size_t frameIndex, float percent);
+        
+        float getCurveType(size_t frameIndex);
+        
+    protected:
+        static const float LINEAR;
+        static const float STEPPED;
+        static const float BEZIER;
+        static const int BEZIER_SIZE;
+        
+    private:
+        Vector<float> _curves; // type, x, y, ...
+    };
+}
+
+#endif /* Spine_CurveTimeline_h */

+ 117 - 0
dependencies/spine/include/spine/Debug.h

@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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_DEBUG_H
+#define SPINE_DEBUG_H
+
+#include <spine/Extension.h>
+
+#include <map>
+
+namespace spine {
+class SP_API DebugExtension : public SpineExtension {
+	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) {
+		}
+	};
+
+public:
+	DebugExtension(SpineExtension* extension): _extension(extension), _allocations(0), _reallocations(0), _frees(0) {
+	}
+
+	void reportLeaks() {
+		for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
+			printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
+		}
+		printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees);
+		if (_allocated.empty()) printf("No leaks detected");
+	}
+
+	void clearAllocations() {
+		_allocated.clear();
+	}
+
+	virtual void *_alloc(size_t size, const char *file, int line) {
+		void *result = _extension->_alloc(size, file, line);
+		_allocated[result] = Allocation(result, size, file, line);
+		_allocations++;
+		return result;
+	}
+
+	virtual void *_calloc(size_t size, const char *file, int line) {
+		void *result = _extension->_calloc(size, file, line);
+		_allocated[result] = Allocation(result, size, file, line);
+		_allocations++;
+		return result;
+	}
+
+	virtual void *_realloc(void *ptr, size_t size, const char *file, int line) {
+		_allocated.erase(ptr);
+		void *result = _extension->_realloc(ptr, size, file, line);
+		_reallocations++;
+		_allocated[result] = Allocation(result, size, file, line);
+		return result;
+	}
+
+	virtual void _free(void *mem, const char *file, int line) {
+		if (_allocated.count(mem)) {
+			_extension->_free(mem, file, line);
+			_frees++;
+			_allocated.erase(mem);
+			return;
+		}
+
+		printf("%s:%i (address %p): Double free or not allocated through SpineExtension\n", file, line, mem);
+		_extension->_free(mem, file, line);
+	}
+
+	virtual char *_readFile(const String &path, int *length) {
+		return _extension->_readFile(path, length);
+	}
+
+private:
+	SpineExtension* _extension;
+	std::map<void*, Allocation> _allocated;
+	size_t _allocations;
+	size_t _reallocations;
+	size_t _frees;
+};
+}
+
+
+#endif //SPINE_DEBUG_H

+ 70 - 0
dependencies/spine/include/spine/DeformTimeline.h

@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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_DeformTimeline_h
+#define Spine_DeformTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+    class VertexAttachment;
+    
+    class SP_API DeformTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit DeformTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, Vector<float>& vertices);
+        
+        int getSlotIndex();
+        void setSlotIndex(int inValue);
+        Vector<float>& getFrames();
+        Vector< Vector<float> >& getVertices();
+        VertexAttachment* getAttachment();
+        void setAttachment(VertexAttachment* inValue);
+        
+    private:
+        int _slotIndex;
+        Vector<float> _frames;
+        Vector< Vector<float> > _frameVertices;
+        VertexAttachment* _attachment;
+    };
+}
+
+#endif /* Spine_DeformTimeline_h */

+ 64 - 0
dependencies/spine/include/spine/DrawOrderTimeline.h

@@ -0,0 +1,64 @@
+/******************************************************************************
+ * 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_DrawOrderTimeline_h
+#define Spine_DrawOrderTimeline_h
+
+#include <spine/Timeline.h>
+
+namespace spine {
+    class SP_API DrawOrderTimeline : public Timeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+    
+    public:
+        explicit DrawOrderTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        /// @param drawOrder May be NULL to use bind pose draw order
+        void setFrame(size_t frameIndex, float time, Vector<int>& drawOrder);
+        
+        Vector<float>& getFrames();
+        Vector< Vector<int> >& getDrawOrders();
+        size_t getFrameCount();
+    
+    private:
+        Vector<float> _frames;
+        Vector< Vector<int> > _drawOrders;
+    };
+}
+
+#endif /* Spine_DrawOrderTimeline_h */

+ 87 - 0
dependencies/spine/include/spine/Event.h

@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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_Event_h
+#define Spine_Event_h
+
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class EventData;
+
+/// Stores the current pose values for an Event.
+class SP_API Event : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+	friend class AnimationState;
+
+public:
+	Event(float time, const EventData &data);
+
+	const EventData &getData();
+
+	/// The animation time this event was keyed.
+	float getTime();
+
+	int getIntValue();
+
+	void setIntValue(int inValue);
+
+	float getFloatValue();
+
+	void setFloatValue(float inValue);
+
+	const String &getStringValue();
+
+	void setStringValue(const String &inValue);
+
+	float getVolume();
+
+	void setVolume(float inValue);
+
+	float getBalance();
+
+	void setBalance(float inValue);
+
+private:
+	const EventData &_data;
+	const float _time;
+	int _intValue;
+	float _floatValue;
+	String _stringValue;
+	float _volume;
+	float _balance;
+};
+}
+
+#endif /* Spine_Event_h */

+ 87 - 0
dependencies/spine/include/spine/EventData.h

@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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_EventData_h
+#define Spine_EventData_h
+
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+/// Stores the setup pose values for an Event.
+class SP_API EventData : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+	friend class Event;
+
+public:
+	explicit EventData(const String &name);
+
+	/// The name of the event, which is unique within the skeleton.
+	const String &getName() const;
+
+	int getIntValue();
+
+	void setIntValue(int inValue);
+
+	float getFloatValue();
+
+	void setFloatValue(float inValue);
+
+	const String &getStringValue();
+
+	void setStringValue(const String &inValue);
+
+	const String &getAudioPath();
+
+	void setAudioPath(const String &inValue);
+
+	float getVolume();
+
+	void setVolume(float inValue);
+
+	float getBalance();
+
+	void setBalance(float inValue);
+
+private:
+	const String _name;
+	int _intValue;
+	float _floatValue;
+	String _stringValue;
+	String _audioPath;
+	float _volume;
+	float _balance;
+};
+}
+
+#endif /* Spine_EventData_h */

+ 65 - 0
dependencies/spine/include/spine/EventTimeline.h

@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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_EventTimeline_h
+#define Spine_EventTimeline_h
+
+#include <spine/Timeline.h>
+
+namespace spine {
+    class SP_API EventTimeline : public Timeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit EventTimeline(int frameCount);
+        
+        ~EventTimeline();
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(size_t frameIndex, Event* event);
+        
+        Vector<float> getFrames();
+        Vector<Event*>& getEvents();
+        size_t getFrameCount();
+        
+    private:
+        Vector<float> _frames;
+        Vector<Event*> _events;
+    };
+}
+
+#endif /* Spine_EventTimeline_h */

+ 118 - 0
dependencies/spine/include/spine/Extension.h

@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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_Extension_h
+#define Spine_Extension_h
+
+#include <stdlib.h>
+#include <spine/dll.h>
+
+#define SP_UNUSED(x) (void)(x)
+
+namespace spine {
+class String;
+
+class SP_API SpineExtension {
+public:
+	template<typename T>
+	static T *alloc(size_t num, const char *file, int line) {
+		return (T *) getInstance()->_alloc(sizeof(T) * num, file, line);
+	}
+
+	template<typename T>
+	static T *calloc(size_t num, const char *file, int line) {
+		return (T *) getInstance()->_calloc(sizeof(T) * num, file, line);
+	}
+
+	template<typename T>
+	static T *realloc(T *ptr, size_t num, const char *file, int line) {
+		return (T *) getInstance()->_realloc(ptr, sizeof(T) * num, file, line);
+	}
+
+	template<typename T>
+	static void free(T *ptr, const char *file, int line) {
+		getInstance()->_free((void *) ptr, file, line);
+	}
+
+	static char *readFile(const String &path, int *length) {
+		return getInstance()->_readFile(path, length);
+	}
+
+	static void setInstance(SpineExtension *inSpineExtension);
+
+	static SpineExtension *getInstance();
+
+	virtual ~SpineExtension();
+
+	/// Implement this function to use your own memory allocator
+	virtual void *_alloc(size_t size, const char *file, int line) = 0;
+
+	virtual void *_calloc(size_t size, const char *file, int line) = 0;
+
+	virtual void *_realloc(void *ptr, size_t size, const char *file, int line) = 0;
+
+	/// If you provide a spineAllocFunc, you should also provide a spineFreeFunc
+	virtual void _free(void *mem, const char *file, int line) = 0;
+
+	virtual char *_readFile(const String &path, int *length) = 0;
+
+protected:
+	SpineExtension();
+
+private:
+	static SpineExtension *_instance;
+};
+
+class SP_API DefaultSpineExtension : public SpineExtension {
+public:
+	DefaultSpineExtension();
+
+	virtual ~DefaultSpineExtension();
+
+protected:
+	virtual void *_alloc(size_t size, const char *file, int line);
+
+	virtual void *_calloc(size_t size, const char *file, int line);
+
+	virtual void *_realloc(void *ptr, size_t size, const char *file, int line);
+
+	virtual void _free(void *mem, const char *file, int line);
+
+	virtual char *_readFile(const String &path, int *length);
+};
+
+// This function is to be implemented by engine specific runtimes to provide
+// the default extension for that engine. It is called the first time
+// SpineExtension::getInstance() is called, when no instance has been set
+// yet.
+extern SpineExtension *getDefaultExtension();
+}
+
+#endif /* Spine_Extension_h */

+ 59 - 0
dependencies/spine/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

+ 185 - 0
dependencies/spine/include/spine/HashMap.h

@@ -0,0 +1,185 @@
+/******************************************************************************
+ * 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_HashMap_h
+#define Spine_HashMap_h
+
+#include <spine/Extension.h>
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+
+ // Required for new with line number and file name in  MSVC
+#ifdef _MSC_VER
+#pragma warning(disable:4291)
+#endif
+
+namespace spine {
+template<typename K, typename V>
+class SP_API HashMap : public SpineObject {
+private:
+	class Entry;
+
+public:
+	class SP_API Pair {
+	public:
+		explicit Pair(K &k, V &v) : key(k), value(v) {}
+
+		K &key;
+		V &value;
+	};
+
+	class SP_API Entries {
+	public:
+		friend class HashMap;
+
+		explicit Entries(Entry *entry) : _entry(NULL), _hasChecked(false) {
+			_start.next = entry;
+			_entry = &_start;
+		}
+
+		Pair next() {
+			assert(_entry);
+			assert(_hasChecked);
+			_entry = _entry->next;
+			Pair pair(_entry->_key, _entry->_value);
+			_hasChecked = false;
+			return pair;
+		}
+
+		bool hasNext() {
+			_hasChecked = true;
+			return _entry->next;
+		}
+
+	private:
+		bool _hasChecked;
+		Entry _start;
+		Entry *_entry;
+	};
+
+	HashMap() :
+			_head(NULL),
+			_size(0) {
+	}
+
+	~HashMap() {
+		for (Entry *entry = _head; entry != NULL;) {
+			Entry* next = entry->next;
+			delete entry;
+			entry = next;
+		}
+	}
+
+	size_t size() {
+		return _size;
+	}
+
+	void put(const K &key, const V &value) {
+		Entry *entry = find(key);
+		if (entry) {
+			entry->_key = key;
+			entry->_value = value;
+		} else {
+			entry = new(__FILE__, __LINE__) Entry();
+			entry->_key = key;
+			entry->_value = value;
+
+			Entry *oldHead = _head;
+
+			if (oldHead) {
+				_head = entry;
+				oldHead->prev = entry;
+				entry->next = oldHead;
+			} else {
+				_head = entry;
+			}
+			_size++;
+		}
+	}
+
+	bool containsKey(const K &key) {
+		return find(key) != NULL;
+	}
+
+	bool remove(const K &key) {
+		Entry *entry = find(key);
+		if (!entry) return false;
+
+		Entry *prev = entry->prev;
+		Entry *next = entry->next;
+
+		if (prev) prev->next = next;
+		else _head = next;
+		if (next) next->prev = entry->prev;
+
+		delete entry;
+		_size--;
+
+		return true;
+	}
+
+	V operator[](const K &key) {
+		Entry *entry = find(key);
+		if (entry) return entry->_value;
+		else {
+			assert(false);
+			return 0;
+		}
+	}
+
+	Entries getEntries() const {
+		return Entries(_head);
+	}
+
+private:
+	Entry *find(const K &key) {
+		for (Entry *entry = _head; entry != NULL; entry = entry->next) {
+			if (entry->_key == key)
+				return entry;
+		}
+		return NULL;
+	}
+
+	class SP_API Entry : public SpineObject {
+	public:
+		K _key;
+		V _value;
+		Entry *next;
+		Entry *prev;
+
+		Entry() : next(NULL), prev(NULL) {}
+	};
+
+	Entry *_head;
+	size_t _size;
+};
+}
+
+#endif /* Spine_HashMap_h */

+ 106 - 0
dependencies/spine/include/spine/IkConstraint.h

@@ -0,0 +1,106 @@
+/******************************************************************************
+ * 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_IkConstraint_h
+#define Spine_IkConstraint_h
+
+#include <spine/Constraint.h>
+
+#include <spine/Vector.h>
+
+namespace spine {
+class IkConstraintData;
+
+class Skeleton;
+
+class Bone;
+
+class SP_API IkConstraint : public Constraint {
+	friend class Skeleton;
+
+	friend class IkConstraintTimeline;
+
+RTTI_DECL
+
+public:
+	/// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified
+	/// in the world coordinate system.
+	static void apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha);
+
+	/// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as
+	/// possible. The target is specified in the world coordinate system.
+	/// @param child A direct descendant of the parent bone.
+	static void apply(Bone &parent, Bone &child, float targetX, float targetY, int bendDir, bool stretch, float alpha);
+
+	IkConstraint(IkConstraintData &data, Skeleton &skeleton);
+
+	/// Applies the constraint to the constrained bones.
+	void apply();
+
+	virtual void update();
+
+	virtual int getOrder();
+
+	IkConstraintData &getData();
+
+	Vector<Bone *> &getBones();
+
+	Bone *getTarget();
+
+	void setTarget(Bone *inValue);
+
+	int getBendDirection();
+
+	void setBendDirection(int inValue);
+
+	bool getCompress();
+
+	void setCompress(bool inValue);
+
+	bool getStretch();
+
+	void setStretch(bool inValue);
+
+	float getMix();
+
+	void setMix(float inValue);
+
+private:
+	IkConstraintData &_data;
+	Vector<Bone *> _bones;
+	int _bendDirection;
+	bool _compress;
+	bool _stretch;
+	float _mix;
+	Bone *_target;
+};
+}
+
+#endif /* Spine_IkConstraint_h */

+ 93 - 0
dependencies/spine/include/spine/IkConstraintData.h

@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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_IkConstraintData_h
+#define Spine_IkConstraintData_h
+
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+    class BoneData;
+    
+    class SP_API IkConstraintData : public SpineObject {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        friend class IkConstraint;
+        friend class Skeleton;
+        friend class IkConstraintTimeline;
+        
+    public:
+        explicit IkConstraintData(const String& name);
+        
+        /// The IK constraint's name, which is unique within the skeleton.
+        const String& getName();
+
+        size_t getOrder();
+        void setOrder(size_t inValue);
+        
+        /// The bones that are constrained by this IK Constraint.
+        Vector<BoneData*>& getBones();
+        
+        /// The bone that is the IK target.
+        BoneData* getTarget();
+        void setTarget(BoneData* inValue);
+        
+        /// Controls the bend direction of the IK bones, either 1 or -1.
+        int getBendDirection();
+        void setBendDirection(int inValue);
+
+        bool getCompress();
+        void setCompress(bool inValue);
+
+        bool getStretch();
+        void setStretch(bool inValue);
+
+        bool getUniform();
+        void setUniform(bool inValue);
+        
+        float getMix();
+        void setMix(float inValue);
+
+    private:
+        const String _name;
+        size_t _order;
+        Vector<BoneData*> _bones;
+        BoneData* _target;
+        int _bendDirection;
+        bool _compress;
+        bool _stretch;
+        bool _uniform;
+        float _mix;
+    };
+}
+
+#endif /* Spine_IkConstraintData_h */

+ 72 - 0
dependencies/spine/include/spine/IkConstraintTimeline.h

@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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_IkConstraintTimeline_h
+#define Spine_IkConstraintTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+
+    class SP_API IkConstraintTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+        
+        explicit IkConstraintTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time, mix and bend direction of the specified keyframe.
+        void setFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch);
+        
+    private:
+		static const int PREV_TIME;
+		static const int PREV_MIX;
+		static const int PREV_BEND_DIRECTION;
+		static const int PREV_COMPRESS;
+		static const int PREV_STRETCH;
+		static const int MIX;
+		static const int BEND_DIRECTION;
+		static const int COMPRESS;
+		static const int STRETCH;
+
+        Vector<float> _frames;
+        int _ikConstraintIndex;
+    };
+}
+
+#endif /* Spine_IkConstraintTimeline_h */

+ 114 - 0
dependencies/spine/include/spine/Json.h

@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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_Json_h
+#define Spine_Json_h
+
+#include <spine/SpineObject.h>
+
+#ifndef SPINE_JSON_HAVE_PREV
+/* spine doesn't use the "prev" link in the Json sibling lists. */
+#define SPINE_JSON_HAVE_PREV 0
+#endif
+
+namespace spine {
+class SP_API Json : public SpineObject {
+	friend class SkeletonJson;
+
+public:
+	/* Json Types: */
+	static const int JSON_FALSE;
+	static const int JSON_TRUE;
+	static const int JSON_NULL;
+	static const int JSON_NUMBER;
+	static const int JSON_STRING;
+	static const int JSON_ARRAY;
+	static const int JSON_OBJECT;
+
+	/* Get item "string" from object. Case insensitive. */
+	static Json *getItem(Json *object, const char *string);
+
+	static const char *getString(Json *object, const char *name, const char *defaultValue);
+
+	static float getFloat(Json *object, const char *name, float defaultValue);
+
+	static int getInt(Json *object, const char *name, int defaultValue);
+
+	/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */
+	static const char *getError();
+
+	/* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */
+	explicit Json(const char *value);
+
+	~Json();
+
+
+
+private:
+	static const char *_error;
+
+	Json *_next;
+#if SPINE_JSON_HAVE_PREV
+	Json* _prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */
+#endif
+	Json *_child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
+
+	int _type; /* The type of the item, as above. */
+	int _size; /* The number of children. */
+
+	const char *_valueString; /* The item's string, if type==JSON_STRING */
+	int _valueInt; /* The item's number, if type==JSON_NUMBER */
+	float _valueFloat; /* The item's number, if type==JSON_NUMBER */
+
+	const char *_name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
+
+	/* Utility to jump whitespace and cr/lf */
+	static const char *skip(const char *inValue);
+
+	/* Parser core - when encountering text, process appropriately. */
+	static const char *parseValue(Json *item, const char *value);
+
+	/* Parse the input text into an unescaped cstring, and populate item. */
+	static const char *parseString(Json *item, const char *str);
+
+	/* Parse the input text to generate a number, and populate the result into item. */
+	static const char *parseNumber(Json *item, const char *num);
+
+	/* Build an array from input text. */
+	static const char *parseArray(Json *item, const char *value);
+
+	/* Build an object from the text. */
+	static const char *parseObject(Json *item, const char *value);
+
+	static int json_strcasecmp(const char *s1, const char *s2);
+};
+}
+
+#endif /* Spine_Json_h */

+ 56 - 0
dependencies/spine/include/spine/LinkedMesh.h

@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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_LinkedMesh_h
+#define Spine_LinkedMesh_h
+
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class MeshAttachment;
+
+class SP_API LinkedMesh : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+public:
+	LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent);
+
+private:
+	MeshAttachment *_mesh;
+	String _skin;
+	size_t _slotIndex;
+	String _parent;
+};
+}
+
+#endif /* Spine_LinkedMesh_h */

+ 130 - 0
dependencies/spine/include/spine/MathUtil.h

@@ -0,0 +1,130 @@
+/******************************************************************************
+ * 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_MathUtil_h
+#define Spine_MathUtil_h
+
+#include <spine/SpineObject.h>
+
+#include <string.h>
+
+namespace spine {
+
+class SP_API MathUtil : public SpineObject {
+private:
+	MathUtil();
+
+public:
+	static const float Pi;
+	static const float Pi_2;
+	static const float Deg_Rad;
+	static const float Rad_Deg;
+
+	template<typename T>
+	static inline T min(T a, T b) { return a < b ? a : b; }
+
+	template<typename T>
+	static inline T max(T a, T b) { return a > b ? a : b; }
+
+	static float sign(float val);
+
+	static float clamp(float x, float lower, float upper);
+
+	static float abs(float v);
+
+	/// Returns the sine in radians from a lookup table.
+	static float sin(float radians);
+
+	/// Returns the cosine in radians from a lookup table.
+	static float cos(float radians);
+
+	/// Returns the sine in radians from a lookup table.
+	static float sinDeg(float degrees);
+
+	/// Returns the cosine in radians from a lookup table.
+	static float cosDeg(float degrees);
+
+	/// Returns atan2 in radians, faster but less accurate than Math.Atan2. Average error of 0.00231 radians (0.1323
+	/// degrees), largest error of 0.00488 radians (0.2796 degrees).
+	static float atan2(float y, float x);
+
+	static float acos(float v);
+
+	static float sqrt(float v);
+
+	static float fmod(float a, float b);
+
+	static bool isNan(float v);
+
+	static float random();
+
+	static float randomTriangular(float min, float max);
+
+	static float randomTriangular(float min, float max, float mode);
+
+	static float pow(float a, float b);
+};
+
+struct SP_API Interpolation {
+	virtual float apply(float a) = 0;
+
+	virtual float interpolate(float start, float end, float a) {
+		return start + (end - start) * apply(a);
+	}
+
+	virtual ~Interpolation() {};
+};
+
+struct SP_API PowInterpolation: public Interpolation {
+	PowInterpolation(int power): power(power) {
+	}
+
+	float apply(float a) {
+		if (a <= 0.5f) return MathUtil::pow(a * 2.0f, (float)power) / 2.0f;
+		return MathUtil::pow((a - 1.0f) * 2.0f, (float)power) / (power % 2 == 0 ? -2.0f : 2.0f) + 1.0f;
+	}
+
+	int power;
+};
+
+struct SP_API PowOutInterpolation: public Interpolation {
+	PowOutInterpolation(int power): power(power) {
+	}
+
+	float apply(float a) {
+		return MathUtil::pow(a - 1, (float)power) * (power % 2 == 0 ? -1.0f : 1.0f) + 1.0f;
+	}
+
+	int power;
+};
+
+}
+
+#endif /* Spine_MathUtil_h */

+ 142 - 0
dependencies/spine/include/spine/MeshAttachment.h

@@ -0,0 +1,142 @@
+/******************************************************************************
+ * 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_MeshAttachment_h
+#define Spine_MeshAttachment_h
+
+#include <spine/VertexAttachment.h>
+#include <spine/Vector.h>
+#include <spine/Color.h>
+#include <spine/HasRendererObject.h>
+
+namespace spine {
+    /// Attachment that displays a texture region using a mesh.
+    class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        friend class AtlasAttachmentLoader;
+        
+        RTTI_DECL
+        
+    public:
+        explicit MeshAttachment(const String& name);
+
+        virtual ~MeshAttachment();
+
+        void updateUVs();
+
+        virtual bool applyDeform(VertexAttachment* sourceAttachment);
+        
+        int getHullLength();
+        void setHullLength(int inValue);
+        
+        Vector<float>& getRegionUVs();
+        
+        /// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateUVs
+        Vector<float>& getUVs();
+        
+        Vector<unsigned short>& getTriangles();
+        
+        Color& getColor();
+        
+        const String& getPath();
+        void setPath(const String& inValue);
+        
+        float getRegionU();
+        void setRegionU(float inValue);
+        
+        float getRegionV();
+        void setRegionV(float inValue);
+        
+        float getRegionU2();
+        void setRegionU2(float inValue);
+        
+        float getRegionV2();
+        void setRegionV2(float inValue);
+        
+        bool getRegionRotate();
+        void setRegionRotate(bool inValue);
+        
+        float getRegionOffsetX();
+        void setRegionOffsetX(float inValue);
+        
+        // Pixels stripped from the bottom left, unrotated.
+        float getRegionOffsetY();
+        void setRegionOffsetY(float inValue);
+        
+        float getRegionWidth();
+        void setRegionWidth(float inValue);
+        
+        // Unrotated, stripped size.
+        float getRegionHeight();
+        void setRegionHeight(float inValue);
+        
+        float getRegionOriginalWidth();
+        void setRegionOriginalWidth(float inValue);
+        
+        // Unrotated, unstripped size.
+        float getRegionOriginalHeight();
+        void setRegionOriginalHeight(float inValue);
+        
+        bool getInheritDeform();
+        void setInheritDeform(bool inValue);
+        
+        MeshAttachment* getParentMesh();
+        void setParentMesh(MeshAttachment* inValue);
+        
+        // Nonessential.
+        Vector<unsigned short>& getEdges();
+        float getWidth();
+        void setWidth(float inValue);
+        float getHeight();
+        void setHeight(float inValue);
+
+    private:
+        float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
+        MeshAttachment* _parentMesh;
+        Vector<float> _uvs;
+        Vector<float> _regionUVs;
+        Vector<unsigned short> _triangles;
+        Vector<unsigned short> _edges;
+        String _path;
+        float _regionU;
+        float _regionV;
+        float _regionU2;
+        float _regionV2;
+        float _width;
+        float _height;
+        Color _color;
+        int _hullLength;
+        bool _inheritDeform;
+        bool _regionRotate;
+    };
+}
+
+#endif /* Spine_MeshAttachment_h */

+ 46 - 0
dependencies/spine/include/spine/MixBlend.h

@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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_MixPose_h
+#define Spine_MixPose_h
+
+namespace spine {
+///
+/// Controls how a timeline is mixed with the setup or current pose.
+/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection)
+enum MixBlend {
+	MixBlend_Setup = 0,
+	MixBlend_First,
+	MixBlend_Replace,
+	MixBlend_Add
+};
+}
+
+#endif /* Spine_MixPose_h */

+ 44 - 0
dependencies/spine/include/spine/MixDirection.h

@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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_MixDirection_h
+#define Spine_MixDirection_h
+
+namespace spine {
+///
+/// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose).
+/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection)
+enum MixDirection {
+	MixDirection_In = 0,
+	MixDirection_Out
+};
+}
+
+#endif /* Spine_MixDirection_h */

+ 60 - 0
dependencies/spine/include/spine/PathAttachment.h

@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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_PathAttachment_h
+#define Spine_PathAttachment_h
+
+#include <spine/VertexAttachment.h>
+
+namespace spine {
+    class SP_API PathAttachment : public VertexAttachment {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit PathAttachment(const String& name);
+        
+        /// The length in the setup pose from the start of the path to the end of each curve.
+        Vector<float>& getLengths();
+        bool isClosed();
+        void setClosed(bool inValue);
+        bool isConstantSpeed();
+        void setConstantSpeed(bool inValue);
+        
+    private:
+        Vector<float> _lengths;
+        bool _closed;
+        bool _constantSpeed;
+    };
+}
+
+#endif /* Spine_PathAttachment_h */

+ 110 - 0
dependencies/spine/include/spine/PathConstraint.h

@@ -0,0 +1,110 @@
+/******************************************************************************
+ * 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_PathConstraint_h
+#define Spine_PathConstraint_h
+
+#include <spine/Constraint.h>
+
+#include <spine/Vector.h>
+
+namespace spine {
+    class PathConstraintData;
+    class Skeleton;
+    class PathAttachment;
+    class Bone;
+    class Slot;
+    
+    class SP_API PathConstraint : public Constraint {
+        friend class Skeleton;
+        friend class PathConstraintMixTimeline;
+        friend class PathConstraintPositionTimeline;
+        friend class PathConstraintSpacingTimeline;
+        
+        RTTI_DECL
+        
+    public:
+        PathConstraint(PathConstraintData& data, Skeleton& skeleton);
+        
+        /// Applies the constraint to the constrained bones.
+        void apply();
+        
+        virtual void update();
+        
+        virtual int getOrder();
+        
+        float getPosition();
+        void setPosition(float inValue);
+        
+        float getSpacing();
+        void setSpacing(float inValue);
+        
+        float getRotateMix();
+        void setRotateMix(float inValue);
+        
+        float getTranslateMix();
+        void setTranslateMix(float inValue);
+        
+        Vector<Bone*>& getBones();
+        
+        Slot* getTarget();
+        void setTarget(Slot* inValue);
+        
+        PathConstraintData& getData();
+        
+    private:
+        static const float EPSILON;
+        static const int NONE;
+        static const int BEFORE;
+        static const int AFTER;
+        
+        PathConstraintData& _data;
+        Vector<Bone*> _bones;
+        Slot* _target;
+        float _position, _spacing, _rotateMix, _translateMix;
+        
+        Vector<float> _spaces;
+        Vector<float> _positions;
+        Vector<float> _world;
+        Vector<float> _curves;
+        Vector<float> _lengths;
+        Vector<float> _segments;
+        
+        Vector<float>& computeWorldPositions(PathAttachment& path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing);
+        
+        static void addBeforePosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
+        
+        static void addAfterPosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
+        
+        static void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Vector<float>& output, int o, bool tangents);
+    };
+}
+
+#endif /* Spine_PathConstraint_h */

+ 105 - 0
dependencies/spine/include/spine/PathConstraintData.h

@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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_PathConstraintData_h
+#define Spine_PathConstraintData_h
+
+#include <spine/PositionMode.h>
+#include <spine/SpacingMode.h>
+#include <spine/RotateMode.h>
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+    class BoneData;
+    class SlotData;
+    
+    class SP_API PathConstraintData : public SpineObject {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        friend class PathConstraint;
+        friend class Skeleton;
+        friend class PathConstraintMixTimeline;
+        friend class PathConstraintPositionTimeline;
+        friend class PathConstraintSpacingTimeline;
+        
+    public:
+        explicit PathConstraintData(const String& name);
+
+        const String& getName();
+        
+        int getOrder();
+        void setOrder(int inValue);
+        
+        Vector<BoneData*>& getBones();
+        
+        SlotData* getTarget();
+        void setTarget(SlotData* inValue);
+        
+        PositionMode getPositionMode();
+        void setPositionMode(PositionMode inValue);
+        
+        SpacingMode getSpacingMode();
+        void setSpacingMode(SpacingMode inValue);
+        
+        RotateMode getRotateMode();
+        void setRotateMode(RotateMode inValue);
+        
+        float getOffsetRotation();
+        void setOffsetRotation(float inValue);
+        
+        float getPosition();
+        void setPosition(float inValue);
+        
+        float getSpacing();
+        void setSpacing(float inValue);
+        
+        float getRotateMix();
+        void setRotateMix(float inValue);
+        
+        float getTranslateMix();
+        void setTranslateMix(float inValue);
+
+    private:
+        const String _name;
+        int _order;
+        Vector<BoneData*> _bones;
+        SlotData* _target;
+        PositionMode _positionMode;
+        SpacingMode _spacingMode;
+        RotateMode _rotateMode;
+        float _offsetRotation;
+        float _position, _spacing, _rotateMix, _translateMix;
+    };
+}
+
+#endif /* Spine_PathConstraintData_h */

+ 69 - 0
dependencies/spine/include/spine/PathConstraintMixTimeline.h

@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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_PathConstraintMixTimeline_h
+#define Spine_PathConstraintMixTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+#define SP_PATHCONSTRAINTMIXTIMELINE_ENTRIES 5
+
+    class SP_API PathConstraintMixTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+        
+        explicit PathConstraintMixTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+    private:
+		static const int PREV_TIME;
+		static const int PREV_ROTATE;
+		static const int PREV_TRANSLATE;
+		static const int ROTATE;
+		static const int TRANSLATE;
+        
+        Vector<float> _frames;
+        int _pathConstraintIndex;
+        
+        /// Sets the time and mixes of the specified keyframe.
+        void setFrame(int frameIndex, float time, float rotateMix, float translateMix);
+    };
+}
+
+#endif /* Spine_PathConstraintMixTimeline_h */

+ 68 - 0
dependencies/spine/include/spine/PathConstraintPositionTimeline.h

@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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_PathConstraintPositionTimeline_h
+#define Spine_PathConstraintPositionTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+
+    class SP_API PathConstraintPositionTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+        
+        explicit PathConstraintPositionTimeline(int frameCount);
+
+        virtual ~PathConstraintPositionTimeline();
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, float value);
+        
+    protected:
+		static const int PREV_TIME;
+		static const int PREV_VALUE;
+        static const int VALUE;
+        
+        Vector<float> _frames;
+        int _pathConstraintIndex;
+    };
+}
+
+#endif /* Spine_PathConstraintPositionTimeline_h */

+ 52 - 0
dependencies/spine/include/spine/PathConstraintSpacingTimeline.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_PathConstraintSpacingTimeline_h
+#define Spine_PathConstraintSpacingTimeline_h
+
+#include <spine/PathConstraintPositionTimeline.h>
+
+namespace spine {
+    class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit PathConstraintSpacingTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+    };
+}
+
+#endif /* Spine_PathConstraintSpacingTimeline_h */

+ 73 - 0
dependencies/spine/include/spine/PointAttachment.h

@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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_PointAttachment_h
+#define Spine_PointAttachment_h
+
+#include <spine/Attachment.h>
+
+namespace spine {
+    class Bone;
+    
+    /// 
+    /// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
+    /// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
+    /// skin.
+    ///
+    /// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide.
+    /// 
+    class SP_API PointAttachment : public Attachment {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit PointAttachment(const String& name);
+        
+        void computeWorldPosition(Bone& bone, float& ox, float& oy);
+        
+        float computeWorldRotation(Bone& bone);
+        
+        float getX();
+        void setX(float inValue);
+        
+        float getY();
+        void setY(float inValue);
+        
+        float getRotation();
+        void setRotation(float inValue);
+        
+    private:
+        float _x, _y, _rotation;
+    };
+}
+
+#endif /* Spine_PointAttachment_h */

+ 75 - 0
dependencies/spine/include/spine/Pool.h

@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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_Pool_h
+#define Spine_Pool_h
+
+#include <spine/Extension.h>
+#include <spine/Vector.h>
+#include <spine/ContainerUtil.h>
+#include <spine/SpineObject.h>
+
+namespace spine {
+template<typename T>
+class SP_API Pool : public SpineObject {
+public:
+	Pool() {
+	}
+
+	~Pool() {
+		ContainerUtil::cleanUpVectorOfPointers(_objects);
+	}
+
+	T *obtain() {
+		if (_objects.size() > 0) {
+			T **object = &_objects[_objects.size() - 1];
+			T *ret = *object;
+			_objects.removeAt(_objects.size() - 1);
+
+			return ret;
+		} else {
+			T *ret = new(__FILE__, __LINE__)  T();
+
+			return ret;
+		}
+	}
+
+	void free(T *object) {
+		if (!_objects.contains(object)) {
+			_objects.add(object);
+		}
+	}
+
+private:
+	Vector<T *> _objects;
+};
+}
+
+#endif /* Spine_Pool_h */

+ 41 - 0
dependencies/spine/include/spine/PositionMode.h

@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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_PositionMode_h
+#define Spine_PositionMode_h
+
+namespace spine {
+enum PositionMode {
+	PositionMode_Fixed = 0,
+	PositionMode_Percent
+};
+}
+
+#endif /* Spine_PositionMode_h */

+ 76 - 0
dependencies/spine/include/spine/RTTI.h

@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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_RTTI_h
+#define Spine_RTTI_h
+
+#include <spine/SpineObject.h>
+
+#include <string>
+
+namespace spine {
+class SP_API RTTI : public SpineObject {
+public:
+	explicit RTTI(const std::string &className);
+
+	RTTI(const std::string &className, const RTTI &baseRTTI);
+
+	const std::string &getClassName() const;
+
+	bool isExactly(const RTTI &rtti) const;
+
+	bool instanceOf(const RTTI &rtti) const;
+
+private:
+	// Prevent copying
+	RTTI(const RTTI &obj);
+
+	RTTI &operator=(const RTTI &obj);
+
+	const std::string _className;
+	const RTTI *_pBaseRTTI;
+};
+}
+
+#define RTTI_DECL \
+public: \
+static const spine::RTTI rtti; \
+virtual const spine::RTTI& getRTTI() const;
+
+#define RTTI_IMPL_NOPARENT(name) \
+const spine::RTTI name::rtti(#name); \
+const spine::RTTI& name::getRTTI() const { return rtti; }
+
+#define RTTI_IMPL(name, parent) \
+const spine::RTTI name::rtti(#name, parent::rtti); \
+const spine::RTTI& name::getRTTI() const { return rtti; }
+
+#endif /* Spine_RTTI_h */
+

+ 133 - 0
dependencies/spine/include/spine/RegionAttachment.h

@@ -0,0 +1,133 @@
+/******************************************************************************
+ * 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_RegionAttachment_h
+#define Spine_RegionAttachment_h
+
+#include <spine/Attachment.h>
+#include <spine/Vector.h>
+#include <spine/Color.h>
+
+#include <string>
+#include <spine/HasRendererObject.h>
+
+#define NUM_UVS 8
+
+namespace spine {
+    class Bone;
+    
+    /// Attachment that displays a texture region.
+    class SP_API RegionAttachment : public Attachment, public HasRendererObject {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        friend class AtlasAttachmentLoader;
+        
+        RTTI_DECL
+        
+    public:
+        explicit RegionAttachment(const String& name);
+
+        void updateOffset();
+        
+        void setUVs(float u, float v, float u2, float v2, bool rotate);
+        
+        /// Transforms the attachment's four vertices to world coordinates.
+        /// @param bone The parent bone.
+        /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
+        /// @param offset The worldVertices index to begin writing values.
+        /// @param stride The number of worldVertices entries between the value pairs written.
+		void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2);
+        void computeWorldVertices(Bone& bone, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
+        
+        float getX();
+        void setX(float inValue);
+        float getY();
+        void setY(float inValue);
+        float getRotation();
+        void setRotation(float inValue);
+        float getScaleX();
+        void setScaleX(float inValue);
+        float getScaleY();
+        void setScaleY(float inValue);
+        float getWidth();
+        void setWidth(float inValue);
+        float getHeight();
+        void setHeight(float inValue);
+
+        Color& getColor();
+
+        const String& getPath();
+        void setPath(const String& inValue);
+
+        float getRegionOffsetX();
+        void setRegionOffsetX(float inValue);
+
+        float getRegionOffsetY();
+        void setRegionOffsetY(float inValue);
+
+        float getRegionWidth();
+        void setRegionWidth(float inValue);
+
+        float getRegionHeight();
+        void setRegionHeight(float inValue);
+
+        float getRegionOriginalWidth();
+        void setRegionOriginalWidth(float inValue);
+
+        float getRegionOriginalHeight();
+        void setRegionOriginalHeight(float inValue);
+        
+        Vector<float>& getOffset();
+        Vector<float>& getUVs();
+        
+    private:
+        static const int BLX;
+        static const int BLY;
+        static const int ULX;
+        static const int ULY;
+        static const int URX;
+        static const int URY;
+        static const int BRX;
+        static const int BRY;
+        
+        float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
+        float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
+        Vector<float> _vertexOffset;
+        Vector<float> _uvs;
+        String _path;
+        float _regionU;
+        float _regionV;
+        float _regionU2;
+        float _regionV2;
+        Color _color;
+    };
+}
+
+#endif /* Spine_RegionAttachment_h */

+ 42 - 0
dependencies/spine/include/spine/RotateMode.h

@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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_RotateMode_h
+#define Spine_RotateMode_h
+
+namespace spine {
+enum RotateMode {
+	RotateMode_Tangent = 0,
+	RotateMode_Chain,
+	RotateMode_ChainScale
+};
+}
+
+#endif /* Spine_RotateMode_h */

+ 71 - 0
dependencies/spine/include/spine/RotateTimeline.h

@@ -0,0 +1,71 @@
+/******************************************************************************
+ * 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_RotateTimeline_h
+#define Spine_RotateTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+    class SP_API RotateTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        friend class AnimationState;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES = 2;
+
+        explicit RotateTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, float degrees);
+        
+        int getBoneIndex();
+        void setBoneIndex(int inValue);
+        
+        Vector<float>& getFrames();
+        
+    private:
+        static const int PREV_TIME = -2;
+        static const int PREV_ROTATION = -1;
+        static const int ROTATION = 1;
+        
+        int _boneIndex;
+        Vector<float> _frames; // time, angle, ...
+    };
+}
+
+#endif /* Spine_RotateTimeline_h */

+ 52 - 0
dependencies/spine/include/spine/ScaleTimeline.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_ScaleTimeline_h
+#define Spine_ScaleTimeline_h
+
+#include <spine/TranslateTimeline.h>
+
+namespace spine {
+    class SP_API ScaleTimeline : public TranslateTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit ScaleTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+    };
+}
+
+#endif /* Spine_ScaleTimeline_h */

+ 52 - 0
dependencies/spine/include/spine/ShearTimeline.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_ShearTimeline_h
+#define Spine_ShearTimeline_h
+
+#include <spine/TranslateTimeline.h>
+
+namespace spine {
+    class SP_API ShearTimeline : public TranslateTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        explicit ShearTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+    };
+}
+
+#endif /* Spine_ShearTimeline_h */

+ 247 - 0
dependencies/spine/include/spine/Skeleton.h

@@ -0,0 +1,247 @@
+/******************************************************************************
+ * 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_Skeleton_h
+#define Spine_Skeleton_h
+
+#include <spine/Vector.h>
+#include <spine/MathUtil.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/Color.h>
+
+#include <limits> // std::numeric_limits
+
+namespace spine {
+class SkeletonData;
+
+class Bone;
+
+class Updatable;
+
+class Slot;
+
+class IkConstraint;
+
+class PathConstraint;
+
+class TransformConstraint;
+
+class Skin;
+
+class Attachment;
+
+class SP_API Skeleton : public SpineObject {
+	friend class AnimationState;
+
+	friend class SkeletonBounds;
+
+	friend class SkeletonClipping;
+
+	friend class AttachmentTimeline;
+
+	friend class ColorTimeline;
+
+	friend class DeformTimeline;
+
+	friend class DrawOrderTimeline;
+
+	friend class EventTimeline;
+
+	friend class IkConstraintTimeline;
+
+	friend class PathConstraintMixTimeline;
+
+	friend class PathConstraintPositionTimeline;
+
+	friend class PathConstraintSpacingTimeline;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TransformConstraintTimeline;
+
+	friend class TranslateTimeline;
+
+	friend class TwoColorTimeline;
+
+public:
+	explicit Skeleton(SkeletonData *skeletonData);
+
+	~Skeleton();
+
+	/// Caches information about bones and constraints. Must be called if bones, constraints or weighted path attachments are added
+	/// or removed.
+	void updateCache();
+
+	void printUpdateCache();
+
+	/// Updates the world transform for each bone and applies constraints.
+	void updateWorldTransform();
+
+	/// Sets the bones, constraints, and slots to their setup pose values.
+	void setToSetupPose();
+
+	/// Sets the bones and constraints to their setup pose values.
+	void setBonesToSetupPose();
+
+	void setSlotsToSetupPose();
+
+	/// @return May be NULL.
+	Bone *findBone(const String &boneName);
+
+	/// @return -1 if the bone was not found.
+	int findBoneIndex(const String &boneName);
+
+	/// @return May be NULL.
+	Slot *findSlot(const String &slotName);
+
+	/// @return -1 if the bone was not found.
+	int findSlotIndex(const String &slotName);
+
+	/// Sets a skin by name (see setSkin).
+	void setSkin(const String &skinName);
+
+	/// Attachments from the new skin are attached if the corresponding attachment from the old skin was attached.
+	/// If there was no old skin, each slot's setup mode attachment is attached from the new skin.
+	/// After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
+	/// See Skeleton::setSlotsToSetupPose()
+	/// Also, often AnimationState::apply(Skeleton&) is called before the next time the
+	/// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
+	///
+	/// @param newSkin May be NULL.
+	void setSkin(Skin *newSkin);
+
+	/// @return May be NULL.
+	Attachment *getAttachment(const String &slotName, const String &attachmentName);
+
+	/// @return May be NULL.
+	Attachment *getAttachment(int slotIndex, const String &attachmentName);
+
+	/// @param attachmentName May be empty.
+	void setAttachment(const String &slotName, const String &attachmentName);
+
+	/// @return May be NULL.
+	IkConstraint *findIkConstraint(const String &constraintName);
+
+	/// @return May be NULL.
+	TransformConstraint *findTransformConstraint(const String &constraintName);
+
+	/// @return May be NULL.
+	PathConstraint *findPathConstraint(const String &constraintName);
+
+	void update(float delta);
+
+	/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
+	/// @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
+	/// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
+	/// @param outWidth The width of the AABB
+	/// @param outHeight The height of the AABB.
+	/// @param outVertexBuffer Reference to hold a Vector of floats. This method will assign it with new floats as needed.
+	void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector<float> &outVertexBuffer);
+
+	Bone *getRootBone();
+
+	SkeletonData *getData();
+
+	Vector<Bone *> &getBones();
+
+	Vector<Updatable *> &getUpdateCacheList();
+
+	Vector<Slot *> &getSlots();
+
+	Vector<Slot *> &getDrawOrder();
+
+	Vector<IkConstraint *> &getIkConstraints();
+
+	Vector<PathConstraint *> &getPathConstraints();
+
+	Vector<TransformConstraint *> &getTransformConstraints();
+
+	Skin *getSkin();
+
+	Color &getColor();
+
+	float getTime();
+
+	void setTime(float inValue);
+
+	void setPosition(float x, float y);
+
+	float getX();
+
+	void setX(float inValue);
+
+	float getY();
+
+	void setY(float inValue);
+
+	float getScaleX();
+
+	void setScaleX(float inValue);
+
+	float getScaleY();
+
+	void setScaleY(float inValue);
+
+private:
+	SkeletonData *_data;
+	Vector<Bone *> _bones;
+	Vector<Slot *> _slots;
+	Vector<Slot *> _drawOrder;
+	Vector<IkConstraint *> _ikConstraints;
+	Vector<TransformConstraint *> _transformConstraints;
+	Vector<PathConstraint *> _pathConstraints;
+	Vector<Updatable *> _updateCache;
+	Vector<Bone *> _updateCacheReset;
+	Skin *_skin;
+	Color _color;
+	float _time;
+	float _scaleX, _scaleY;
+	float _x, _y;
+
+	void sortIkConstraint(IkConstraint *constraint);
+
+	void sortPathConstraint(PathConstraint *constraint);
+
+	void sortTransformConstraint(TransformConstraint *constraint);
+
+	void sortPathConstraintAttachment(Skin *skin, size_t slotIndex, Bone &slotBone);
+
+	void sortPathConstraintAttachment(Attachment *attachment, Bone &slotBone);
+
+	void sortBone(Bone *bone);
+
+	static void sortReset(Vector<Bone *> &bones);
+};
+}
+
+#endif /* Spine_Skeleton_h */

+ 130 - 0
dependencies/spine/include/spine/SkeletonBinary.h

@@ -0,0 +1,130 @@
+/******************************************************************************
+ * 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_SkeletonBinary_h
+#define Spine_SkeletonBinary_h
+
+#include <spine/TransformMode.h>
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/Color.h>
+
+namespace spine {
+    class SkeletonData;
+    class Atlas;
+    class AttachmentLoader;
+    class LinkedMesh;
+    class Skin;
+    class Attachment;
+    class VertexAttachment;
+    class Animation;
+    class CurveTimeline;
+    
+    class SP_API SkeletonBinary : public SpineObject {
+    public:
+        static const int BONE_ROTATE;
+        static const int BONE_TRANSLATE;
+        static const int BONE_SCALE;
+        static const int BONE_SHEAR;
+        
+        static const int SLOT_ATTACHMENT;
+        static const int SLOT_COLOR;
+        static const int SLOT_TWO_COLOR;
+        
+        static const int PATH_POSITION;
+        static const int PATH_SPACING;
+        static const int PATH_MIX;
+        
+        static const int CURVE_LINEAR;
+        static const int CURVE_STEPPED;
+        static const int CURVE_BEZIER;
+
+        explicit SkeletonBinary(Atlas* atlasArray);
+
+        explicit SkeletonBinary(AttachmentLoader* attachmentLoader);
+        
+        ~SkeletonBinary();
+        
+        SkeletonData* readSkeletonData(const unsigned char* binary, int length);
+        
+        SkeletonData* readSkeletonDataFile(const String& path);
+
+        void setScale(float scale) { _scale = scale; }
+
+        String& getError() { return _error; }
+        
+    private:
+        struct DataInput : public SpineObject {
+            const unsigned char* cursor;
+            const unsigned char* end;
+        };
+        
+        AttachmentLoader* _attachmentLoader;
+        Vector<LinkedMesh*> _linkedMeshes;
+        String _error;
+        float _scale;
+        const bool _ownsLoader;
+        
+        void setError(const char* value1, const char* value2);
+        
+        char* readString(DataInput* input);
+        
+        float readFloat(DataInput* input);
+        
+        unsigned char readByte(DataInput* input);
+        
+        signed char readSByte(DataInput* input);
+        
+        bool readBoolean(DataInput* input);
+        
+        int readInt(DataInput* input);
+        
+        void readColor(DataInput* input, Color& color);
+        
+        int readVarint(DataInput* input, bool optimizePositive);
+        
+        Skin* readSkin(DataInput* input, const String& skinName, SkeletonData* skeletonData, bool nonessential);
+        
+        Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const String& attachmentName, SkeletonData* skeletonData, bool nonessential);
+        
+        void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount);
+        
+        void readFloatArray(DataInput *input, int n, float scale, Vector<float>& array);
+        
+        void readShortArray(DataInput *input, Vector<unsigned short>& array);
+        
+        Animation* readAnimation(const String& name, DataInput* input, SkeletonData *skeletonData);
+        
+        void readCurve(DataInput* input, int frameIndex, CurveTimeline* timeline);
+    };
+}
+
+#endif /* Spine_SkeletonBinary_h */

+ 108 - 0
dependencies/spine/include/spine/SkeletonBounds.h

@@ -0,0 +1,108 @@
+/******************************************************************************
+ * 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_SkeletonBounds_h
+#define Spine_SkeletonBounds_h
+
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+
+namespace spine {
+    class Skeleton;
+    class BoundingBoxAttachment;
+    class 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.
+    ///
+    class SP_API SkeletonBounds : public SpineObject {
+    public:
+        SkeletonBounds();
+        
+        ///
+        /// Clears any previous polygons, finds all visible bounding box attachments,
+        /// and computes the world vertices for each bounding box's polygon.
+        /// @param skeleton The skeleton.
+        /// @param updateAabb
+        /// If true, the axis aligned bounding box containing all the polygons is computed.
+        /// If false, the SkeletonBounds AABB methods will always return true.
+        ///
+        void update(Skeleton& skeleton, bool updateAabb);
+        
+        /// Returns true if the axis aligned bounding box contains the point.
+        bool aabbcontainsPoint(float x, float y);
+        
+        /// Returns true if the axis aligned bounding box intersects the line segment.
+        bool aabbintersectsSegment(float x1, float y1, float x2, float y2);
+        
+        /// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
+        bool aabbIntersectsSkeleton(SkeletonBounds bounds);
+        
+        /// Returns true if the polygon contains the point.
+        bool containsPoint(Polygon* polygon, float x, float y);
+        
+        /// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more
+        /// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true.
+        BoundingBoxAttachment* containsPoint(float x, float y);
+        
+        /// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually
+        /// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true.
+        BoundingBoxAttachment* intersectsSegment(float x1, float y1, float x2, float y2);
+        
+        /// Returns true if the polygon contains the line segment.
+        bool intersectsSegment(Polygon* polygon, float x1, float y1, float x2, float y2);
+        
+        Polygon* getPolygon(BoundingBoxAttachment* attachment);
+
+        float getWidth();
+        float getHeight();
+
+    private:
+        Vector<Polygon*> _polygonPool;
+        Vector<BoundingBoxAttachment*> _boundingBoxes;
+        Vector<Polygon*> _polygons;
+        float _minX, _minY, _maxX, _maxY;
+        
+        void aabbCompute();
+    };
+    
+    class Polygon : public SpineObject {
+    public:
+        Vector<float> _vertices;
+        int _count;
+        
+        Polygon() : _count(0) {
+			_vertices.ensureCapacity(16);
+        }
+    };
+}
+
+#endif /* Spine_SkeletonBounds_h */

+ 80 - 0
dependencies/spine/include/spine/SkeletonClipping.h

@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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_SkeletonClipping_h
+#define Spine_SkeletonClipping_h
+
+#include <spine/Vector.h>
+#include <spine/Triangulator.h>
+
+namespace spine {
+    class Slot;
+    class ClippingAttachment;
+    
+    class SP_API SkeletonClipping : public SpineObject {
+    public:
+        SkeletonClipping();
+
+        size_t clipStart(Slot& slot, ClippingAttachment* clip);
+        
+        void clipEnd(Slot& slot);
+        
+        void clipEnd();
+		
+		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();
+        
+        Vector<float>& getClippedVertices();
+        Vector<unsigned short>& getClippedTriangles();
+        Vector<float>& getClippedUVs();
+        
+    private:
+        Triangulator _triangulator;
+        Vector<float> _clippingPolygon;
+        Vector<float> _clipOutput;
+        Vector<float> _clippedVertices;
+        Vector<unsigned short> _clippedTriangles;
+        Vector<float> _clippedUVs;
+        Vector<float> _scratch;
+        ClippingAttachment* _clipAttachment;
+        Vector< Vector<float>* > *_clippingPolygons;
+        
+        /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
+                  * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
+        bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector<float>* clippingArea, Vector<float>* output);
+        
+        static void makeClockwise(Vector<float>& polygon);
+    };
+}
+
+#endif /* Spine_SkeletonClipping_h */

+ 179 - 0
dependencies/spine/include/spine/SkeletonData.h

@@ -0,0 +1,179 @@
+/******************************************************************************
+ * 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_SkeletonData_h
+#define Spine_SkeletonData_h
+
+#include <spine/Vector.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class BoneData;
+
+class SlotData;
+
+class Skin;
+
+class EventData;
+
+class Animation;
+
+class IkConstraintData;
+
+class TransformConstraintData;
+
+class PathConstraintData;
+
+/// Stores the setup pose and all of the stateless data for a skeleton.
+class SP_API SkeletonData : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+	friend class Skeleton;
+
+public:
+	SkeletonData();
+
+	~SkeletonData();
+
+	/// Finds a bone by comparing each bone's name.
+	/// It is more efficient to cache the results of this method than to call it multiple times.
+	/// @return May be NULL.
+	BoneData *findBone(const String &boneName);
+
+	/// @return -1 if the bone was not found.
+	int findBoneIndex(const String &boneName);
+
+	/// @return May be NULL.
+	SlotData *findSlot(const String &slotName);
+
+	/// @return -1 if the slot was not found.
+	int findSlotIndex(const String &slotName);
+
+	/// @return May be NULL.
+	Skin *findSkin(const String &skinName);
+
+	/// @return May be NULL.
+	spine::EventData *findEvent(const String &eventDataName);
+
+	/// @return May be NULL.
+	Animation *findAnimation(const String &animationName);
+
+	/// @return May be NULL.
+	IkConstraintData *findIkConstraint(const String &constraintName);
+
+	/// @return May be NULL.
+	TransformConstraintData *findTransformConstraint(const String &constraintName);
+
+	/// @return May be NULL.
+	PathConstraintData *findPathConstraint(const String &constraintName);
+
+	/// @return -1 if the path constraint was not found.
+	int findPathConstraintIndex(const String &pathConstraintName);
+
+	const String &getName();
+
+	void setName(const String &inValue);
+
+	/// The skeleton's bones, sorted parent first. The root bone is always the first bone.
+	Vector<BoneData *> &getBones();
+
+	Vector<SlotData *> &getSlots();
+
+	/// All skins, including the default skin.
+	Vector<Skin *> &getSkins();
+
+	/// The skeleton's default skin.
+	/// By default this skin contains all attachments that were not in a skin in Spine.
+	///
+	/// @return May be NULL.
+	Skin *getDefaultSkin();
+
+	void setDefaultSkin(Skin *inValue);
+
+	Vector<spine::EventData *> &getEvents();
+
+	Vector<Animation *> &getAnimations();
+
+	Vector<IkConstraintData *> &getIkConstraints();
+
+	Vector<TransformConstraintData *> &getTransformConstraints();
+
+	Vector<PathConstraintData *> &getPathConstraints();
+
+	float getWidth();
+
+	void setWidth(float inValue);
+
+	float getHeight();
+
+	void setHeight(float inValue);
+
+	/// The Spine version used to export this data, or NULL.
+	const String &getVersion();
+
+	void setVersion(const String &inValue);
+
+	const String &getHash();
+
+	void setHash(const String &inValue);
+
+	const String &getImagesPath();
+
+	void setImagesPath(const String &inValue);
+
+	/// The dopesheet FPS in Spine. Available only when nonessential data was exported.
+	float getFps();
+
+	void setFps(float inValue);
+
+private:
+	String _name;
+	Vector<BoneData *> _bones; // Ordered parents first
+	Vector<SlotData *> _slots; // Setup pose draw order.
+	Vector<Skin *> _skins;
+	Skin *_defaultSkin;
+	Vector<EventData *> _events;
+	Vector<Animation *> _animations;
+	Vector<IkConstraintData *> _ikConstraints;
+	Vector<TransformConstraintData *> _transformConstraints;
+	Vector<PathConstraintData *> _pathConstraints;
+	float _width, _height;
+	String _version;
+	String _hash;
+
+	// Nonessential.
+	float _fps;
+	String _imagesPath;
+};
+}
+
+#endif /* Spine_SkeletonData_h */

+ 92 - 0
dependencies/spine/include/spine/SkeletonJson.h

@@ -0,0 +1,92 @@
+/******************************************************************************
+ * 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_SkeletonJson_h
+#define Spine_SkeletonJson_h
+
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class CurveTimeline;
+
+class VertexAttachment;
+
+class Animation;
+
+class Json;
+
+class SkeletonData;
+
+class Atlas;
+
+class AttachmentLoader;
+
+class LinkedMesh;
+
+class String;
+
+class SP_API SkeletonJson : public SpineObject {
+public:
+	explicit SkeletonJson(Atlas *atlas);
+
+	explicit SkeletonJson(AttachmentLoader *attachmentLoader);
+
+	~SkeletonJson();
+
+	SkeletonData *readSkeletonDataFile(const String &path);
+
+	SkeletonData *readSkeletonData(const char *json);
+
+	void setScale(float scale) { _scale = scale; }
+
+	String &getError() { return _error; }
+
+private:
+	AttachmentLoader *_attachmentLoader;
+	Vector<LinkedMesh *> _linkedMeshes;
+	float _scale;
+	const bool _ownsLoader;
+	String _error;
+
+	static float toColor(const char *value, size_t index);
+
+	static void readCurve(Json *frame, CurveTimeline *timeline, size_t frameIndex);
+
+	Animation *readAnimation(Json *root, SkeletonData *skeletonData);
+
+	void readVertices(Json *attachmentMap, VertexAttachment *attachment, size_t verticesLength);
+
+	void setError(Json *root, const String &value1, const String &value2);
+};
+}
+
+#endif /* Spine_SkeletonJson_h */

+ 149 - 0
dependencies/spine/include/spine/Skin.h

@@ -0,0 +1,149 @@
+/******************************************************************************
+ * 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_Skin_h
+#define Spine_Skin_h
+
+#include <spine/Vector.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+class Attachment;
+
+class Skeleton;
+
+/// Stores attachments by slot index and attachment name.
+/// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and
+/// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide.
+class SP_API Skin : public SpineObject {
+	friend class Skeleton;
+
+public:
+	class SP_API AttachmentMap : public SpineObject {
+		friend class Skin;
+
+	public:
+		struct SP_API Entry {
+			size_t _slotIndex;
+			String _name;
+			Attachment *_attachment;
+
+			Entry(size_t slotIndex, const String &name, Attachment *attachment) :
+					_slotIndex(slotIndex),
+					_name(name),
+					_attachment(attachment) {
+			}
+		};
+
+		class SP_API Entries {
+			friend class AttachmentMap;
+
+		public:
+			bool hasNext() {
+				while(true) {
+					if (_slotIndex >= _buckets.size()) return false;
+					if (_bucketIndex >= _buckets[_slotIndex].size()) {
+						_bucketIndex = 0;
+						++_slotIndex;
+						continue;
+					};
+					return true;
+				}
+			}
+
+			Entry &next() {
+				Entry &result = _buckets[_slotIndex][_bucketIndex];
+				++_bucketIndex;
+				return result;
+			}
+
+		protected:
+			Entries(Vector< Vector<Entry> > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) {
+			}
+
+		private:
+			Vector< Vector<Entry> > &_buckets;
+			size_t _slotIndex;
+			size_t _bucketIndex;
+		};
+
+		void put(size_t slotIndex, const String &attachmentName, Attachment *attachment);
+
+		Attachment *get(size_t slotIndex, const String &attachmentName);
+
+		void remove(size_t slotIndex, const String &attachmentName);
+
+		Entries getEntries();
+
+	protected:
+		AttachmentMap();
+
+	private:
+
+		int findInBucket(Vector <Entry> &, const String &attachmentName);
+
+		Vector <Vector<Entry> > _buckets;
+	};
+
+	explicit Skin(const String &name);
+
+	~Skin();
+
+	/// Adds an attachment to the skin for the specified slot index and name.
+	/// If the name already exists for the slot, the previous value is replaced.
+	void addAttachment(size_t slotIndex, const String &name, Attachment *attachment);
+
+	/// Returns the attachment for the specified slot index and name, or NULL.
+	Attachment *getAttachment(size_t slotIndex, const String &name);
+
+	/// Finds the skin keys for a given slot. The results are added to the passed array of names.
+	/// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex
+	/// @param names Found skin key names will be added to this array.
+	void findNamesForSlot(size_t slotIndex, Vector <String> &names);
+
+	/// Finds the attachments for a given slot. The results are added to the passed array of Attachments.
+	/// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex
+	/// @param attachments Found Attachments will be added to this array.
+	void findAttachmentsForSlot(size_t slotIndex, Vector<Attachment *> &attachments);
+
+	const String &getName();
+
+	AttachmentMap::Entries getAttachments();
+
+private:
+	const String _name;
+	AttachmentMap _attachments;
+
+	/// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached.
+	void attachAll(Skeleton &skeleton, Skin &oldSkin);
+};
+}
+
+#endif /* Spine_Skin_h */

+ 127 - 0
dependencies/spine/include/spine/Slot.h

@@ -0,0 +1,127 @@
+/******************************************************************************
+ * 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_Slot_h
+#define Spine_Slot_h
+
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/Color.h>
+
+#include <string>
+
+namespace spine {
+class SlotData;
+
+class Bone;
+
+class Skeleton;
+
+class Attachment;
+
+class SP_API Slot : public SpineObject {
+	friend class VertexAttachment;
+
+	friend class Skeleton;
+
+	friend class SkeletonBounds;
+
+	friend class SkeletonClipping;
+
+	friend class AttachmentTimeline;
+
+	friend class ColorTimeline;
+
+	friend class DeformTimeline;
+
+	friend class DrawOrderTimeline;
+
+	friend class EventTimeline;
+
+	friend class IkConstraintTimeline;
+
+	friend class PathConstraintMixTimeline;
+
+	friend class PathConstraintPositionTimeline;
+
+	friend class PathConstraintSpacingTimeline;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TransformConstraintTimeline;
+
+	friend class TranslateTimeline;
+
+	friend class TwoColorTimeline;
+
+public:
+	Slot(SlotData &data, Bone &bone);
+
+	void setToSetupPose();
+
+	SlotData &getData();
+
+	Bone &getBone();
+
+	Skeleton &getSkeleton();
+
+	Color &getColor();
+
+	Color &getDarkColor();
+
+	bool hasDarkColor();
+
+	/// May be NULL.
+	Attachment *getAttachment();
+
+	void setAttachment(Attachment *inValue);
+
+	float getAttachmentTime();
+
+	void setAttachmentTime(float inValue);
+
+	Vector<float> &getAttachmentVertices();
+
+private:
+	SlotData &_data;
+	Bone &_bone;
+	Skeleton &_skeleton;
+	Color _color;
+	Color _darkColor;
+	bool _hasDarkColor;
+	Attachment *_attachment;
+	float _attachmentTime;
+	Vector<float> _attachmentVertices;
+};
+}
+
+#endif /* Spine_Slot_h */

+ 114 - 0
dependencies/spine/include/spine/SlotData.h

@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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_SlotData_h
+#define Spine_SlotData_h
+
+#include <spine/BlendMode.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/Color.h>
+
+namespace spine {
+class BoneData;
+
+class SP_API SlotData : public SpineObject {
+	friend class SkeletonBinary;
+
+	friend class SkeletonJson;
+
+	friend class AttachmentTimeline;
+
+	friend class ColorTimeline;
+
+	friend class DeformTimeline;
+
+	friend class DrawOrderTimeline;
+
+	friend class EventTimeline;
+
+	friend class IkConstraintTimeline;
+
+	friend class PathConstraintMixTimeline;
+
+	friend class PathConstraintPositionTimeline;
+
+	friend class PathConstraintSpacingTimeline;
+
+	friend class ScaleTimeline;
+
+	friend class ShearTimeline;
+
+	friend class TransformConstraintTimeline;
+
+	friend class TranslateTimeline;
+
+	friend class TwoColorTimeline;
+
+public:
+	SlotData(int index, const String &name, BoneData &boneData);
+
+	int getIndex();
+
+	const String &getName();
+
+	BoneData &getBoneData();
+
+	Color &getColor();
+
+	Color &getDarkColor();
+
+	bool hasDarkColor();
+
+	void setHasDarkColor(bool inValue);
+
+	/// May be empty.
+	const String &getAttachmentName();
+
+	void setAttachmentName(const String &inValue);
+
+	BlendMode getBlendMode();
+
+	void setBlendMode(BlendMode inValue);
+
+private:
+	const int _index;
+	String _name;
+	BoneData &_boneData;
+	Color _color;
+	Color _darkColor;
+
+	bool _hasDarkColor;
+	String _attachmentName;
+	BlendMode _blendMode;
+};
+}
+
+#endif /* Spine_SlotData_h */

+ 42 - 0
dependencies/spine/include/spine/SpacingMode.h

@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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_SpacingMode_h
+#define Spine_SpacingMode_h
+
+namespace spine {
+enum SpacingMode {
+	SpacingMode_Length = 0,
+	SpacingMode_Fixed,
+	SpacingMode_Percent
+};
+}
+
+#endif /* Spine_SpacingMode_h */

+ 60 - 0
dependencies/spine/include/spine/SpineObject.h

@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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_Object_h
+#define Spine_Object_h
+
+#include <new>
+#include <stddef.h>
+
+#include <spine/dll.h>
+
+namespace spine {
+class String;
+
+class SP_API SpineObject {
+public:
+	void *operator new(size_t sz);
+
+	void *operator new(size_t sz, const char *file, int line);
+
+	void *operator new(size_t sz, void *ptr);
+
+	void operator delete(void *p, const char *file, int line);
+
+	void operator delete(void *p, void *mem);
+
+	void operator delete(void *p);
+
+	virtual ~SpineObject();
+};
+}
+
+#endif

+ 213 - 0
dependencies/spine/include/spine/SpineString.h

@@ -0,0 +1,213 @@
+/******************************************************************************
+ * 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_STRING_H
+#define SPINE_STRING_H
+
+#include <spine/SpineObject.h>
+#include <spine/Extension.h>
+
+#include <string.h>
+#include <stdio.h>
+
+// Required for sprintf on MSVC
+#ifdef _MSC_VER
+#pragma warning(disable:4996)
+#endif
+
+namespace spine {
+class SP_API String : public SpineObject {
+public:
+	String() : _length(0), _buffer(NULL) {
+	}
+
+	String(const char *chars, bool own = false) {
+		if (!chars) {
+			_length = 0;
+			_buffer = NULL;
+		} else {
+			_length = strlen(chars);
+			if (!own) {
+				_buffer = SpineExtension::calloc<char>(_length + 1, __FILE__, __LINE__);
+				memcpy((void *) _buffer, chars, _length + 1);
+			} else {
+				_buffer = (char *) chars;
+			}
+		}
+	}
+
+	String(const String &other) {
+		if (!other._buffer) {
+			_length = 0;
+			_buffer = NULL;
+		} else {
+			_length = other._length;
+			_buffer = SpineExtension::calloc<char>(other._length + 1, __FILE__, __LINE__);
+			memcpy((void *) _buffer, other._buffer, other._length + 1);
+		}
+	}
+
+	size_t length() const {
+		return _length;
+	}
+
+	bool isEmpty() const {
+		return _length == 0;
+	}
+
+	const char *buffer() const {
+		return _buffer;
+	}
+
+	void own(const String &other) {
+		if (this == &other) return;
+		if (_buffer) {
+			SpineExtension::free(_buffer, __FILE__, __LINE__);
+		}
+		_length = other._length;
+		_buffer = other._buffer;
+		other._length = 0;
+		other._buffer = NULL;
+	}
+
+	void own(const char *chars) {
+		if (_buffer == chars) return;
+		if (_buffer) {
+			SpineExtension::free(_buffer, __FILE__, __LINE__);
+		}
+
+		if (!chars) {
+			_length = 0;
+			_buffer = NULL;
+		} else {
+			_length = strlen(chars);
+			_buffer = (char *) chars;
+		}
+	}
+
+	void unown() {
+		_length = 0;
+		_buffer = NULL;
+	}
+
+	String &operator=(const String &other) {
+		if (this == &other) return *this;
+		if (_buffer) {
+			SpineExtension::free(_buffer, __FILE__, __LINE__);
+		}
+		if (!other._buffer) {
+			_length = 0;
+			_buffer = NULL;
+		} else {
+			_length = other._length;
+			_buffer = SpineExtension::calloc<char>(other._length + 1, __FILE__, __LINE__);
+			memcpy((void *) _buffer, other._buffer, other._length + 1);
+		}
+		return *this;
+	}
+
+	String &operator=(const char *chars) {
+		if (_buffer == chars) return *this;
+		if (_buffer) {
+			SpineExtension::free(_buffer, __FILE__, __LINE__);
+		}
+		if (!chars) {
+			_length = 0;
+			_buffer = NULL;
+		} else {
+			_length = strlen(chars);
+			_buffer = SpineExtension::calloc<char>(_length + 1, __FILE__, __LINE__);
+			memcpy((void *) _buffer, chars, _length + 1);
+		}
+		return *this;
+	}
+
+	String &append(const char *chars) {
+		size_t len = strlen(chars);
+		size_t thisLen = _length;
+		_length = _length + len;
+		bool same = chars == _buffer;
+		_buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__);
+		memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : chars), len + 1);
+		return *this;
+	}
+
+	String &append(const String &other) {
+		size_t len = other.length();
+		size_t thisLen = _length;
+		_length = _length + len;
+		bool same = other._buffer == _buffer;
+		_buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__);
+		memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : other._buffer), len + 1);
+		return *this;
+	}
+
+	String &append(int other) {
+		char str[100];
+		sprintf(str, "%i", other);
+		append(str);
+		return *this;
+	}
+
+	String &append(float other) {
+		char str[100];
+		sprintf(str, "%f", other);
+		append(str);
+		return *this;
+	}
+
+	friend bool operator==(const String &a, const String &b) {
+		if (a._buffer == b._buffer) return true;
+		if (a._length != b._length) return false;
+		if (a._buffer && b._buffer) {
+			return strcmp(a._buffer, b._buffer) == 0;
+		} else {
+			return false;
+		}
+	}
+
+	friend bool operator!=(const String &a, const String &b) {
+		return !(a == b);
+	}
+
+	~String() {
+		if (_buffer) {
+			SpineExtension::free(_buffer, __FILE__, __LINE__);
+		}
+	}
+
+private:
+	mutable size_t _length;
+	mutable char *_buffer;
+};
+}
+
+
+#endif //SPINE_STRING_H

+ 52 - 0
dependencies/spine/include/spine/TextureLoader.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_TextureLoader_h
+#define Spine_TextureLoader_h
+
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+    class AtlasPage;
+    
+    class SP_API TextureLoader : public SpineObject {
+    public:
+        TextureLoader();
+        
+        virtual ~TextureLoader();
+        
+        virtual void load(AtlasPage& page, const String& path) = 0;
+        
+        virtual void unload(void* texture) = 0;
+    };
+}
+
+#endif /* Spine_TextureLoader_h */

+ 72 - 0
dependencies/spine/include/spine/Timeline.h

@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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_Timeline_h
+#define Spine_Timeline_h
+
+#include <spine/RTTI.h>
+#include <spine/Vector.h>
+#include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
+#include <spine/SpineObject.h>
+
+namespace spine {
+class Skeleton;
+
+class Event;
+
+class SP_API Timeline : public SpineObject {
+RTTI_DECL
+
+public:
+	Timeline();
+
+	virtual ~Timeline();
+
+	/// Sets the value(s) for the specified time.
+	/// @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
+	/// @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
+	/// @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
+	/// @param pEvents If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
+	/// @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline
+	///     value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting
+	///     alpha over time, an animation can be mixed in or out. alpha can also be useful to
+	///      apply animations on top of each other (layered).
+	/// @param blend Controls how mixing is applied when alpha is than 1.
+	/// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
+	virtual void
+	apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
+		  MixDirection direction) = 0;
+
+	virtual int getPropertyId() = 0;
+};
+}
+
+#endif /* Spine_Timeline_h */

+ 54 - 0
dependencies/spine/include/spine/TimelineType.h

@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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_TimelineType_h
+#define Spine_TimelineType_h
+
+namespace spine {
+enum TimelineType {
+	TimelineType_Rotate = 0,
+	TimelineType_Translate,
+	TimelineType_Scale,
+	TimelineType_Shear,
+	TimelineType_Attachment,
+	TimelineType_Color,
+	TimelineType_Deform,
+	TimelineType_Event,
+	TimelineType_DrawOrder,
+	TimelineType_IkConstraint,
+	TimelineType_TransformConstraint,
+	TimelineType_PathConstraintPosition,
+	TimelineType_PathConstraintSpacing,
+	TimelineType_PathConstraintMix,
+	TimelineType_TwoColor
+};
+}
+
+#endif /* Spine_TimelineType_h */

+ 93 - 0
dependencies/spine/include/spine/TransformConstraint.h

@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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_TransformConstraint_h
+#define Spine_TransformConstraint_h
+
+#include <spine/Constraint.h>
+
+#include <spine/Vector.h>
+
+namespace spine {
+    class TransformConstraintData;
+    class Skeleton;
+    class Bone;
+    
+    class SP_API TransformConstraint : public Constraint {
+        friend class Skeleton;
+        friend class TransformConstraintTimeline;
+        
+        RTTI_DECL
+        
+    public:
+        TransformConstraint(TransformConstraintData& data, Skeleton& skeleton);
+        
+        void apply();
+        
+        virtual void update();
+        
+        virtual int getOrder();
+        
+        TransformConstraintData& getData();
+        
+        Vector<Bone*>& getBones();
+        
+        Bone* getTarget();
+        void setTarget(Bone* inValue);
+        
+        float getRotateMix();
+        void setRotateMix(float inValue);
+        
+        float getTranslateMix();
+        void setTranslateMix(float inValue);
+        
+        float getScaleMix();
+        void setScaleMix(float inValue);
+        
+        float getShearMix();
+        void setShearMix(float inValue);
+        
+    private:
+        TransformConstraintData& _data;
+        Vector<Bone*> _bones;
+        Bone* _target;
+        float _rotateMix, _translateMix, _scaleMix, _shearMix;
+        
+        void applyAbsoluteWorld();
+        
+        void applyRelativeWorld();
+        
+        void applyAbsoluteLocal();
+        
+        void applyRelativeLocal();
+    };
+}
+
+#endif /* Spine_TransformConstraint_h */

+ 82 - 0
dependencies/spine/include/spine/TransformConstraintData.h

@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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_TransformConstraintData_h
+#define Spine_TransformConstraintData_h
+
+#include <spine/Vector.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+
+namespace spine {
+    class BoneData;
+    
+    class SP_API TransformConstraintData : public SpineObject {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        friend class TransformConstraint;
+        friend class Skeleton;
+        friend class TransformConstraintTimeline;
+        
+    public:
+        explicit TransformConstraintData(const String& name);
+
+        const String& getName();
+        int getOrder();
+        Vector<BoneData*>& getBones();
+        BoneData* getTarget();
+        float getRotateMix();
+        float getTranslateMix();
+        float getScaleMix();
+        float getShearMix();
+        
+        float getOffsetRotation();
+        float getOffsetX();
+        float getOffsetY();
+        float getOffsetScaleX();
+        float getOffsetScaleY();
+        float getOffsetShearY();
+        
+        bool isRelative();
+        bool isLocal();
+        
+    private:
+        const String _name;
+        int _order;
+        Vector<BoneData*> _bones;
+        BoneData* _target;
+        float _rotateMix, _translateMix, _scaleMix, _shearMix;
+        float _offsetRotation, _offsetX, _offsetY, _offsetScaleX, _offsetScaleY, _offsetShearY;
+        bool _relative, _local;
+    };
+}
+
+#endif /* Spine_TransformConstraintData_h */

+ 71 - 0
dependencies/spine/include/spine/TransformConstraintTimeline.h

@@ -0,0 +1,71 @@
+/******************************************************************************
+ * 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_TransformConstraintTimeline_h
+#define Spine_TransformConstraintTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+
+    class SP_API TransformConstraintTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+
+        explicit TransformConstraintTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
+        
+    private:
+		static const int PREV_TIME;
+		static const int PREV_ROTATE;
+		static const int PREV_TRANSLATE;
+		static const int PREV_SCALE;
+		static const int PREV_SHEAR;
+		static const int ROTATE;
+		static const int TRANSLATE;
+		static const int SCALE;
+		static const int SHEAR;
+        
+        Vector<float> _frames;
+        int _transformConstraintIndex;
+    };
+}
+
+#endif /* Spine_TransformConstraintTimeline_h */

+ 45 - 0
dependencies/spine/include/spine/TransformMode.h

@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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_TransformMode_h
+#define Spine_TransformMode_h
+
+namespace spine {
+    enum TransformMode {
+        TransformMode_Normal = 0,
+        TransformMode_OnlyTranslation,
+        TransformMode_NoRotationOrReflection,
+        TransformMode_NoScale,
+        TransformMode_NoScaleOrReflection
+    };
+}
+
+#endif /* Spine_TransformMode_h */
+

+ 73 - 0
dependencies/spine/include/spine/TranslateTimeline.h

@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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_TranslateTimeline_h
+#define Spine_TranslateTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+#include <spine/Animation.h>
+#include <spine/TimelineType.h>
+
+namespace spine {
+
+    class SP_API TranslateTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+
+        explicit TranslateTimeline(int frameCount);
+
+        virtual ~TranslateTimeline();
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, float x, float y);
+        
+    protected:
+		static const int PREV_TIME;
+		static const int PREV_X;
+		static const int PREV_Y;
+		static const int X;
+		static const int Y;
+        
+        Vector<float> _frames;
+        int _boneIndex;
+    };
+}
+
+#endif /* Spine_TranslateTimeline_h */

+ 65 - 0
dependencies/spine/include/spine/Triangulator.h

@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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_Triangulator_h
+#define Spine_Triangulator_h
+
+#include <spine/Vector.h>
+#include <spine/Pool.h>
+
+namespace spine {
+class SP_API Triangulator : public SpineObject {
+public:
+	~Triangulator();
+
+	Vector<int> &triangulate(Vector<float> &vertices);
+
+	Vector< Vector<float>* > &decompose(Vector<float> &vertices, Vector<int> &triangles);
+
+private:
+	Vector<Vector < float>* > _convexPolygons;
+	Vector<Vector < int>* > _convexPolygonsIndices;
+
+	Vector<int> _indices;
+	Vector<bool> _isConcaveArray;
+	Vector<int> _triangles;
+
+	Pool <Vector<float> > _polygonPool;
+	Pool <Vector<int> > _polygonIndicesPool;
+
+	static bool isConcave(int index, int vertexCount, Vector<float> &vertices, Vector<int> &indices);
+
+	static bool positiveArea(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y);
+
+	static int winding(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y);
+};
+}
+
+#endif /* Spine_Triangulator_h */

+ 81 - 0
dependencies/spine/include/spine/TwoColorTimeline.h

@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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_TwoColorTimeline_h
+#define Spine_TwoColorTimeline_h
+
+#include <spine/CurveTimeline.h>
+
+namespace spine {
+
+    class SP_API TwoColorTimeline : public CurveTimeline {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        
+        RTTI_DECL
+        
+    public:
+        static const int ENTRIES;
+
+        explicit TwoColorTimeline(int frameCount);
+        
+        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+        
+        virtual int getPropertyId();
+        
+        /// Sets the time and value of the specified keyframe.
+        void setFrame(int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2);
+        
+        int getSlotIndex();
+        void setSlotIndex(int inValue);
+        
+    private:
+		static const int PREV_TIME;
+		static const int PREV_R;
+		static const int PREV_G;
+		static const int PREV_B;
+		static const int PREV_A;
+		static const int PREV_R2;
+		static const int PREV_G2;
+		static const int PREV_B2;
+		static const int R;
+		static const int G;
+		static const int B;
+		static const int A;
+		static const int R2;
+		static const int G2;
+		static const int B2;
+        
+        Vector<float> _frames; // time, r, g, b, a, r2, g2, b2, ...
+        int _slotIndex;
+    };
+}
+
+#endif /* Spine_TwoColorTimeline_h */

+ 50 - 0
dependencies/spine/include/spine/Updatable.h

@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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_Updatable_h
+#define Spine_Updatable_h
+
+#include <spine/RTTI.h>
+#include <spine/SpineObject.h>
+
+namespace spine {
+class SP_API Updatable : public SpineObject {
+RTTI_DECL
+
+public:
+	Updatable();
+
+	virtual ~Updatable();
+
+	virtual void update() = 0;
+};
+}
+
+#endif /* Spine_Updatable_h */

+ 223 - 0
dependencies/spine/include/spine/Vector.h

@@ -0,0 +1,223 @@
+/******************************************************************************
+ * 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_Vector_h
+#define Spine_Vector_h
+
+#include <spine/Extension.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <stdlib.h>
+#include <memory>
+#include <assert.h>
+
+namespace spine {
+template<typename T>
+class SP_API Vector : public SpineObject {
+public:
+	Vector() : _size(0), _capacity(0), _buffer(NULL) {
+	}
+
+	Vector(const Vector &inVector) : _size(inVector._size), _capacity(inVector._capacity), _buffer(NULL) {
+		if (_capacity > 0) {
+			_buffer = allocate(_capacity);
+			for (size_t i = 0; i < _size; ++i) {
+				construct(_buffer + i, inVector._buffer[i]);
+			}
+		}
+	}
+
+	~Vector() {
+		clear();
+		deallocate(_buffer);
+	}
+
+	inline void clear() {
+		for (size_t i = 0; i < _size; ++i) {
+			destroy(_buffer + (_size - 1 - i));
+		}
+
+		_size = 0;
+	}
+
+	inline size_t getCapacity() const {
+		return _capacity;
+	}
+
+	inline size_t size() const {
+		return _size;
+	}
+
+	inline void setSize(size_t newSize, const T &defaultValue) {
+		assert(newSize >= 0);
+		size_t oldSize = _size;
+		_size = newSize;
+		if (_capacity < newSize) {
+			_capacity = (int) (_size * 1.75f);
+			if (_capacity < 8) _capacity = 8;
+			_buffer = spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
+		}
+		if (oldSize < _size) {
+			for (size_t i = oldSize; i < _size; i++) {
+				construct(_buffer + i, defaultValue);
+			}
+		}
+	}
+
+	inline void ensureCapacity(size_t newCapacity = 0) {
+		if (_capacity >= newCapacity) return;
+		_capacity = newCapacity;
+		_buffer = SpineExtension::realloc<T>(_buffer, newCapacity, __FILE__, __LINE__);
+	}
+
+	inline void add(const T &inValue) {
+		if (_size == _capacity) {
+			// inValue might reference an element in this buffer
+			// When we reallocate, the reference becomes invalid.
+			// We thus need to create a defensive copy before
+			// reallocating.
+			T valueCopy = inValue;
+			_capacity = (int) (_size * 1.75f);
+			if (_capacity < 8) _capacity = 8;
+			_buffer = spine::SpineExtension::realloc<T>(_buffer, _capacity, __FILE__, __LINE__);
+			construct(_buffer + _size++, valueCopy);
+		} else {
+			construct(_buffer + _size++, inValue);
+		}
+	}
+
+	inline void addAll(Vector<T> &inValue) {
+		ensureCapacity(this->size() + inValue.size());
+		for (size_t i = 0; i < inValue.size(); i++) {
+			add(inValue[i]);
+		}
+	}
+
+	inline void clearAndAddAll(Vector<T> &inValue) {
+		this->clear();
+		this->addAll(inValue);
+	}
+
+	inline void removeAt(size_t inIndex) {
+		assert(inIndex < _size);
+
+		--_size;
+
+		if (inIndex != _size) {
+			for (size_t i = inIndex; i < _size; ++i) {
+				std::swap(_buffer[i], _buffer[i + 1]);
+			}
+		}
+
+		destroy(_buffer + _size);
+	}
+
+	inline bool contains(const T &inValue) {
+		for (size_t i = 0; i < _size; ++i) {
+			if (_buffer[i] == inValue) {
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	inline int indexOf(const T &inValue) {
+		for (size_t i = 0; i < _size; ++i) {
+			if (_buffer[i] == inValue) {
+				return (int)i;
+			}
+		}
+
+		return -1;
+	}
+
+	inline T &operator[](size_t inIndex) {
+		assert(inIndex < _size);
+
+		return _buffer[inIndex];
+	}
+
+	inline friend bool operator==(Vector<T> &lhs, Vector<T> &rhs) {
+		if (lhs.size() != rhs.size()) {
+			return false;
+		}
+
+		for (size_t i = 0, n = lhs.size(); i < n; ++i) {
+			if (lhs[i] != rhs[i]) {
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	inline friend bool operator!=(Vector<T> &lhs, Vector<T> &rhs) {
+		return !(lhs == rhs);
+	}
+
+	inline T *buffer() {
+		return _buffer;
+	}
+
+private:
+	size_t _size;
+	size_t _capacity;
+	T *_buffer;
+
+	inline T *allocate(size_t n) {
+		assert(n > 0);
+
+		T *ptr = SpineExtension::calloc<T>(n, __FILE__, __LINE__);
+
+		assert(ptr);
+
+		return ptr;
+	}
+
+	inline void deallocate(T *buffer) {
+		if (_buffer) {
+			SpineExtension::free(buffer, __FILE__, __LINE__);
+		}
+	}
+
+	inline void construct(T *buffer, const T &val) {
+		new(buffer) T(val);
+	}
+
+	inline void destroy(T *buffer) {
+		buffer->~T();
+	}
+
+	// Vector &operator=(const Vector &inVector) {};
+};
+}
+
+#endif /* Spine_Vector_h */

+ 91 - 0
dependencies/spine/include/spine/VertexAttachment.h

@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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_VertexAttachment_h
+#define Spine_VertexAttachment_h
+
+#include <spine/Attachment.h>
+
+#include <spine/Vector.h>
+
+namespace spine {
+    class Slot;
+    
+    /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
+    class SP_API VertexAttachment : public Attachment {
+        friend class SkeletonBinary;
+        friend class SkeletonJson;
+        friend class DeformTimeline;
+        
+        RTTI_DECL
+        
+    public:
+        explicit VertexAttachment(const String& name);
+
+        virtual ~VertexAttachment();
+		
+		void computeWorldVertices(Slot& slot, float* worldVertices);
+        void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
+        
+        /// Transforms local vertices to world coordinates.
+        /// @param start The index of the first Vertices value to transform. Each vertex has 2 values, x and y.
+        /// @param count The number of world vertex values to output. Must be less than or equal to WorldVerticesLength - start.
+        /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count.
+        /// @param offset The worldVertices index to begin writing values.
+        /// @param stride The number of worldVertices entries between the value pairs written.
+		void computeWorldVertices(Slot& slot, size_t start, size_t count, float* worldVertices, size_t offset, size_t stride = 2);
+        void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
+        
+        /// @return true if a deform originally applied to the specified attachment should be applied to this attachment.
+        virtual bool applyDeform(VertexAttachment* sourceAttachment);
+        
+        /// Gets a unique ID for this attachment.
+        int getId();
+        
+        Vector<size_t>& getBones();
+        
+        Vector<float>& getVertices();
+        
+        size_t getWorldVerticesLength();
+        void setWorldVerticesLength(size_t inValue);
+        
+    protected:
+        Vector<size_t> _bones;
+        Vector<float> _vertices;
+        size_t _worldVerticesLength;
+        
+    private:
+        const int _id;
+        
+        static int getNextID();
+    };
+}
+
+#endif /* Spine_VertexAttachment_h */

+ 106 - 0
dependencies/spine/include/spine/VertexEffect.h

@@ -0,0 +1,106 @@
+/******************************************************************************
+ * 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_VertexEffect_h
+#define Spine_VertexEffect_h
+
+#include <spine/SpineObject.h>
+#include <spine/MathUtil.h>
+
+namespace spine {
+
+class Skeleton;
+class Color;
+
+class SP_API VertexEffect: public SpineObject {
+public:
+	virtual void begin(Skeleton& skeleton) = 0;
+	virtual void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark) = 0;
+	virtual void end() = 0;
+};
+
+class SP_API JitterVertexEffect: public VertexEffect {
+public:
+	JitterVertexEffect(float jitterX, float jitterY);
+
+	void begin(Skeleton& skeleton);
+	void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark);
+	void end();
+
+	void setJitterX(float jitterX);
+	float getJitterX();
+
+	void setJitterY(float jitterY);
+	float getJitterY();
+
+protected:
+	float _jitterX;
+	float _jitterY;
+};
+
+class SP_API SwirlVertexEffect: public VertexEffect {
+public:
+	SwirlVertexEffect(float radius, Interpolation &interpolation);
+
+	void begin(Skeleton& skeleton);
+	void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark);
+	void end();
+
+	void setCenterX(float centerX);
+	float getCenterX();
+
+	void setCenterY(float centerY);
+	float getCenterY();
+
+	void setRadius(float radius);
+	float getRadius();
+
+	void setAngle(float angle);
+	float getAngle();
+
+	void setWorldX(float worldX);
+	float getWorldX();
+
+	void setWorldY(float worldY);
+	float getWorldY();
+
+protected:
+	float _centerX;
+	float _centerY;
+	float _radius;
+	float _angle;
+	float _worldX;
+	float _worldY;
+
+	Interpolation& _interpolation;
+};
+}
+
+#endif /* Spine_VertexEffect_h */

+ 44 - 0
dependencies/spine/include/spine/Vertices.h

@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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_Vertices_h
+#define Spine_Vertices_h
+
+#include <spine/Vector.h>
+
+namespace spine {
+class SP_API Vertices : public SpineObject {
+public:
+	Vector<size_t> _bones;
+	Vector<float> _vertices;
+};
+}
+
+#endif /* Spine_Vertices_h */

+ 52 - 0
dependencies/spine/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 */

+ 114 - 0
dependencies/spine/include/spine/spine.h

@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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_SPINE_H_
+#define SPINE_SPINE_H_
+
+#include <spine/Animation.h>
+#include <spine/AnimationState.h>
+#include <spine/AnimationStateData.h>
+#include <spine/Atlas.h>
+#include <spine/AtlasAttachmentLoader.h>
+#include <spine/Attachment.h>
+#include <spine/AttachmentLoader.h>
+#include <spine/AttachmentTimeline.h>
+#include <spine/AttachmentType.h>
+#include <spine/BlendMode.h>
+#include <spine/Bone.h>
+#include <spine/BoneData.h>
+#include <spine/BoundingBoxAttachment.h>
+#include <spine/ClippingAttachment.h>
+#include <spine/Color.h>
+#include <spine/ColorTimeline.h>
+#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>
+#include <spine/EventData.h>
+#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>
+#include <spine/Json.h>
+#include <spine/LinkedMesh.h>
+#include <spine/MathUtil.h>
+#include <spine/MeshAttachment.h>
+#include <spine/MixBlend.h>
+#include <spine/MixDirection.h>
+#include <spine/PathAttachment.h>
+#include <spine/PathConstraint.h>
+#include <spine/PathConstraintData.h>
+#include <spine/PathConstraintMixTimeline.h>
+#include <spine/PathConstraintPositionTimeline.h>
+#include <spine/PathConstraintSpacingTimeline.h>
+#include <spine/PointAttachment.h>
+#include <spine/Pool.h>
+#include <spine/PositionMode.h>
+#include <spine/RegionAttachment.h>
+#include <spine/RotateMode.h>
+#include <spine/RotateTimeline.h>
+#include <spine/RTTI.h>
+#include <spine/ScaleTimeline.h>
+#include <spine/ShearTimeline.h>
+#include <spine/Skeleton.h>
+#include <spine/SkeletonBinary.h>
+#include <spine/SkeletonBounds.h>
+#include <spine/SkeletonClipping.h>
+#include <spine/SkeletonData.h>
+#include <spine/SkeletonJson.h>
+#include <spine/Skin.h>
+#include <spine/Slot.h>
+#include <spine/SlotData.h>
+#include <spine/SpacingMode.h>
+#include <spine/SpineObject.h>
+#include <spine/SpineString.h>
+#include <spine/TextureLoader.h>
+#include <spine/Timeline.h>
+#include <spine/TimelineType.h>
+#include <spine/TransformConstraint.h>
+#include <spine/TransformConstraintData.h>
+#include <spine/TransformConstraintTimeline.h>
+#include <spine/TransformMode.h>
+#include <spine/TranslateTimeline.h>
+#include <spine/Triangulator.h>
+#include <spine/TwoColorTimeline.h>
+#include <spine/Updatable.h>
+#include <spine/Vector.h>
+#include <spine/VertexAttachment.h>
+#include <spine/VertexEffect.h>
+#include <spine/Vertices.h>
+
+#endif

+ 141 - 0
dependencies/spine/src/spine/Animation.cpp

@@ -0,0 +1,141 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/Animation.h>
+#include <spine/Timeline.h>
+#include <spine/Skeleton.h>
+#include <spine/Event.h>
+
+#include <spine/ContainerUtil.h>
+
+using namespace spine;
+
+Animation::Animation(const String &name, Vector<Timeline *> &timelines, float duration) :
+		_timelines(timelines),
+		_duration(duration),
+		_name(name) {
+	assert(_name.length() > 0);
+}
+
+Animation::~Animation() {
+	ContainerUtil::cleanUpVectorOfPointers(_timelines);
+}
+
+void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector<Event *> *pEvents, float alpha,
+					  MixBlend blend, MixDirection direction) {
+	if (loop && _duration != 0) {
+		time = MathUtil::fmod(time, _duration);
+		if (lastTime > 0) {
+			lastTime = MathUtil::fmod(lastTime, _duration);
+		}
+	}
+
+	for (size_t i = 0, n = _timelines.size(); i < n; ++i) {
+		_timelines[i]->apply(skeleton, lastTime, time, pEvents, alpha, blend, direction);
+	}
+}
+
+const String &Animation::getName() {
+	return _name;
+}
+
+Vector<Timeline *> &Animation::getTimelines() {
+	return _timelines;
+}
+
+float Animation::getDuration() {
+	return _duration;
+}
+
+void Animation::setDuration(float inValue) {
+	_duration = inValue;
+}
+
+int Animation::binarySearch(Vector<float> &values, float target, int step) {
+	int low = 0;
+	int size = (int)values.size();
+	int high = size / step - 2;
+	if (high == 0) {
+		return step;
+	}
+
+	int current = (int) (static_cast<uint32_t>(high) >> 1);
+	while (true) {
+		if (values[(current + 1) * step] <= target) {
+			low = current + 1;
+		} else {
+			high = current;
+		}
+
+		if (low == high) {
+			return (low + 1) * step;
+		}
+
+		current = (int) (static_cast<uint32_t>(low + high) >> 1);
+	}
+}
+
+int Animation::binarySearch(Vector<float> &values, float target) {
+	int low = 0;
+	int size = (int)values.size();
+	int high = size - 2;
+	if (high == 0) {
+		return 1;
+	}
+
+	int current = (int) (static_cast<uint32_t>(high) >> 1);
+	while (true) {
+		if (values[(current + 1)] <= target) {
+			low = current + 1;
+		} else {
+			high = current;
+		}
+
+		if (low == high) {
+			return (low + 1);
+		}
+
+		current = (int) (static_cast<uint32_t>(low + high) >> 1);
+	}
+}
+
+int Animation::linearSearch(Vector<float> &values, float target, int step) {
+	for (int i = 0, last = (int)values.size() - step; i <= last; i += step) {
+		if (values[i] > target) {
+			return i;
+		}
+	}
+
+	return -1;
+}

+ 1022 - 0
dependencies/spine/src/spine/AnimationState.cpp

@@ -0,0 +1,1022 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/AnimationState.h>
+#include <spine/Animation.h>
+#include <spine/Event.h>
+#include <spine/AnimationStateData.h>
+#include <spine/Skeleton.h>
+#include <spine/RotateTimeline.h>
+#include <spine/SkeletonData.h>
+#include <spine/Bone.h>
+#include <spine/BoneData.h>
+#include <spine/AttachmentTimeline.h>
+#include <spine/DrawOrderTimeline.h>
+
+using namespace spine;
+
+void dummyOnAnimationEventFunc(AnimationState *state, spine::EventType type, TrackEntry *entry, Event *event = NULL) {
+	SP_UNUSED(state);
+	SP_UNUSED(type);
+	SP_UNUSED(entry);
+	SP_UNUSED(event);
+}
+
+TrackEntry::TrackEntry() : _animation(NULL), _next(NULL), _mixingFrom(NULL), _mixingTo(0), _trackIndex(0), _loop(false), _holdPrevious(false),
+						   _eventThreshold(0), _attachmentThreshold(0), _drawOrderThreshold(0), _animationStart(0),
+						   _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
+						   _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
+						   _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
+						   _listener(dummyOnAnimationEventFunc) {
+}
+
+TrackEntry::~TrackEntry() { }
+
+int TrackEntry::getTrackIndex() { return _trackIndex; }
+
+Animation *TrackEntry::getAnimation() { return _animation; }
+
+bool TrackEntry::getLoop() { return _loop; }
+
+void TrackEntry::setLoop(bool inValue) { _loop = inValue; }
+
+bool TrackEntry::getHoldPrevious() { return _holdPrevious; }
+
+void TrackEntry::setHoldPrevious(bool inValue) { _holdPrevious = inValue; }
+
+float TrackEntry::getDelay() { return _delay; }
+
+void TrackEntry::setDelay(float inValue) { _delay = inValue; }
+
+float TrackEntry::getTrackTime() { return _trackTime; }
+
+void TrackEntry::setTrackTime(float inValue) { _trackTime = inValue; }
+
+float TrackEntry::getTrackEnd() { return _trackEnd; }
+
+void TrackEntry::setTrackEnd(float inValue) { _trackEnd = inValue; }
+
+float TrackEntry::getAnimationStart() { return _animationStart; }
+
+void TrackEntry::setAnimationStart(float inValue) { _animationStart = inValue; }
+
+float TrackEntry::getAnimationEnd() { return _animationEnd; }
+
+void TrackEntry::setAnimationEnd(float inValue) { _animationEnd = inValue; }
+
+float TrackEntry::getAnimationLast() { return _animationLast; }
+
+void TrackEntry::setAnimationLast(float inValue) {
+	_animationLast = inValue;
+	_nextAnimationLast = inValue;
+}
+
+float TrackEntry::getAnimationTime() {
+	if (_loop) {
+		float duration = _animationEnd - _animationStart;
+		if (duration == 0) {
+			return _animationStart;
+		}
+
+		return MathUtil::fmod(_trackTime, duration) + _animationStart;
+	}
+
+	return MathUtil::min(_trackTime + _animationStart, _animationEnd);
+}
+
+float TrackEntry::getTimeScale() { return _timeScale; }
+
+void TrackEntry::setTimeScale(float inValue) { _timeScale = inValue; }
+
+float TrackEntry::getAlpha() { return _alpha; }
+
+void TrackEntry::setAlpha(float inValue) { _alpha = inValue; }
+
+float TrackEntry::getEventThreshold() { return _eventThreshold; }
+
+void TrackEntry::setEventThreshold(float inValue) { _eventThreshold = inValue; }
+
+float TrackEntry::getAttachmentThreshold() { return _attachmentThreshold; }
+
+void TrackEntry::setAttachmentThreshold(float inValue) { _attachmentThreshold = inValue; }
+
+float TrackEntry::getDrawOrderThreshold() { return _drawOrderThreshold; }
+
+void TrackEntry::setDrawOrderThreshold(float inValue) { _drawOrderThreshold = inValue; }
+
+TrackEntry *TrackEntry::getNext() { return _next; }
+
+bool TrackEntry::isComplete() {
+	return _trackTime >= _animationEnd - _animationStart;
+}
+
+float TrackEntry::getMixTime() { return _mixTime; }
+
+void TrackEntry::setMixTime(float inValue) { _mixTime = inValue; }
+
+float TrackEntry::getMixDuration() { return _mixDuration; }
+
+void TrackEntry::setMixDuration(float inValue) { _mixDuration = inValue; }
+
+TrackEntry *TrackEntry::getMixingFrom() { return _mixingFrom; }
+
+TrackEntry *TrackEntry::getMixingTo() { return _mixingTo; }
+
+void TrackEntry::setMixBlend(MixBlend blend) { _mixBlend = blend; }
+
+MixBlend TrackEntry::getMixBlend() { return _mixBlend; }
+
+void TrackEntry::resetRotationDirections() {
+	_timelinesRotation.clear();
+}
+
+void TrackEntry::setListener(AnimationStateListener inValue) {
+	_listener = inValue;
+}
+
+void TrackEntry::reset() {
+	_animation = NULL;
+	_next = NULL;
+	_mixingFrom = NULL;
+	_mixingTo = NULL;
+
+	_timelineMode.clear();
+	_timelineHoldMix.clear();
+	_timelinesRotation.clear();
+
+	_listener = dummyOnAnimationEventFunc;
+}
+
+EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) :
+		_type(eventType),
+		_entry(trackEntry),
+		_event(event) {
+}
+
+EventQueue *EventQueue::newEventQueue(AnimationState &state, Pool<TrackEntry> &trackEntryPool) {
+	return new(__FILE__, __LINE__) EventQueue(state, trackEntryPool);
+}
+
+EventQueueEntry EventQueue::newEventQueueEntry(EventType eventType, TrackEntry *entry, Event *event) {
+	return EventQueueEntry(eventType, entry, event);
+}
+
+EventQueue::EventQueue(AnimationState &state, Pool<TrackEntry> &trackEntryPool) : _state(state),
+																				  _trackEntryPool(trackEntryPool),
+																				  _drainDisabled(false) {
+}
+
+EventQueue::~EventQueue() {
+}
+
+void EventQueue::start(TrackEntry *entry) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_Start, entry));
+	_state._animationsChanged = true;
+}
+
+void EventQueue::interrupt(TrackEntry *entry) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_Interrupt, entry));
+}
+
+void EventQueue::end(TrackEntry *entry) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_End, entry));
+	_state._animationsChanged = true;
+}
+
+void EventQueue::dispose(TrackEntry *entry) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_Dispose, entry));
+}
+
+void EventQueue::complete(TrackEntry *entry) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_Complete, entry));
+}
+
+void EventQueue::event(TrackEntry *entry, Event *event) {
+	_eventQueueEntries.add(newEventQueueEntry(EventType_Event, entry, event));
+}
+
+/// Raises all events in the queue and drains the queue.
+void EventQueue::drain() {
+	if (_drainDisabled) {
+		return;
+	}
+
+	_drainDisabled = true;
+
+	AnimationState &state = _state;
+
+	// Don't cache _eventQueueEntries.size() so callbacks can queue their own events (eg, call setAnimation in AnimationState_Complete).
+	for (size_t i = 0; i < _eventQueueEntries.size(); ++i) {
+		EventQueueEntry *queueEntry = &_eventQueueEntries[i];
+		TrackEntry *trackEntry = queueEntry->_entry;
+
+		switch (queueEntry->_type) {
+			case EventType_Start:
+			case EventType_Interrupt:
+			case EventType_Complete:
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+				state._listener(&state, queueEntry->_type, trackEntry, NULL);
+				break;
+			case EventType_End:
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+				state._listener(&state, queueEntry->_type, trackEntry, NULL);
+				/* Yes, we want to fall through here */
+			case EventType_Dispose:
+				trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL);
+				state._listener(&state, EventType_Dispose, trackEntry, NULL);
+				trackEntry->reset();
+				_trackEntryPool.free(trackEntry);
+				break;
+			case EventType_Event:
+				trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+				state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+				break;
+		}
+	}
+	_eventQueueEntries.clear();
+
+	_drainDisabled = false;
+}
+
+const int Subsequent = 0;
+const int First = 1;
+const int Hold = 2;
+const int HoldMix = 3;
+
+AnimationState::AnimationState(AnimationStateData *data) :
+		_data(data),
+		_queue(EventQueue::newEventQueue(*this, _trackEntryPool)),
+		_animationsChanged(false),
+		_listener(dummyOnAnimationEventFunc),
+		_timeScale(1) {
+}
+
+AnimationState::~AnimationState() {
+	for (size_t i = 0; i < _tracks.size(); i++) {
+		TrackEntry* entry = _tracks[i];
+		if (entry) {
+			TrackEntry* from = entry->_mixingFrom;
+			while (from) {
+				TrackEntry* curr = from;
+				from = curr->_mixingFrom;
+				delete curr;
+			}
+			TrackEntry* next = entry->_next;
+			while (next) {
+				TrackEntry* curr = next;
+				next = curr->_next;
+				delete curr;
+			}
+			delete entry;
+		}
+	}
+	delete _queue;
+}
+
+void AnimationState::update(float delta) {
+	delta *= _timeScale;
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+		TrackEntry *currentP = _tracks[i];
+		if (currentP == NULL) {
+			continue;
+		}
+
+		TrackEntry &current = *currentP;
+
+		current._animationLast = current._nextAnimationLast;
+		current._trackLast = current._nextTrackLast;
+
+		float currentDelta = delta * current._timeScale;
+
+		if (current._delay > 0) {
+			current._delay -= currentDelta;
+			if (current._delay > 0) {
+				continue;
+			}
+			currentDelta = -current._delay;
+			current._delay = 0;
+		}
+
+		TrackEntry *next = current._next;
+		if (next != NULL) {
+			// When the next entry's delay is passed, change to the next entry, preserving leftover time.
+			float nextTime = current._trackLast - next->_delay;
+			if (nextTime >= 0) {
+				next->_delay = 0;
+				next->_trackTime = nextTime + (delta * next->_timeScale);
+				current._trackTime += currentDelta;
+				setCurrent(i, next, true);
+				while (next->_mixingFrom != NULL) {
+					next->_mixTime += currentDelta;
+					next = next->_mixingFrom;
+				}
+				continue;
+			}
+		} else if (current._trackLast >= current._trackEnd && current._mixingFrom == NULL) {
+			// clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
+			_tracks[i] = NULL;
+
+			_queue->end(currentP);
+			disposeNext(currentP);
+			continue;
+		}
+
+		if (current._mixingFrom != NULL && updateMixingFrom(currentP, delta)) {
+			// End mixing from entries once all have completed.
+			TrackEntry *from = current._mixingFrom;
+			current._mixingFrom = NULL;
+			if (from != NULL) from->_mixingTo = NULL;
+			while (from != NULL) {
+				_queue->end(from);
+				from = from->_mixingFrom;
+			}
+		}
+
+		current._trackTime += currentDelta;
+	}
+
+	_queue->drain();
+}
+
+bool AnimationState::apply(Skeleton &skeleton) {
+	if (_animationsChanged) {
+		animationsChanged();
+	}
+
+	bool applied = false;
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+		TrackEntry *currentP = _tracks[i];
+		if (currentP == NULL || currentP->_delay > 0) {
+			continue;
+		}
+
+		TrackEntry &current = *currentP;
+
+		applied = true;
+		MixBlend blend = i == 0 ? MixBlend_First : current._mixBlend;
+
+		// apply mixing from entries first.
+		float mix = current._alpha;
+		if (current._mixingFrom != NULL) {
+			mix *= applyMixingFrom(currentP, skeleton, blend);
+		} else if (current._trackTime >= current._trackEnd && current._next == NULL) {
+			mix = 0; // Set to setup pose the last time the entry will be applied.
+		}
+
+		// apply current entry.
+		float animationLast = current._animationLast, animationTime = current.getAnimationTime();
+		size_t timelineCount = current._animation->_timelines.size();
+		Vector<Timeline *> &timelines = current._animation->_timelines;
+		if (i == 0 && (mix == 1 || blend == MixBlend_Add)) {
+			for (size_t ii = 0; ii < timelineCount; ++ii) {
+				timelines[ii]->apply(skeleton, animationLast, animationTime, &_events, mix, blend,
+									 MixDirection_In);
+			}
+		} else {
+			Vector<int> &timelineMode = current._timelineMode;
+
+			bool firstFrame = current._timelinesRotation.size() == 0;
+			if (firstFrame) {
+				current._timelinesRotation.setSize(timelines.size() << 1, 0);
+			}
+			Vector<float> &timelinesRotation = current._timelinesRotation;
+
+			for (size_t ii = 0; ii < timelineCount; ++ii) {
+				Timeline *timeline = timelines[ii];
+				assert(timeline);
+
+				MixBlend timelineBlend = timelineMode[ii] == Subsequent ? blend : MixBlend_Setup;
+
+				RotateTimeline *rotateTimeline = NULL;
+				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
+					rotateTimeline = static_cast<RotateTimeline *>(timeline);
+				}
+
+				if (rotateTimeline != NULL) {
+					applyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1,
+										firstFrame);
+				} else {
+					timeline->apply(skeleton, animationLast, animationTime, &_events, mix, timelineBlend, MixDirection_In);
+				}
+			}
+		}
+
+		queueEvents(currentP, animationTime);
+		_events.clear();
+		current._nextAnimationLast = animationTime;
+		current._nextTrackLast = current._trackTime;
+	}
+
+	_queue->drain();
+	return applied;
+}
+
+void AnimationState::clearTracks() {
+	bool oldDrainDisabled = _queue->_drainDisabled;
+	_queue->_drainDisabled = true;
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+		clearTrack(i);
+	}
+	_tracks.clear();
+	_queue->_drainDisabled = oldDrainDisabled;
+	_queue->drain();
+}
+
+void AnimationState::clearTrack(size_t trackIndex) {
+	if (trackIndex >= _tracks.size()) {
+		return;
+	}
+
+	TrackEntry *current = _tracks[trackIndex];
+	if (current == NULL) {
+		return;
+	}
+
+	_queue->end(current);
+
+	disposeNext(current);
+
+	TrackEntry *entry = current;
+	while (true) {
+		TrackEntry *from = entry->_mixingFrom;
+		if (from == NULL) {
+			break;
+		}
+
+		_queue->end(from);
+		entry->_mixingFrom = NULL;
+		entry->_mixingTo = NULL;
+		entry = from;
+	}
+
+	_tracks[current->_trackIndex] = NULL;
+
+	_queue->drain();
+}
+
+TrackEntry *AnimationState::setAnimation(size_t trackIndex, const String &animationName, bool loop) {
+	Animation *animation = _data->_skeletonData->findAnimation(animationName);
+	assert(animation != NULL);
+
+	return setAnimation(trackIndex, animation, loop);
+}
+
+TrackEntry *AnimationState::setAnimation(size_t trackIndex, Animation *animation, bool loop) {
+	assert(animation != NULL);
+
+	bool interrupt = true;
+	TrackEntry *current = expandToIndex(trackIndex);
+	if (current != NULL) {
+		if (current->_nextTrackLast == -1) {
+			// Don't mix from an entry that was never applied.
+			_tracks[trackIndex] = current->_mixingFrom;
+			_queue->interrupt(current);
+			_queue->end(current);
+			disposeNext(current);
+			current = current->_mixingFrom;
+			interrupt = false;
+		} else {
+			disposeNext(current);
+		}
+	}
+
+	TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, current);
+	setCurrent(trackIndex, entry, interrupt);
+	_queue->drain();
+
+	return entry;
+}
+
+TrackEntry *AnimationState::addAnimation(size_t trackIndex, const String &animationName, bool loop, float delay) {
+	Animation *animation = _data->_skeletonData->findAnimation(animationName);
+	assert(animation != NULL);
+
+	return addAnimation(trackIndex, animation, loop, delay);
+}
+
+TrackEntry *AnimationState::addAnimation(size_t trackIndex, Animation *animation, bool loop, float delay) {
+	assert(animation != NULL);
+
+	TrackEntry *last = expandToIndex(trackIndex);
+	if (last != NULL) {
+		while (last->_next != NULL) {
+			last = last->_next;
+		}
+	}
+
+	TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, last);
+
+	if (last == NULL) {
+		setCurrent(trackIndex, entry, true);
+		_queue->drain();
+	} else {
+		last->_next = entry;
+		if (delay <= 0) {
+			float duration = last->_animationEnd - last->_animationStart;
+			if (duration != 0) {
+				if (last->_loop) {
+					delay += duration * (1 + (int) (last->_trackTime / duration));
+				} else {
+					delay += MathUtil::max(duration, last->_trackTime);
+				}
+				delay -= _data->getMix(last->_animation, animation);
+			} else {
+				delay = last->_trackTime;
+			}
+		}
+	}
+
+	entry->_delay = delay;
+	return entry;
+}
+
+TrackEntry *AnimationState::setEmptyAnimation(size_t trackIndex, float mixDuration) {
+	TrackEntry *entry = setAnimation(trackIndex, AnimationState::getEmptyAnimation(), false);
+	entry->_mixDuration = mixDuration;
+	entry->_trackEnd = mixDuration;
+	return entry;
+}
+
+TrackEntry *AnimationState::addEmptyAnimation(size_t trackIndex, float mixDuration, float delay) {
+	if (delay <= 0) {
+		delay -= mixDuration;
+	}
+
+	TrackEntry *entry = addAnimation(trackIndex, AnimationState::getEmptyAnimation(), false, delay);
+	entry->_mixDuration = mixDuration;
+	entry->_trackEnd = mixDuration;
+	return entry;
+}
+
+void AnimationState::setEmptyAnimations(float mixDuration) {
+	bool oldDrainDisabled = _queue->_drainDisabled;
+	_queue->_drainDisabled = true;
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+		TrackEntry *current = _tracks[i];
+		if (current != NULL) {
+			setEmptyAnimation(i, mixDuration);
+		}
+	}
+	_queue->_drainDisabled = oldDrainDisabled;
+	_queue->drain();
+}
+
+TrackEntry *AnimationState::getCurrent(size_t trackIndex) {
+	return trackIndex >= _tracks.size() ? NULL : _tracks[trackIndex];
+}
+
+AnimationStateData *AnimationState::getData() {
+	return _data;
+}
+
+Vector<TrackEntry *> &AnimationState::getTracks() {
+	return _tracks;
+}
+
+float AnimationState::getTimeScale() {
+	return _timeScale;
+}
+
+void AnimationState::setTimeScale(float inValue) {
+	_timeScale = inValue;
+}
+
+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);
+	return &ret;
+}
+
+void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha,
+										 MixBlend blend, Vector<float> &timelinesRotation, size_t i, bool firstFrame) {
+	if (firstFrame) {
+		timelinesRotation[i] = 0;
+	}
+
+	if (alpha == 1) {
+		rotateTimeline->apply(skeleton, 0, time, NULL, 1, blend, MixDirection_In);
+		return;
+	}
+
+	Bone *bone = skeleton._bones[rotateTimeline->_boneIndex];
+	Vector<float>& frames = rotateTimeline->_frames;
+	if (time < frames[0]) {
+		if (blend == MixBlend_Setup) {
+			bone->_rotation = bone->_data._rotation;
+		}
+		return;
+	}
+
+	float r2;
+	if (time >= frames[frames.size() - RotateTimeline::ENTRIES]) {
+		// Time is after last frame.
+		r2 = bone->_data._rotation + frames[frames.size() + RotateTimeline::PREV_ROTATION];
+	} else {
+		// Interpolate between the previous frame and the current frame.
+		int frame = Animation::binarySearch(frames, time, RotateTimeline::ENTRIES);
+		float prevRotation = frames[frame + RotateTimeline::PREV_ROTATION];
+		float frameTime = frames[frame];
+		float percent = rotateTimeline->getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame +
+																										   RotateTimeline::PREV_TIME] -
+																									frameTime));
+
+		r2 = frames[frame + RotateTimeline::ROTATION] - prevRotation;
+		r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360;
+		r2 = prevRotation + r2 * percent + bone->_data._rotation;
+		r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360;
+	}
+
+	// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.
+	float r1 = blend == MixBlend_Setup ? bone->_data._rotation : bone->_rotation;
+	float total, diff = r2 - r1;
+	diff -= (16384 - (int) (16384.499999999996 - diff / 360)) * 360;
+	if (diff == 0) {
+		total = timelinesRotation[i];
+	} else {
+		float lastTotal, lastDiff;
+		if (firstFrame) {
+			lastTotal = 0;
+			lastDiff = diff;
+		} else {
+			lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.
+			lastDiff = timelinesRotation[i + 1]; // Difference between bones.
+		}
+
+		bool current = diff > 0, dir = lastTotal >= 0;
+		// Detect cross at 0 (not 180).
+		if (MathUtil::sign(lastDiff) != MathUtil::sign(diff) && MathUtil::abs(lastDiff) <= 90) {
+			// A cross after a 360 rotation is a loop.
+			if (MathUtil::abs(lastTotal) > 180) {
+				lastTotal += 360 * MathUtil::sign(lastTotal);
+			}
+			dir = current;
+		}
+
+		total = diff + lastTotal - MathUtil::fmod(lastTotal, 360); // Store loops as part of lastTotal.
+		if (dir != current) {
+			total += 360 * MathUtil::sign(lastTotal);
+		}
+		timelinesRotation[i] = total;
+	}
+	timelinesRotation[i + 1] = diff;
+	r1 += total * alpha;
+	bone->_rotation = r1 - (16384 - (int) (16384.499999999996 - r1 / 360)) * 360;
+}
+
+bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
+	TrackEntry *from = to->_mixingFrom;
+	if (from == NULL) {
+		return true;
+	}
+
+	bool finished = updateMixingFrom(from, delta);
+
+	from->_animationLast = from->_nextAnimationLast;
+	from->_trackLast = from->_nextTrackLast;
+
+	// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
+	if (to->_mixTime > 0 && to->_mixTime >= to->_mixDuration) {
+		// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
+		if (from->_totalAlpha == 0 || to->_mixDuration == 0) {
+			to->_mixingFrom = from->_mixingFrom;
+			if (from->_mixingFrom != NULL) from->_mixingFrom->_mixingTo = to;
+			to->_interruptAlpha = from->_interruptAlpha;
+			_queue->end(from);
+		}
+		return finished;
+	}
+
+	if (to->_timeScale == 0 && to->_mixingTo) {
+		to->_timeScale = 1;
+		to->_mixTime = 0;
+		to->_mixDuration = 0;
+	}
+
+	from->_trackTime += delta * from->_timeScale;
+	to->_mixTime += delta * to->_timeScale;
+
+	return false;
+}
+
+float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBlend blend) {
+	TrackEntry *from = to->_mixingFrom;
+	if (from->_mixingFrom != NULL) {
+		applyMixingFrom(from, skeleton, blend);
+	}
+
+	float mix;
+	if (to->_mixDuration == 0) {
+		// Single frame mix to undo mixingFrom changes.
+		mix = 1;
+		if (blend == MixBlend_First) blend = MixBlend_Setup;
+	} else {
+		mix = to->_mixTime / to->_mixDuration;
+		if (mix > 1) {
+			mix = 1;
+		}
+		if (blend != MixBlend_First) blend = from->_mixBlend;
+	}
+
+	Vector<Event *> *eventBuffer = mix < from->_eventThreshold ? &_events : NULL;
+	bool attachments = mix < from->_attachmentThreshold, drawOrder = mix < from->_drawOrderThreshold;
+	float animationLast = from->_animationLast, animationTime = from->getAnimationTime();
+	Vector<Timeline *> &timelines = from->_animation->_timelines;
+	size_t timelineCount = timelines.size();
+	float alphaHold = from->_alpha * to->_interruptAlpha, alphaMix = alphaHold * (1 - mix);
+
+	if (blend == MixBlend_Add) {
+		for (size_t i = 0; i < timelineCount; i++)
+			timelines[i]->apply(skeleton, animationLast, animationTime, eventBuffer, alphaMix, blend, MixDirection_Out);
+	} else {
+		Vector<int> &timelineMode = from->_timelineMode;
+		Vector<TrackEntry *> &timelineHoldMix = from->_timelineHoldMix;
+
+		bool firstFrame = from->_timelinesRotation.size() == 0;
+		if (firstFrame) {
+			from->_timelinesRotation.setSize(timelines.size() << 1, 0);
+		}
+
+		Vector<float> &timelinesRotation = from->_timelinesRotation;
+
+		from->_totalAlpha = 0;
+		for (size_t i = 0; i < timelineCount; i++) {
+			Timeline *timeline = timelines[i];
+			MixBlend timelineBlend;
+			float alpha;
+			switch (timelineMode[i]) {
+				case Subsequent:
+					if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) continue;
+					if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue;
+					timelineBlend = blend;
+					alpha = alphaMix;
+					break;
+				case First:
+					timelineBlend = MixBlend_Setup;
+					alpha = alphaMix;
+					break;
+				case Hold:
+					timelineBlend = MixBlend_Setup;
+					alpha = alphaHold;
+					break;
+				default:
+					timelineBlend = MixBlend_Setup;
+					TrackEntry *holdMix = timelineHoldMix[i];
+					alpha = alphaHold * MathUtil::max(0.0f, 1.0f - holdMix->_mixTime / holdMix->_mixDuration);
+					break;
+			}
+			from->_totalAlpha += alpha;
+			if ((timeline->getRTTI().isExactly(RotateTimeline::rtti))) {
+				applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
+									firstFrame);
+			} else {
+				timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend,
+								MixDirection_Out);
+			}
+		}
+	}
+
+	if (to->_mixDuration > 0) {
+		queueEvents(from, animationTime);
+	}
+
+	_events.clear();
+	from->_nextAnimationLast = animationTime;
+	from->_nextTrackLast = from->_trackTime;
+
+	return mix;
+}
+
+void AnimationState::queueEvents(TrackEntry *entry, float animationTime) {
+	float animationStart = entry->_animationStart, animationEnd = entry->_animationEnd;
+	float duration = animationEnd - animationStart;
+	float trackLastWrapped = MathUtil::fmod(entry->_trackLast, duration);
+
+	// Queue events before complete.
+	size_t i = 0, n = _events.size();
+	for (; i < n; ++i) {
+		Event *e = _events[i];
+		if (e->_time < trackLastWrapped) {
+			break;
+		}
+		if (e->_time > animationEnd) {
+			// Discard events outside animation start/end.
+			continue;
+		}
+		_queue->event(entry, e);
+	}
+
+	// Queue complete if completed a loop iteration or the animation.
+	bool complete = false;
+	if (entry->_loop)
+		complete = duration == 0 || (trackLastWrapped > MathUtil::fmod(entry->_trackTime, duration));
+	else
+		complete = animationTime >= animationEnd && entry->_animationLast < animationEnd;
+	if (complete) _queue->complete(entry);
+
+	// Queue events after complete.
+	for (; i < n; ++i) {
+		Event *e = _events[i];
+		if (e->_time < animationStart) {
+			// Discard events outside animation start/end.
+			continue;
+		}
+		_queue->event(entry, _events[i]);
+	}
+}
+
+void AnimationState::setCurrent(size_t index, TrackEntry *current, bool interrupt) {
+	TrackEntry *from = expandToIndex(index);
+	_tracks[index] = current;
+
+	if (from != NULL) {
+		if (interrupt) {
+			_queue->interrupt(from);
+		}
+
+		current->_mixingFrom = from;
+		from->_mixingTo = current;
+		current->_mixTime = 0;
+
+		// Store interrupted mix percentage.
+		if (from->_mixingFrom != NULL && from->_mixDuration > 0) {
+			current->_interruptAlpha *= MathUtil::min(1.0f, from->_mixTime / from->_mixDuration);
+		}
+
+		from->_timelinesRotation.clear(); // Reset rotation for mixing out, in case entry was mixed in.
+	}
+
+	_queue->start(current); // triggers animationsChanged
+}
+
+TrackEntry *AnimationState::expandToIndex(size_t index) {
+	if (index < _tracks.size()) {
+		return _tracks[index];
+	}
+
+	while (index >= _tracks.size()) {
+		_tracks.add(NULL);
+	}
+
+	return NULL;
+}
+
+TrackEntry *AnimationState::newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last) {
+	TrackEntry *entryP = _trackEntryPool.obtain(); // Pooling
+	TrackEntry &entry = *entryP;
+
+	entry._trackIndex = trackIndex;
+	entry._animation = animation;
+	entry._loop = loop;
+	entry._holdPrevious = 0;
+
+	entry._eventThreshold = 0;
+	entry._attachmentThreshold = 0;
+	entry._drawOrderThreshold = 0;
+
+	entry._animationStart = 0;
+	entry._animationEnd = animation->getDuration();
+	entry._animationLast = -1;
+	entry._nextAnimationLast = -1;
+
+	entry._delay = 0;
+	entry._trackTime = 0;
+	entry._trackLast = -1;
+	entry._nextTrackLast = -1; // nextTrackLast == -1 signifies a TrackEntry that wasn't applied yet.
+	entry._trackEnd = std::numeric_limits<float>::max(); // loop ? float.MaxValue : animation.Duration;
+	entry._timeScale = 1;
+
+	entry._alpha = 1;
+	entry._interruptAlpha = 1;
+	entry._mixTime = 0;
+	entry._mixDuration = (last == NULL) ? 0 : _data->getMix(last->_animation, animation);
+
+	return entryP;
+}
+
+void AnimationState::disposeNext(TrackEntry *entry) {
+	TrackEntry *next = entry->_next;
+	while (next != NULL) {
+		_queue->dispose(next);
+		next = next->_next;
+	}
+	entry->_next = NULL;
+}
+
+void AnimationState::animationsChanged() {
+	_animationsChanged = false;
+
+	_propertyIDs.clear();
+
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+		TrackEntry *entry = _tracks[i];
+
+		if (!entry) continue;
+
+		while (entry->_mixingFrom != NULL)
+			entry = entry->_mixingFrom;
+
+		do {
+			if (entry->_mixingTo == NULL || entry->_mixBlend != MixBlend_Add) setTimelineModes(entry);
+			entry = entry->_mixingTo;
+		} while (entry != NULL);
+	}
+}
+
+void AnimationState::setTimelineModes(TrackEntry *entry) {
+	TrackEntry* to = entry->_mixingTo;
+	Vector<Timeline *> &timelines = entry->_animation->_timelines;
+	size_t timelinesCount = timelines.size();
+	Vector<int> &timelineMode = entry->_timelineMode;
+	timelineMode.setSize(timelinesCount, 0);
+	Vector<TrackEntry *> &timelineHoldMix = entry->_timelineHoldMix;
+	timelineHoldMix.setSize(timelinesCount, 0);
+
+	if (to != NULL && to->_holdPrevious) {
+		for (size_t i = 0; i < timelinesCount; i++) {
+			int id = timelines[i]->getPropertyId();
+			if (!_propertyIDs.contains(id)) _propertyIDs.add(id);
+			timelineMode[i] = Hold;
+		}
+		return;
+	}
+
+	// outer:
+	size_t i = 0;
+	continue_outer:
+	for (; i < timelinesCount; ++i) {
+		int id = timelines[i]->getPropertyId();
+		if (_propertyIDs.contains(id)) {
+			timelineMode[i] = Subsequent;
+		} else {
+			_propertyIDs.add(id);
+
+			if (to == NULL || !hasTimeline(to, id)) {
+				timelineMode[i] = First;
+			} else {
+				for (TrackEntry *next = to->_mixingTo; next != NULL; next = next->_mixingTo) {
+					if (hasTimeline(next, id)) continue;
+					if (entry->_mixDuration > 0) {
+						timelineMode[i] = HoldMix;
+						timelineHoldMix[i] = entry;
+						i++;
+						goto continue_outer; // continue outer;
+					}
+					break;
+				}
+				timelineMode[i] = Hold;
+			}
+		}
+	}
+}
+
+bool AnimationState::hasTimeline(TrackEntry* entry, int inId) {
+	Vector<Timeline *> &timelines = entry->_animation->_timelines;
+	for (size_t i = 0, n = timelines.size(); i < n; ++i) {
+		if (timelines[i]->getPropertyId() == inId) {
+			return true;
+		}
+	}
+	return false;
+}

+ 86 - 0
dependencies/spine/src/spine/AnimationStateData.cpp

@@ -0,0 +1,86 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/AnimationStateData.h>
+#include <spine/SkeletonData.h>
+#include <spine/Animation.h>
+
+using namespace spine;
+
+AnimationStateData::AnimationStateData(SkeletonData *skeletonData) : _skeletonData(skeletonData), _defaultMix(0) {
+}
+
+void AnimationStateData::setMix(const String &fromName, const String &toName, float duration) {
+	Animation *from = _skeletonData->findAnimation(fromName);
+	Animation *to = _skeletonData->findAnimation(toName);
+
+	setMix(from, to, duration);
+}
+
+void AnimationStateData::setMix(Animation *from, Animation *to, float duration) {
+	assert(from != NULL);
+	assert(to != NULL);
+
+	AnimationPair key(from, to);
+	_animationToMixTime.put(key, duration);
+}
+
+float AnimationStateData::getMix(Animation *from, Animation *to) {
+	assert(from != NULL);
+	assert(to != NULL);
+
+	AnimationPair key(from, to);
+
+	if (_animationToMixTime.containsKey(key)) return _animationToMixTime[key];
+	return _defaultMix;
+}
+
+SkeletonData *AnimationStateData::getSkeletonData() {
+	return _skeletonData;
+}
+
+float AnimationStateData::getDefaultMix() {
+	return _defaultMix;
+}
+
+void AnimationStateData::setDefaultMix(float inValue) {
+	_defaultMix = inValue;
+}
+
+AnimationStateData::AnimationPair::AnimationPair(Animation *a1, Animation *a2) : _a1(a1), _a2(a2) {
+}
+
+bool AnimationStateData::AnimationPair::operator==(const AnimationPair &other) const {
+	return _a1->_name == other._a1->_name && _a2->_name == other._a2->_name;
+}

+ 357 - 0
dependencies/spine/src/spine/Atlas.cpp

@@ -0,0 +1,357 @@
+/******************************************************************************
+ * 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.
+ *****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/Atlas.h>
+#include <spine/TextureLoader.h>
+#include <spine/ContainerUtil.h>
+
+#include <ctype.h>
+
+using namespace spine;
+
+Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) {
+	int dirLength;
+	char *dir;
+	int length;
+	const char *data;
+
+	/* Get directory from atlas path. */
+	const char *lastForwardSlash = strrchr(path.buffer(), '/');
+	const char *lastBackwardSlash = strrchr(path.buffer(), '\\');
+	const char *lastSlash = lastForwardSlash > lastBackwardSlash ? lastForwardSlash : lastBackwardSlash;
+	if (lastSlash == path) lastSlash++; /* Never drop starting slash. */
+	dirLength = (int) (lastSlash ? lastSlash - path.buffer() : 0);
+	dir = SpineExtension::calloc<char>(dirLength + 1, __FILE__, __LINE__);
+	memcpy(dir, path.buffer(), dirLength);
+	dir[dirLength] = '\0';
+
+	data = SpineExtension::readFile(path, &length);
+	if (data) {
+		load(data, length, dir);
+	}
+
+	SpineExtension::free(data, __FILE__, __LINE__);
+	SpineExtension::free(dir, __FILE__, __LINE__);
+}
+
+Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader) : _textureLoader(
+		textureLoader) {
+	load(data, length, dir);
+}
+
+Atlas::~Atlas() {
+	if (_textureLoader) {
+		for (size_t i = 0, n = _pages.size(); i < n; ++i) {
+			_textureLoader->unload(_pages[i]->getRendererObject());
+		}
+	}
+	ContainerUtil::cleanUpVectorOfPointers(_pages);
+	ContainerUtil::cleanUpVectorOfPointers(_regions);
+}
+
+void Atlas::flipV() {
+	for (size_t i = 0, n = _regions.size(); i < n; ++i) {
+		AtlasRegion *regionP = _regions[i];
+		AtlasRegion &region = *regionP;
+		region.v = 1 - region.v;
+		region.v2 = 1 - region.v2;
+	}
+}
+
+AtlasRegion *Atlas::findRegion(const String &name) {
+	for (size_t i = 0, n = _regions.size(); i < n; ++i) {
+		if (_regions[i]->name == name) {
+			return _regions[i];
+		}
+	}
+
+	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"};
+	static const char *textureFilterNames[] = {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest",
+											   "MipMapLinearNearest",
+											   "MipMapNearestLinear", "MipMapLinearLinear"};
+
+	int count;
+	const char *end = begin + length;
+	int dirLength = (int) strlen(dir);
+	int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\';
+
+	AtlasPage *page = NULL;
+	Str str;
+	Str tuple[4];
+
+	while (readLine(&begin, end, &str)) {
+		if (str.end - str.begin == 0) {
+			page = 0;
+		} else if (!page) {
+			char *name = mallocString(&str);
+			char *path = SpineExtension::calloc<char>(dirLength + needsSlash + strlen(name) + 1, __FILE__, __LINE__);
+			memcpy(path, dir, dirLength);
+			if (needsSlash) {
+				path[dirLength] = '/';
+			}
+			strcpy(path + dirLength + needsSlash, name);
+
+			page = new(__FILE__, __LINE__) AtlasPage(String(name, true));
+
+			int tupleVal = readTuple(&begin, end, tuple);
+			assert(tupleVal == 2);
+
+			/* size is only optional for an atlas packed with an old TexturePacker. */
+			page->width = toInt(tuple);
+			page->height = toInt(tuple + 1);
+			readTuple(&begin, end, tuple);
+
+			page->format = (Format) indexOf(formatNames, 8, tuple);
+
+			readTuple(&begin, end, tuple);
+			page->minFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple);
+			page->magFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple + 1);
+
+			readValue(&begin, end, &str);
+
+			page->uWrap = TextureWrap_ClampToEdge;
+			page->vWrap = TextureWrap_ClampToEdge;
+			if (!equals(&str, "none")) {
+				if (str.end - str.begin == 1) {
+					if (*str.begin == 'x') {
+						page->uWrap = TextureWrap_Repeat;
+					} else if (*str.begin == 'y') {
+						page->vWrap = TextureWrap_Repeat;
+					}
+				} else if (equals(&str, "xy")) {
+					page->uWrap = TextureWrap_Repeat;
+					page->vWrap = TextureWrap_Repeat;
+				}
+			}
+
+			if (_textureLoader) _textureLoader->load(*page, String(path));
+
+			SpineExtension::free(path, __FILE__, __LINE__);
+
+			_pages.add(page);
+		} else {
+			AtlasRegion *region = new(__FILE__, __LINE__) AtlasRegion();
+
+			region->page = page;
+			region->name = String(mallocString(&str), true);
+
+			readValue(&begin, end, &str);
+			region->rotate = equals(&str, "true") ? true : false;
+
+			readTuple(&begin, end, tuple);
+			region->x = toInt(tuple);
+			region->y = toInt(tuple + 1);
+
+			readTuple(&begin, end, tuple);
+			region->width = toInt(tuple);
+			region->height = toInt(tuple + 1);
+
+			region->u = region->x / (float) page->width;
+			region->v = region->y / (float) page->height;
+			if (region->rotate) {
+				region->u2 = (region->x + region->height) / (float) page->width;
+				region->v2 = (region->y + region->width) / (float) page->height;
+			} else {
+				region->u2 = (region->x + region->width) / (float) page->width;
+				region->v2 = (region->y + region->height) / (float) page->height;
+			}
+
+			count = readTuple(&begin, end, tuple);
+			assert(count);
+
+			if (count == 4) {
+				/* split is optional */
+				region->splits.setSize(4, 0);
+				region->splits[0] = toInt(tuple);
+				region->splits[1] = toInt(tuple + 1);
+				region->splits[2] = toInt(tuple + 2);
+				region->splits[3] = toInt(tuple + 3);
+
+				count = readTuple(&begin, end, tuple);
+				assert(count);
+
+				if (count == 4) {
+					/* pad is optional, but only present with splits */
+					region->pads.setSize(4, 0);
+					region->pads[0] = toInt(tuple);
+					region->pads[1] = toInt(tuple + 1);
+					region->pads[2] = toInt(tuple + 2);
+					region->pads[3] = toInt(tuple + 3);
+
+					readTuple(&begin, end, tuple);
+				}
+			}
+
+			region->originalWidth = toInt(tuple);
+			region->originalHeight = toInt(tuple + 1);
+
+			readTuple(&begin, end, tuple);
+			region->offsetX = (float)toInt(tuple);
+			region->offsetY = (float)toInt(tuple + 1);
+
+			readValue(&begin, end, &str);
+
+			region->index = toInt(&str);
+
+			_regions.add(region);
+		}
+	}
+}
+
+void Atlas::trim(Str *str) {
+	while (isspace((unsigned char) *str->begin) && str->begin < str->end) {
+		(str->begin)++;
+	}
+
+	if (str->begin == str->end) {
+		return;
+	}
+
+	str->end--;
+
+	while (isspace((unsigned char) *str->end) && str->end >= str->begin) {
+		str->end--;
+	}
+
+	str->end++;
+}
+
+int Atlas::readLine(const char **begin, const char *end, Str *str) {
+	if (*begin == end) {
+		return 0;
+	}
+
+	str->begin = *begin;
+
+	/* Find next delimiter. */
+	while (*begin != end && **begin != '\n') {
+		(*begin)++;
+	}
+
+	str->end = *begin;
+	trim(str);
+
+	if (*begin != end) {
+		(*begin)++;
+	}
+
+	return 1;
+}
+
+int Atlas::beginPast(Str *str, char c) {
+	const char *begin = str->begin;
+	while (true) {
+		char lastSkippedChar = *begin;
+		if (begin == str->end) {
+			return 0;
+		}
+		begin++;
+		if (lastSkippedChar == c) {
+			break;
+		}
+	}
+	str->begin = begin;
+	return 1;
+}
+
+int Atlas::readValue(const char **begin, const char *end, Str *str) {
+	readLine(begin, end, str);
+	if (!beginPast(str, ':')) {
+		return 0;
+	}
+
+	trim(str);
+	return 1;
+}
+
+int Atlas::readTuple(const char **begin, const char *end, Str tuple[]) {
+	int i;
+	Str str = {NULL, NULL};
+	readLine(begin, end, &str);
+	if (!beginPast(&str, ':')) {
+		return 0;
+	}
+
+	for (i = 0; i < 3; ++i) {
+		tuple[i].begin = str.begin;
+		if (!beginPast(&str, ',')) {
+			break;
+		}
+
+		tuple[i].end = str.begin - 2;
+		trim(&tuple[i]);
+	}
+
+	tuple[i].begin = str.begin;
+	tuple[i].end = str.end;
+	trim(&tuple[i]);
+
+	return i + 1;
+}
+
+char *Atlas::mallocString(Str *str) {
+	int length = (int) (str->end - str->begin);
+	char *string = SpineExtension::calloc<char>(length + 1, __FILE__, __LINE__);
+	memcpy(string, str->begin, length);
+	string[length] = '\0';
+	return string;
+}
+
+int Atlas::indexOf(const char **array, int count, Str *str) {
+	int length = (int) (str->end - str->begin);
+	int i;
+	for (i = count - 1; i >= 0; i--) {
+		if (strncmp(array[i], str->begin, length) == 0) {
+			return i;
+		}
+	}
+	return 0;
+}
+
+int Atlas::equals(Str *str, const char *other) {
+	return strncmp(other, str->begin, str->end - str->begin) == 0;
+}
+
+int Atlas::toInt(Str *str) {
+	return (int) strtol(str->begin, (char **) &str->end, 10);
+}

+ 129 - 0
dependencies/spine/src/spine/AtlasAttachmentLoader.cpp

@@ -0,0 +1,129 @@
+/******************************************************************************
+* 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.
+******************************************************S**********************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/AtlasAttachmentLoader.h>
+#include <spine/Skin.h>
+#include <spine/RegionAttachment.h>
+#include <spine/MeshAttachment.h>
+#include <spine/BoundingBoxAttachment.h>
+#include <spine/PathAttachment.h>
+#include <spine/PointAttachment.h>
+#include <spine/ClippingAttachment.h>
+
+#include <spine/Atlas.h>
+
+namespace spine {
+RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader)
+
+AtlasAttachmentLoader::AtlasAttachmentLoader(Atlas *atlas) : AttachmentLoader(), _atlas(atlas) {
+}
+
+RegionAttachment *AtlasAttachmentLoader::newRegionAttachment(Skin &skin, const String &name, const String &path) {
+	SP_UNUSED(skin);
+
+	AtlasRegion *regionP = findRegion(path);
+	if (!regionP) return NULL;
+
+	AtlasRegion &region = *regionP;
+
+	RegionAttachment *attachmentP = new(__FILE__, __LINE__) RegionAttachment(name);
+
+	RegionAttachment &attachment = *attachmentP;
+	attachment.setRendererObject(regionP);
+	attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
+	attachment._regionOffsetX = region.offsetX;
+	attachment._regionOffsetY = region.offsetY;
+	attachment._regionWidth = (float)region.width;
+	attachment._regionHeight = (float)region.height;
+	attachment._regionOriginalWidth = (float)region.originalWidth;
+	attachment._regionOriginalHeight = (float)region.originalHeight;
+	return attachmentP;
+}
+
+MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const String &name, const String &path) {
+	SP_UNUSED(skin);
+
+	AtlasRegion *regionP = findRegion(path);
+	if (!regionP) return NULL;
+
+	AtlasRegion &region = *regionP;
+
+	MeshAttachment *attachmentP = new(__FILE__, __LINE__) MeshAttachment(name);
+
+	MeshAttachment &attachment = *attachmentP;
+	attachment.setRendererObject(regionP);
+	attachment._regionU = region.u;
+	attachment._regionV = region.v;
+	attachment._regionU2 = region.u2;
+	attachment._regionV2 = region.v2;
+	attachment._regionRotate = region.rotate;
+	attachment._regionOffsetX = region.offsetX;
+	attachment._regionOffsetY = region.offsetY;
+	attachment._regionWidth = (float)region.width;
+	attachment._regionHeight = (float)region.height;
+	attachment._regionOriginalWidth = (float)region.originalWidth;
+	attachment._regionOriginalHeight = (float)region.originalHeight;
+
+	return attachmentP;
+}
+
+BoundingBoxAttachment *AtlasAttachmentLoader::newBoundingBoxAttachment(Skin &skin, const String &name) {
+	SP_UNUSED(skin);
+	return new(__FILE__, __LINE__)  BoundingBoxAttachment(name);
+}
+
+PathAttachment *AtlasAttachmentLoader::newPathAttachment(Skin &skin, const String &name) {
+	SP_UNUSED(skin);
+	return new(__FILE__, __LINE__) PathAttachment(name);
+}
+
+PointAttachment *AtlasAttachmentLoader::newPointAttachment(Skin &skin, const String &name) {
+	SP_UNUSED(skin);
+	return new(__FILE__, __LINE__) PointAttachment(name);
+}
+
+ClippingAttachment *AtlasAttachmentLoader::newClippingAttachment(Skin &skin, const String &name) {
+	SP_UNUSED(skin);
+	return new(__FILE__, __LINE__) ClippingAttachment(name);
+}
+
+void AtlasAttachmentLoader::configureAttachment(Attachment* attachment) {
+	SP_UNUSED(attachment);
+}
+
+AtlasRegion *AtlasAttachmentLoader::findRegion(const String &name) {
+	return _atlas->findRegion(name);
+}
+
+}

+ 52 - 0
dependencies/spine/src/spine/Attachment.cpp

@@ -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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/Attachment.h>
+
+#include <assert.h>
+
+using namespace spine;
+
+RTTI_IMPL_NOPARENT(Attachment)
+
+Attachment::Attachment(const String &name) : _name(name) {
+	assert(_name.length() > 0);
+}
+
+Attachment::~Attachment() {
+}
+
+const String &Attachment::getName() const {
+	return _name;
+}

+ 53 - 0
dependencies/spine/src/spine/AttachmentLoader.cpp

@@ -0,0 +1,53 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/AttachmentLoader.h>
+
+#include <spine/Skin.h>
+#include <spine/RegionAttachment.h>
+#include <spine/MeshAttachment.h>
+#include <spine/BoundingBoxAttachment.h>
+#include <spine/PathAttachment.h>
+#include <spine/PointAttachment.h>
+#include <spine/ClippingAttachment.h>
+
+using namespace spine;
+
+RTTI_IMPL_NOPARENT(AttachmentLoader)
+
+AttachmentLoader::AttachmentLoader() {
+}
+
+AttachmentLoader::~AttachmentLoader() {
+}

+ 125 - 0
dependencies/spine/src/spine/AttachmentTimeline.cpp

@@ -0,0 +1,125 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/AttachmentTimeline.h>
+
+#include <spine/Skeleton.h>
+#include <spine/Event.h>
+
+#include <spine/Animation.h>
+#include <spine/TimelineType.h>
+#include <spine/Slot.h>
+#include <spine/SlotData.h>
+
+using namespace spine;
+
+RTTI_IMPL(AttachmentTimeline, Timeline)
+
+AttachmentTimeline::AttachmentTimeline(int frameCount) : Timeline(), _slotIndex(0) {
+	_frames.ensureCapacity(frameCount);
+	_attachmentNames.ensureCapacity(frameCount);
+
+	_frames.setSize(frameCount, 0);
+
+	for (int i = 0; i < frameCount; ++i) {
+		_attachmentNames.add(String());
+	}
+}
+
+void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha,
+							   MixBlend blend, MixDirection direction) {
+	SP_UNUSED(lastTime);
+	SP_UNUSED(pEvents);
+	SP_UNUSED(alpha);
+
+	assert(_slotIndex < skeleton._slots.size());
+
+	String *attachmentName;
+	Slot *slotP = skeleton._slots[_slotIndex];
+	Slot &slot = *slotP;
+	if (direction == MixDirection_Out && blend == MixBlend_Setup) {
+		attachmentName = &slot._data._attachmentName;
+		slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
+		return;
+	}
+
+	if (time < _frames[0]) {
+		// Time is before first frame.
+		if (blend == MixBlend_Setup || blend == MixBlend_First) {
+			attachmentName = &slot._data._attachmentName;
+			slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
+		}
+		return;
+	}
+
+	size_t frameIndex;
+	if (time >= _frames[_frames.size() - 1]) {
+		// Time is after last frame.
+		frameIndex = _frames.size() - 1;
+	} else {
+		frameIndex = Animation::binarySearch(_frames, time, 1) - 1;
+	}
+
+	attachmentName = &_attachmentNames[frameIndex];
+	slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
+}
+
+int AttachmentTimeline::getPropertyId() {
+	return ((int) TimelineType_Attachment << 24) + _slotIndex;
+}
+
+void AttachmentTimeline::setFrame(int frameIndex, float time, const String &attachmentName) {
+	_frames[frameIndex] = time;
+	_attachmentNames[frameIndex] = attachmentName;
+}
+
+size_t AttachmentTimeline::getSlotIndex() {
+	return _slotIndex;
+}
+
+void AttachmentTimeline::setSlotIndex(size_t inValue) {
+	_slotIndex = inValue;
+}
+
+const Vector<float> &AttachmentTimeline::getFrames() {
+	return _frames;
+}
+
+const Vector<String> &AttachmentTimeline::getAttachmentNames() {
+	return _attachmentNames;
+}
+
+size_t AttachmentTimeline::getFrameCount() {
+	return _frames.size();
+}

+ 537 - 0
dependencies/spine/src/spine/Bone.cpp

@@ -0,0 +1,537 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/Bone.h>
+
+#include <spine/BoneData.h>
+#include <spine/Skeleton.h>
+
+using namespace spine;
+
+RTTI_IMPL(Bone, Updatable)
+
+bool Bone::yDown = false;
+
+void Bone::setYDown(bool inValue) {
+	yDown = inValue;
+}
+
+bool Bone::isYDown() {
+	return yDown;
+}
+
+Bone::Bone(BoneData &data, Skeleton &skeleton, Bone *parent) : Updatable(),
+															   _data(data),
+															   _skeleton(skeleton),
+															   _parent(parent),
+															   _x(0),
+															   _y(0),
+															   _rotation(0),
+															   _scaleX(0),
+															   _scaleY(0),
+															   _shearX(0),
+															   _shearY(0),
+															   _ax(0),
+															   _ay(0),
+															   _arotation(0),
+															   _ascaleX(0),
+															   _ascaleY(0),
+															   _ashearX(0),
+															   _ashearY(0),
+															   _appliedValid(false),
+															   _a(1),
+															   _b(0),
+															   _worldX(0),
+															   _c(0),
+															   _d(1),
+															   _worldY(0),
+															   _sorted(false) {
+	setToSetupPose();
+}
+
+void Bone::update() {
+	updateWorldTransform(_x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY);
+}
+
+void Bone::updateWorldTransform() {
+	updateWorldTransform(_x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY);
+}
+
+void
+Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY) {
+	float cosine, sine;
+	float pa, pb, pc, pd;
+	Bone *parent = _parent;
+
+	_ax = x;
+	_ay = y;
+	_arotation = rotation;
+	_ascaleX = scaleX;
+	_ascaleY = scaleY;
+	_ashearX = shearX;
+	_ashearY = shearY;
+	_appliedValid = true;
+
+	if (!parent) { /* Root bone. */
+		float rotationY = rotation + 90 + shearY;
+		float sx = _skeleton.getScaleX();
+		float sy = _skeleton.getScaleY();
+		_a = MathUtil::cosDeg(rotation + shearX) * scaleX * sx;
+		_b = MathUtil::cosDeg(rotationY) * scaleY * sy;
+		_c = MathUtil::sinDeg(rotation + shearX) * scaleX * sx;
+		_d = MathUtil::sinDeg(rotationY) * scaleY * sy;
+		_worldX = x * sx + _skeleton.getX();
+		_worldY = y * sy + _skeleton.getY();
+		return;
+	}
+
+	pa = parent->_a;
+	pb = parent->_b;
+	pc = parent->_c;
+	pd = parent->_d;
+
+	_worldX = pa * x + pb * y + parent->_worldX;
+	_worldY = pc * x + pd * y + parent->_worldY;
+
+	switch (_data.getTransformMode()) {
+		case TransformMode_Normal: {
+			float rotationY = rotation + 90 + shearY;
+			float la = MathUtil::cosDeg(rotation + shearX) * scaleX;
+			float lb = MathUtil::cosDeg(rotationY) * scaleY;
+			float lc = MathUtil::sinDeg(rotation + shearX) * scaleX;
+			float ld = MathUtil::sinDeg(rotationY) * scaleY;
+			_a = pa * la + pb * lc;
+			_b = pa * lb + pb * ld;
+			_c = pc * la + pd * lc;
+			_d = pc * lb + pd * ld;
+			return;
+		}
+		case TransformMode_OnlyTranslation: {
+			float rotationY = rotation + 90 + shearY;
+			_a = MathUtil::cosDeg(rotation + shearX) * scaleX;
+			_b = MathUtil::cosDeg(rotationY) * scaleY;
+			_c = MathUtil::sinDeg(rotation + shearX) * scaleX;
+			_d = MathUtil::sinDeg(rotationY) * scaleY;
+			break;
+		}
+		case TransformMode_NoRotationOrReflection: {
+			float s = pa * pa + pc * pc;
+			float prx, rx, ry, la, lb, lc, ld;
+			if (s > 0.0001f) {
+				s = MathUtil::abs(pa * pd - pb * pc) / s;
+				pb = pc * s;
+				pd = pa * s;
+				prx = MathUtil::atan2(pc, pa) * MathUtil::Rad_Deg;
+			} else {
+				pa = 0;
+				pc = 0;
+				prx = 90 - MathUtil::atan2(pd, pb) * MathUtil::Rad_Deg;
+			}
+			rx = rotation + shearX - prx;
+			ry = rotation + shearY - prx + 90;
+			la = MathUtil::cosDeg(rx) * scaleX;
+			lb = MathUtil::cosDeg(ry) * scaleY;
+			lc = MathUtil::sinDeg(rx) * scaleX;
+			ld = MathUtil::sinDeg(ry) * scaleY;
+			_a = pa * la - pb * lc;
+			_b = pa * lb - pb * ld;
+			_c = pc * la + pd * lc;
+			_d = pc * lb + pd * ld;
+			break;
+		}
+		case TransformMode_NoScale:
+		case TransformMode_NoScaleOrReflection: {
+			float za, zc, s;
+			float r, zb, zd, la, lb, lc, ld;
+			cosine = MathUtil::cosDeg(rotation);
+			sine = MathUtil::sinDeg(rotation);
+			za = (pa * cosine + pb * sine) / _skeleton.getScaleX();
+			zc = (pc * cosine + pd * sine) / _skeleton.getScaleY();
+			s = MathUtil::sqrt(za * za + zc * zc);
+			if (s > 0.00001f) s = 1 / s;
+			za *= s;
+			zc *= s;
+			s = MathUtil::sqrt(za * za + zc * zc);
+			r = MathUtil::Pi / 2 + MathUtil::atan2(zc, za);
+			zb = MathUtil::cos(r) * s;
+			zd = MathUtil::sin(r) * s;
+			la = MathUtil::cosDeg(shearX) * scaleX;
+			lb = MathUtil::cosDeg(90 + shearY) * scaleY;
+			lc = MathUtil::sinDeg(shearX) * scaleX;
+			ld = MathUtil::sinDeg(90 + shearY) * scaleY;
+			_a = za * la + zb * lc;
+			_b = za * lb + zb * ld;
+			_c = zc * la + zd * lc;
+			_d = zc * lb + zd * ld;
+			break;
+		}
+	}
+	_a *= _skeleton.getScaleX();
+	_b *= _skeleton.getScaleX();
+	_c *= _skeleton.getScaleY();
+	_d *= _skeleton.getScaleY();
+}
+
+void Bone::setToSetupPose() {
+	BoneData &data = _data;
+	_x = data.getX();
+	_y = data.getY();
+	_rotation = data.getRotation();
+	_scaleX = data.getScaleX();
+	_scaleY = data.getScaleY();
+	_shearX = data.getShearX();
+	_shearY = data.getShearY();
+}
+
+void Bone::worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY) {
+	float a = _a;
+	float b = _b;
+	float c = _c;
+	float d = _d;
+
+	float invDet = 1 / (a * d - b * c);
+	float x = worldX - _worldX;
+	float y = worldY - _worldY;
+
+	outLocalX = (x * d * invDet - y * b * invDet);
+	outLocalY = (y * a * invDet - x * c * invDet);
+}
+
+void Bone::localToWorld(float localX, float localY, float &outWorldX, float &outWorldY) {
+	outWorldX = localX * _a + localY * _b + _worldX;
+	outWorldY = localX * _c + localY * _d + _worldY;
+}
+
+float Bone::worldToLocalRotation(float worldRotation) {
+	float sin = MathUtil::sinDeg(worldRotation);
+	float cos = MathUtil::cosDeg(worldRotation);
+
+	return MathUtil::atan2(_a * sin - _c * cos, _d * cos - _b * sin) * MathUtil::Rad_Deg;
+}
+
+float Bone::localToWorldRotation(float localRotation) {
+	float sin = MathUtil::sinDeg(localRotation);
+	float cos = MathUtil::cosDeg(localRotation);
+
+	return MathUtil::atan2(cos * _c + sin * _d, cos * _a + sin * _b) * MathUtil::Rad_Deg;
+}
+
+void Bone::rotateWorld(float degrees) {
+	float a = _a;
+	float b = _b;
+	float c = _c;
+	float d = _d;
+
+	float cos = MathUtil::cosDeg(degrees);
+	float sin = MathUtil::sinDeg(degrees);
+
+	_a = cos * a - sin * c;
+	_b = cos * b - sin * d;
+	_c = sin * a + cos * c;
+	_d = sin * b + cos * d;
+
+	_appliedValid = false;
+}
+
+float Bone::getWorldToLocalRotationX() {
+	Bone *parent = _parent;
+	if (!parent) {
+		return _arotation;
+	}
+
+	float pa = parent->_a;
+	float pb = parent->_b;
+	float pc = parent->_c;
+	float pd = parent->_d;
+	float a = _a;
+	float c = _c;
+
+	return MathUtil::atan2(pa * c - pc * a, pd * a - pb * c) * MathUtil::Rad_Deg;
+}
+
+float Bone::getWorldToLocalRotationY() {
+	Bone *parent = _parent;
+	if (!parent) {
+		return _arotation;
+	}
+
+	float pa = parent->_a;
+	float pb = parent->_b;
+	float pc = parent->_c;
+	float pd = parent->_d;
+	float b = _b;
+	float d = _d;
+
+	return MathUtil::atan2(pa * d - pc * b, pd * b - pb * d) * MathUtil::Rad_Deg;
+}
+
+BoneData &Bone::getData() {
+	return _data;
+}
+
+Skeleton &Bone::getSkeleton() {
+	return _skeleton;
+}
+
+Bone *Bone::getParent() {
+	return _parent;
+}
+
+Vector<Bone *> &Bone::getChildren() {
+	return _children;
+}
+
+float Bone::getX() {
+	return _x;
+}
+
+void Bone::setX(float inValue) {
+	_x = inValue;
+}
+
+float Bone::getY() {
+	return _y;
+}
+
+void Bone::setY(float inValue) {
+	_y = inValue;
+}
+
+float Bone::getRotation() {
+	return _rotation;
+}
+
+void Bone::setRotation(float inValue) {
+	_rotation = inValue;
+}
+
+float Bone::getScaleX() {
+	return _scaleX;
+}
+
+void Bone::setScaleX(float inValue) {
+	_scaleX = inValue;
+}
+
+float Bone::getScaleY() {
+	return _scaleY;
+}
+
+void Bone::setScaleY(float inValue) {
+	_scaleY = inValue;
+}
+
+float Bone::getShearX() {
+	return _shearX;
+}
+
+void Bone::setShearX(float inValue) {
+	_shearX = inValue;
+}
+
+float Bone::getShearY() {
+	return _shearY;
+}
+
+void Bone::setShearY(float inValue) {
+	_shearY = inValue;
+}
+
+float Bone::getAppliedRotation() {
+	return _arotation;
+}
+
+void Bone::setAppliedRotation(float inValue) {
+	_arotation = inValue;
+}
+
+float Bone::getAX() {
+	return _ax;
+}
+
+void Bone::setAX(float inValue) {
+	_ax = inValue;
+}
+
+float Bone::getAY() {
+	return _ay;
+}
+
+void Bone::setAY(float inValue) {
+	_ay = inValue;
+}
+
+float Bone::getAScaleX() {
+	return _ascaleX;
+}
+
+void Bone::setAScaleX(float inValue) {
+	_ascaleX = inValue;
+}
+
+float Bone::getAScaleY() {
+	return _ascaleY;
+}
+
+void Bone::setAScaleY(float inValue) {
+	_ascaleY = inValue;
+}
+
+float Bone::getAShearX() {
+	return _ashearX;
+}
+
+void Bone::setAShearX(float inValue) {
+	_ashearX = inValue;
+}
+
+float Bone::getAShearY() {
+	return _ashearY;
+}
+
+void Bone::setAShearY(float inValue) {
+	_ashearY = inValue;
+}
+
+float Bone::getA() {
+	return _a;
+}
+
+void Bone::setA(float inValue) {
+	_a = inValue;
+}
+
+float Bone::getB() {
+	return _b;
+}
+
+void Bone::setB(float inValue) {
+	_b = inValue;
+}
+
+float Bone::getC() {
+	return _c;
+}
+
+void Bone::setC(float inValue) {
+	_c = inValue;
+}
+
+float Bone::getD() {
+	return _d;
+}
+
+void Bone::setD(float inValue) {
+	_d = inValue;
+}
+
+float Bone::getWorldX() {
+	return _worldX;
+}
+
+void Bone::setWorldX(float inValue) {
+	_worldX = inValue;
+}
+
+float Bone::getWorldY() {
+	return _worldY;
+}
+
+void Bone::setWorldY(float inValue) {
+	_worldY = inValue;
+}
+
+float Bone::getWorldRotationX() {
+	return MathUtil::atan2(_c, _a) * MathUtil::MathUtil::Rad_Deg;
+}
+
+float Bone::getWorldRotationY() {
+	return MathUtil::atan2(_d, _b) * MathUtil::Rad_Deg;
+}
+
+float Bone::getWorldScaleX() {
+	return MathUtil::sqrt(_a * _a + _c * _c);
+}
+
+float Bone::getWorldScaleY() {
+	return MathUtil::sqrt(_b * _b + _d * _d);
+}
+
+bool Bone::isAppliedValid() {
+	return _appliedValid;
+}
+void Bone::setAppliedValid(bool valid) {
+	_appliedValid = valid;
+}
+
+void Bone::updateAppliedTransform() {
+	Bone *parent = _parent;
+	_appliedValid = 1;
+	if (!parent) {
+		_ax = _worldX;
+		_ay = _worldY;
+		_arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg;
+		_ascaleX = MathUtil::sqrt(_a * _a + _c * _c);
+		_ascaleY = MathUtil::sqrt(_b * _b + _d * _d);
+		_ashearX = 0;
+		_ashearY = MathUtil::atan2(_a * _b + _c * _d, _a * _d - _b * _c) * MathUtil::Rad_Deg;
+	} else {
+		float pa = parent->_a, pb = parent->_b, pc = parent->_c, pd = parent->_d;
+		float pid = 1 / (pa * pd - pb * pc);
+		float dx = _worldX - parent->_worldX, dy = _worldY - parent->_worldY;
+		float ia = pid * pd;
+		float id = pid * pa;
+		float ib = pid * pb;
+		float ic = pid * pc;
+		float ra = ia * _a - ib * _c;
+		float rb = ia * _b - ib * _d;
+		float rc = id * _c - ic * _a;
+		float rd = id * _d - ic * _b;
+		_ax = (dx * pd * pid - dy * pb * pid);
+		_ay = (dy * pa * pid - dx * pc * pid);
+		_ashearX = 0;
+		_ascaleX = MathUtil::sqrt(ra * ra + rc * rc);
+		if (_ascaleX > 0.0001f) {
+			float det = ra * rd - rb * rc;
+			_ascaleY = det / _ascaleX;
+			_ashearY = MathUtil::atan2(ra * rb + rc * rd, det) * MathUtil::Rad_Deg;
+			_arotation = MathUtil::atan2(rc, ra) * MathUtil::Rad_Deg;
+		} else {
+			_ascaleX = 0;
+			_ascaleY = MathUtil::sqrt(rb * rb + rd * rd);
+			_ashearY = 0;
+			_arotation = 90 - MathUtil::atan2(rd, rb) * MathUtil::Rad_Deg;
+		}
+	}
+}

+ 140 - 0
dependencies/spine/src/spine/BoneData.cpp

@@ -0,0 +1,140 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/BoneData.h>
+
+#include <assert.h>
+
+using namespace spine;
+
+BoneData::BoneData(int index, const String &name, BoneData *parent) :
+		_index(index),
+		_name(name),
+		_parent(parent),
+		_length(0),
+		_x(0),
+		_y(0),
+		_rotation(0),
+		_scaleX(1),
+		_scaleY(1),
+		_shearX(0),
+		_shearY(0),
+		_transformMode(TransformMode_Normal) {
+	assert(index >= 0);
+	assert(_name.length() > 0);
+}
+
+int BoneData::getIndex() {
+	return _index;
+}
+
+const String &BoneData::getName() {
+	return _name;
+}
+
+BoneData *BoneData::getParent() {
+	return _parent;
+}
+
+float BoneData::getLength() {
+	return _length;
+}
+
+void BoneData::setLength(float inValue) {
+	_length = inValue;
+}
+
+float BoneData::getX() {
+	return _x;
+}
+
+void BoneData::setX(float inValue) {
+	_x = inValue;
+}
+
+float BoneData::getY() {
+	return _y;
+}
+
+void BoneData::setY(float inValue) {
+	_y = inValue;
+}
+
+float BoneData::getRotation() {
+	return _rotation;
+}
+
+void BoneData::setRotation(float inValue) {
+	_rotation = inValue;
+}
+
+float BoneData::getScaleX() {
+	return _scaleX;
+}
+
+void BoneData::setScaleX(float inValue) {
+	_scaleX = inValue;
+}
+
+float BoneData::getScaleY() {
+	return _scaleY;
+}
+
+void BoneData::setScaleY(float inValue) {
+	_scaleY = inValue;
+}
+
+float BoneData::getShearX() {
+	return _shearX;
+}
+
+void BoneData::setShearX(float inValue) {
+	_shearX = inValue;
+}
+
+float BoneData::getShearY() {
+	return _shearY;
+}
+
+void BoneData::setShearY(float inValue) {
+	_shearY = inValue;
+}
+
+TransformMode BoneData::getTransformMode() {
+	return _transformMode;
+}
+
+void BoneData::setTransformMode(TransformMode inValue) {
+	_transformMode = inValue;
+}

+ 42 - 0
dependencies/spine/src/spine/BoundingBoxAttachment.cpp

@@ -0,0 +1,42 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/BoundingBoxAttachment.h>
+
+using namespace spine;
+
+RTTI_IMPL(BoundingBoxAttachment, VertexAttachment)
+
+BoundingBoxAttachment::BoundingBoxAttachment(const String &name) : VertexAttachment(name) {
+}

+ 52 - 0
dependencies/spine/src/spine/ClippingAttachment.cpp

@@ -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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/ClippingAttachment.h>
+
+#include <spine/SlotData.h>
+
+using namespace spine;
+
+RTTI_IMPL(ClippingAttachment, VertexAttachment)
+
+ClippingAttachment::ClippingAttachment(const String &name) : VertexAttachment(name), _endSlot(NULL) {
+}
+
+SlotData *ClippingAttachment::getEndSlot() {
+	return _endSlot;
+}
+
+void ClippingAttachment::setEndSlot(SlotData *inValue) {
+	_endSlot = inValue;
+}

+ 144 - 0
dependencies/spine/src/spine/ColorTimeline.cpp

@@ -0,0 +1,144 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/ColorTimeline.h>
+
+#include <spine/Skeleton.h>
+#include <spine/Event.h>
+
+#include <spine/Animation.h>
+#include <spine/TimelineType.h>
+#include <spine/Slot.h>
+#include <spine/SlotData.h>
+
+using namespace spine;
+
+RTTI_IMPL(ColorTimeline, CurveTimeline)
+
+const int ColorTimeline::ENTRIES = 5;
+const int ColorTimeline::PREV_TIME = -5;
+const int ColorTimeline::PREV_R = -4;
+const int ColorTimeline::PREV_G = -3;
+const int ColorTimeline::PREV_B = -2;
+const int ColorTimeline::PREV_A = -1;
+const int ColorTimeline::R = 1;
+const int ColorTimeline::G = 2;
+const int ColorTimeline::B = 3;
+const int ColorTimeline::A = 4;
+
+ColorTimeline::ColorTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0) {
+	_frames.setSize(frameCount * ENTRIES, 0);
+}
+
+void ColorTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha,
+						  MixBlend blend, MixDirection direction) {
+	SP_UNUSED(lastTime);
+	SP_UNUSED(pEvents);
+	SP_UNUSED(direction);
+
+	Slot *slotP = skeleton._slots[_slotIndex];
+	Slot &slot = *slotP;
+	if (time < _frames[0]) {
+		switch (blend) {
+			case MixBlend_Setup:
+				slot._color.set(slot._data._color);
+				return;
+			case MixBlend_First: {
+				Color &color = slot._color, setup = slot._data._color;
+				color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,
+						  (setup.a - color.a) * alpha);
+			}
+			default: ;
+		}
+		return;
+	}
+
+	float r, g, b, a;
+	if (time >= _frames[_frames.size() - ENTRIES]) {
+		// Time is after last frame.
+		size_t i = _frames.size();
+		r = _frames[i + PREV_R];
+		g = _frames[i + PREV_G];
+		b = _frames[i + PREV_B];
+		a = _frames[i + PREV_A];
+	} else {
+		// Interpolate between the previous frame and the current frame.
+		size_t frame = (size_t)Animation::binarySearch(_frames, time, ENTRIES);
+		r = _frames[frame + PREV_R];
+		g = _frames[frame + PREV_G];
+		b = _frames[frame + PREV_B];
+		a = _frames[frame + PREV_A];
+		float frameTime = _frames[frame];
+		float percent = getCurvePercent(frame / ENTRIES - 1,
+										1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime));
+
+		r += (_frames[frame + R] - r) * percent;
+		g += (_frames[frame + G] - g) * percent;
+		b += (_frames[frame + B] - b) * percent;
+		a += (_frames[frame + A] - a) * percent;
+	}
+
+	if (alpha == 1) {
+		slot.getColor().set(r, g, b, a);
+	} else {
+		Color &color = slot.getColor();
+		if (blend == MixBlend_Setup) color.set(slot.getData().getColor());
+		color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);
+	}
+}
+
+int ColorTimeline::getPropertyId() {
+	return ((int) TimelineType_Color << 24) + _slotIndex;
+}
+
+void ColorTimeline::setFrame(int frameIndex, float time, float r, float g, float b, float a) {
+	frameIndex *= ENTRIES;
+	_frames[frameIndex] = time;
+	_frames[frameIndex + R] = r;
+	_frames[frameIndex + G] = g;
+	_frames[frameIndex + B] = b;
+	_frames[frameIndex + A] = a;
+}
+
+int ColorTimeline::getSlotIndex() {
+	return _slotIndex;
+}
+
+void ColorTimeline::setSlotIndex(int inValue) {
+	_slotIndex = inValue;
+}
+
+Vector<float> &ColorTimeline::getFrames() {
+	return _frames;
+}

+ 45 - 0
dependencies/spine/src/spine/Constraint.cpp

@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.
+ *****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/Constraint.h>
+
+using namespace spine;
+
+RTTI_IMPL(Constraint, Updatable)
+
+Constraint::Constraint() {
+}
+
+Constraint::~Constraint() {
+}

+ 129 - 0
dependencies/spine/src/spine/CurveTimeline.cpp

@@ -0,0 +1,129 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/CurveTimeline.h>
+
+#include <spine/MathUtil.h>
+
+using namespace spine;
+
+RTTI_IMPL(CurveTimeline, Timeline)
+
+const float CurveTimeline::LINEAR = 0;
+const float CurveTimeline::STEPPED = 1;
+const float CurveTimeline::BEZIER = 2;
+const int CurveTimeline::BEZIER_SIZE = 10 * 2 - 1;
+
+CurveTimeline::CurveTimeline(int frameCount) {
+	assert(frameCount > 0);
+
+	_curves.setSize((frameCount - 1) * BEZIER_SIZE, 0);
+}
+
+CurveTimeline::~CurveTimeline() {
+}
+
+size_t CurveTimeline::getFrameCount() {
+	return _curves.size() / BEZIER_SIZE + 1;
+}
+
+void CurveTimeline::setLinear(size_t frameIndex) {
+	_curves[frameIndex * BEZIER_SIZE] = LINEAR;
+}
+
+void CurveTimeline::setStepped(size_t frameIndex) {
+	_curves[frameIndex * BEZIER_SIZE] = STEPPED;
+}
+
+void CurveTimeline::setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2) {
+	float tmpx = (-cx1 * 2 + cx2) * 0.03f, tmpy = (-cy1 * 2 + cy2) * 0.03f;
+	float dddfx = ((cx1 - cx2) * 3 + 1) * 0.006f, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006f;
+	float ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;
+	float dfx = cx1 * 0.3f + tmpx + dddfx * 0.16666667f, dfy = cy1 * 0.3f + tmpy + dddfy * 0.16666667f;
+
+	size_t i = frameIndex * BEZIER_SIZE;
+	_curves[i++] = BEZIER;
+
+	float x = dfx, y = dfy;
+	for (size_t n = i + BEZIER_SIZE - 1; i < n; i += 2) {
+		_curves[i] = x;
+		_curves[i + 1] = y;
+		dfx += ddfx;
+		dfy += ddfy;
+		ddfx += dddfx;
+		ddfy += dddfy;
+		x += dfx;
+		y += dfy;
+	}
+}
+
+float CurveTimeline::getCurvePercent(size_t frameIndex, float percent) {
+	percent = MathUtil::clamp(percent, 0, 1);
+	size_t i = frameIndex * BEZIER_SIZE;
+	float type = _curves[i];
+
+	if (type == LINEAR) {
+		return percent;
+	}
+
+	if (type == STEPPED) {
+		return 0;
+	}
+
+	i++;
+	float x = 0;
+	for (size_t start = i, n = i + BEZIER_SIZE - 1; i < n; i += 2) {
+		x = _curves[i];
+		if (x >= percent) {
+			float prevX, prevY;
+			if (i == start) {
+				prevX = 0;
+				prevY = 0;
+			} else {
+				prevX = _curves[i - 2];
+				prevY = _curves[i - 1];
+			}
+
+			return prevY + (_curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);
+		}
+	}
+
+	float y = _curves[i - 1];
+
+	return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
+}
+
+float CurveTimeline::getCurveType(size_t frameIndex) {
+	return _curves[frameIndex * BEZIER_SIZE];
+}

+ 297 - 0
dependencies/spine/src/spine/DeformTimeline.cpp

@@ -0,0 +1,297 @@
+/******************************************************************************
+* 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.
+*****************************************************************************/
+
+#ifdef SPINE_UE4
+#include "SpinePluginPrivatePCH.h"
+#endif
+
+#include <spine/DeformTimeline.h>
+
+#include <spine/Skeleton.h>
+#include <spine/Event.h>
+
+#include <spine/VertexAttachment.h>
+
+#include <spine/Animation.h>
+#include <spine/TimelineType.h>
+#include <spine/Slot.h>
+#include <spine/SlotData.h>
+
+using namespace spine;
+
+RTTI_IMPL(DeformTimeline, CurveTimeline)
+
+DeformTimeline::DeformTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0), _attachment(NULL) {
+	_frames.ensureCapacity(frameCount);
+	_frameVertices.ensureCapacity(frameCount);
+
+	_frames.setSize(frameCount, 0);
+
+	for (int i = 0; i < frameCount; ++i) {
+		Vector<float> vec;
+		_frameVertices.add(vec);
+	}
+}
+
+void DeformTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha,
+						   MixBlend blend, MixDirection direction) {
+	SP_UNUSED(lastTime);
+	SP_UNUSED(pEvents);
+	SP_UNUSED(direction);
+
+	Slot *slotP = skeleton._slots[_slotIndex];
+	Slot &slot = *slotP;
+
+	Attachment *slotAttachment = slot.getAttachment();
+	if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti)) {
+		return;
+	}
+
+	VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+	if (!vertexAttachment->applyDeform(_attachment)) {
+		return;
+	}
+
+	Vector<float> &verticesArray = slot._attachmentVertices;
+	if (verticesArray.size() == 0) {
+		blend = MixBlend_Setup;
+	}
+
+	Vector< Vector<float> > &frameVertices = _frameVertices;
+	size_t vertexCount = frameVertices[0].size();
+
+	Vector<float> &frames = _frames;
+	if (time < _frames[0]) {
+		switch (blend) {
+		case MixBlend_Setup:
+			verticesArray.clear();
+			return;
+		case MixBlend_First: {
+			if (alpha == 1) {
+				verticesArray.clear();
+				return;
+			}
+			verticesArray.setSize(vertexCount, 0);
+			Vector<float> &vertices = verticesArray;
+			if (vertexAttachment->getBones().size() == 0) {
+				// Unweighted vertex positions.
+				Vector<float> &setupVertices = vertexAttachment->getVertices();
+				for (size_t i = 0; i < vertexCount; i++)
+					vertices[i] += (setupVertices[i] - vertices[i]) * alpha;
+			} else {
+				// Weighted deform offsets.
+				alpha = 1 - alpha;
+				for (size_t i = 0; i < vertexCount; i++)
+					vertices[i] *= alpha;
+			}
+		}
+		case MixBlend_Replace:
+		case MixBlend_Add:
+			return;
+		}
+	}
+
+	verticesArray.setSize(vertexCount, 0);
+	Vector<float> &vertices = verticesArray;
+
+	if (time >= frames[frames.size() - 1]) { // Time is after last frame.
+		Vector<float> &lastVertices = frameVertices[frames.size() - 1];
+		if (alpha == 1) {
+			if (blend == MixBlend_Add) {
+				VertexAttachment *vertexAttachment = static_cast<VertexAttachment*>(slotAttachment);
+				if (vertexAttachment->getBones().size() == 0) {
+					// Unweighted vertex positions, no alpha.
+					Vector<float> &setupVertices = vertexAttachment->getVertices();
+					for (size_t i = 0; i < vertexCount; i++)
+						vertices[i] += lastVertices[i] - setupVertices[i];
+				} else {
+					// Weighted deform offsets, no alpha.
+					for (size_t i = 0; i < vertexCount; i++)
+						vertices[i] += lastVertices[i];
+				}
+			} else {
+				// Vertex positions or deform offsets, no alpha.
+				memcpy(vertices.buffer(), lastVertices.buffer(), vertexCount * sizeof(float));
+			}
+		} else {
+			switch (blend) {
+				case MixBlend_Setup: {
+					VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+					if (vertexAttachment->getBones().size() == 0) {
+						// Unweighted vertex positions, with alpha.
+						Vector<float> &setupVertices = vertexAttachment->getVertices();
+						for (size_t i = 0; i < vertexCount; i++) {
+							float setup = setupVertices[i];
+							vertices[i] = setup + (lastVertices[i] - setup) * alpha;
+						}
+					} else {
+						// Weighted deform offsets, with alpha.
+						for (size_t i = 0; i < vertexCount; i++)
+							vertices[i] = lastVertices[i] * alpha;
+					}
+					break;
+				}
+				case MixBlend_First:
+				case MixBlend_Replace:
+					// Vertex positions or deform offsets, with alpha.
+					for (size_t i = 0; i < vertexCount; i++)
+						vertices[i] += (lastVertices[i] - vertices[i]) * alpha;
+					break;
+				case MixBlend_Add:
+					VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+					if (vertexAttachment->getBones().size() == 0) {
+						// Unweighted vertex positions, no alpha.
+						Vector<float> &setupVertices = vertexAttachment->getVertices();
+						for (size_t i = 0; i < vertexCount; i++)
+							vertices[i] += (lastVertices[i] - setupVertices[i]) * alpha;
+					} else {
+						// Weighted deform offsets, alpha.
+						for (size_t i = 0; i < vertexCount; i++)
+							vertices[i] += lastVertices[i] * alpha;
+					}
+			}
+		}
+		return;
+	}
+
+	// Interpolate between the previous frame and the current frame.
+	int frame = Animation::binarySearch(frames, time);
+	Vector<float>  &prevVertices = frameVertices[frame - 1];
+	Vector<float>  &nextVertices = frameVertices[frame];
+	float frameTime = frames[frame];
+	float percent = getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));
+
+	if (alpha == 1) {
+		if (blend == MixBlend_Add) {
+			VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+			if (vertexAttachment->getBones().size() == 0) {
+				// Unweighted vertex positions, no alpha.
+				Vector<float> &setupVertices = vertexAttachment->getVertices();
+				for (size_t i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i];
+					vertices[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];
+				}
+			} else {
+				// Weighted deform offsets, no alpha.
+				for (size_t i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i];
+					vertices[i] += prev + (nextVertices[i] - prev) * percent;
+				}
+			}
+		} else {
+			// Vertex positions or deform offsets, no alpha.
+			for (size_t i = 0; i < vertexCount; i++) {
+				float prev = prevVertices[i];
+				vertices[i] = prev + (nextVertices[i] - prev) * percent;
+			}
+		}
+	} else {
+		switch (blend) {
+			case MixBlend_Setup: {
+				VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+				if (vertexAttachment->getBones().size() == 0) {
+					// Unweighted vertex positions, with alpha.
+					Vector<float> &setupVertices = vertexAttachment->getVertices();
+					for (size_t i = 0; i < vertexCount; i++) {
+						float prev = prevVertices[i], setup = setupVertices[i];
+						vertices[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;
+					}
+				} else {
+					// Weighted deform offsets, with alpha.
+					for (size_t i = 0; i < vertexCount; i++) {
+						float prev = prevVertices[i];
+						vertices[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;
+					}
+				}
+				break;
+			}
+			case MixBlend_First:
+			case MixBlend_Replace:
+				// Vertex positions or deform offsets, with alpha.
+				for (size_t i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i];
+					vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;
+				}
+				break;
+			case MixBlend_Add:
+				VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(slotAttachment);
+				if (vertexAttachment->getBones().size() == 0) {
+					// Unweighted vertex positions, with alpha.
+					Vector<float> &setupVertices = vertexAttachment->getVertices();
+					for (size_t i = 0; i < vertexCount; i++) {
+						float prev = prevVertices[i];
+						vertices[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;
+					}
+				} else {
+					// Weighted deform offsets, with alpha.
+					for (size_t i = 0; i < vertexCount; i++) {
+						float prev = prevVertices[i];
+						vertices[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;
+					}
+				}
+		}
+	}
+}
+
+int DeformTimeline::getPropertyId() {
+	assert(_attachment != NULL);
+
+	return ((int) TimelineType_Deform << 24) + _attachment->_id + _slotIndex;
+}
+
+void DeformTimeline::setFrame(int frameIndex, float time, Vector<float> &vertices) {
+	_frames[frameIndex] = time;
+	_frameVertices[frameIndex].clear();
+	_frameVertices[frameIndex].addAll(vertices);
+}
+
+int DeformTimeline::getSlotIndex() {
+	return _slotIndex;
+}
+
+void DeformTimeline::setSlotIndex(int inValue) {
+	_slotIndex = inValue;
+}
+
+Vector<float> &DeformTimeline::getFrames() {
+	return _frames;
+}
+
+Vector<Vector<float> > &DeformTimeline::getVertices() {
+	return _frameVertices;
+}
+
+VertexAttachment *DeformTimeline::getAttachment() {
+	return _attachment;
+}
+
+void DeformTimeline::setAttachment(VertexAttachment *inValue) {
+	_attachment = inValue;
+}

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