Преглед изворни кода

Merge branch '3.7-beta' of https://github.com/esotericsoftware/spine-runtimes into 3.7-beta

badlogic пре 7 година
родитељ
комит
486fa7eebf
33 измењених фајлова са 498 додато и 568 уклоњено
  1. 8 1
      CHANGELOG.md
  2. 3 3
      spine-c/spine-c/include/spine/Skeleton.h
  3. 16 35
      spine-c/spine-c/src/spine/Bone.c
  4. 3 0
      spine-c/spine-c/src/spine/Skeleton.c
  5. 5 5
      spine-cpp/spine-cpp/include/spine/Skeleton.h
  6. 15 36
      spine-cpp/spine-cpp/src/spine/Bone.cpp
  7. 10 10
      spine-cpp/spine-cpp/src/spine/Skeleton.cpp
  8. 0 7
      spine-sfml/c/example/main.cpp
  9. 0 6
      spine-sfml/cpp/example/main.cpp
  10. 48 48
      spine-ts/build/spine-all.d.ts
  11. 18 38
      spine-ts/build/spine-all.js
  12. 0 0
      spine-ts/build/spine-all.js.map
  13. 27 27
      spine-ts/build/spine-canvas.d.ts
  14. 18 38
      spine-ts/build/spine-canvas.js
  15. 0 0
      spine-ts/build/spine-canvas.js.map
  16. 22 22
      spine-ts/build/spine-core.d.ts
  17. 18 38
      spine-ts/build/spine-core.js
  18. 0 0
      spine-ts/build/spine-core.js.map
  19. 25 25
      spine-ts/build/spine-threejs.d.ts
  20. 18 38
      spine-ts/build/spine-threejs.js
  21. 0 0
      spine-ts/build/spine-threejs.js.map
  22. 35 35
      spine-ts/build/spine-webgl.d.ts
  23. 18 38
      spine-ts/build/spine-webgl.js
  24. 0 0
      spine-ts/build/spine-webgl.js.map
  25. 40 40
      spine-ts/build/spine-widget.d.ts
  26. 18 38
      spine-ts/build/spine-widget.js
  27. 0 0
      spine-ts/build/spine-widget.js.map
  28. 16 36
      spine-ts/core/src/Bone.ts
  29. 1 1
      spine-ts/core/src/Skeleton.ts
  30. 2 2
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs
  31. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs
  32. 101 0
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs
  33. 12 0
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs.meta

+ 8 - 1
CHANGELOG.md

@@ -4,6 +4,7 @@
 * **Breaking changes**
 * **Breaking changes**
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
   * `MixPose` is now called `MixBlend`
   * `MixPose` is now called `MixBlend`
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
 
 
@@ -25,6 +26,7 @@
 * **Breaking changes**
 * **Breaking changes**
   * Listeners on `spAnimationState` and `spTrackEntry` will now also be called if a track entry gets disposed as part of disposing an animation state.
   * Listeners on `spAnimationState` and `spTrackEntry` will now also be called if a track entry gets disposed as part of disposing an animation state.
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added support for local and relative transform constraint calculation, including additional fields in `spTransformConstraintData`.
   * Added support for local and relative transform constraint calculation, including additional fields in `spTransformConstraintData`.
   * `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
   * `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
@@ -67,8 +69,10 @@
 ## C# ##
 ## C# ##
 * **Breaking changes**
 * **Breaking changes**
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#MixBlend = MixBlend.add` on each track. To specify the blend percentage, set `TrackEntry#Alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#MixBlend = MixBlend.add` on each track. To specify the blend percentage, set `TrackEntry#Alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 
 
 ### Unity
 ### Unity
 * **Runtime and Editor, and Assembly Definition** Files and folders have been reorganized into "Runtime" and "Editor". Each of these have an `.asmdef` file that defines these separately as their own assembly in Unity. For projects not using assembly definition, you may delete the `.asmdef` files. These assembly definitions will be ignored by older versions of Unity that don't support it.
 * **Runtime and Editor, and Assembly Definition** Files and folders have been reorganized into "Runtime" and "Editor". Each of these have an `.asmdef` file that defines these separately as their own assembly in Unity. For projects not using assembly definition, you may delete the `.asmdef` files. These assembly definitions will be ignored by older versions of Unity that don't support it.
@@ -82,7 +86,7 @@
 		* `Spine/Skeleton`
 		* `Spine/Skeleton`
 		* `Spine/Skeleton Tint Black`
 		* `Spine/Skeleton Tint Black`
 		* `Spine/Skeleton Lit`
 		* `Spine/Skeleton Lit`
-		* `Spine/Skeleton Tint`	
+		* `Spine/Skeleton Tint`
 		* `Spine/Skeleton Fill`
 		* `Spine/Skeleton Fill`
 		* `Spine/SkeletonGraphic (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic`
 		* `Spine/SkeletonGraphic (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic`
 		* `Spine/SkeletonGraphic Tint Black (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic Tint Black`
 		* `Spine/SkeletonGraphic Tint Black (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic Tint Black`
@@ -103,6 +107,7 @@
   * Skeleton attachments: Moved update of attached skeleton out of libGDX `SkeletonRenderer`, added overloaded method `Skeleton#updateWorldTransform(Bone)`, used for `SkeletonAttachment`. You now MUST call this new method with the bone of the parent skeleton to which the child skeleton is attached. See `SkeletonAttachmentTest` for and example.
   * Skeleton attachments: Moved update of attached skeleton out of libGDX `SkeletonRenderer`, added overloaded method `Skeleton#updateWorldTransform(Bone)`, used for `SkeletonAttachment`. You now MUST call this new method with the bone of the parent skeleton to which the child skeleton is attached. See `SkeletonAttachmentTest` for and example.
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
   * `MixPose` is now called `MixBlend`.
   * `MixPose` is now called `MixBlend`.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added `EventData#audioPath` field. This field contains the file name of the audio file used for the event.
   * Added `EventData#audioPath` field. This field contains the file name of the audio file used for the event.
   * Added convenience method to add all attachments from one skin to another, see https://github.com/EsotericSoftware/spine-runtimes/commit/a0b7bb6c445efdfac12b0cdee2057afa3eff3ead
   * Added convenience method to add all attachments from one skin to another, see https://github.com/EsotericSoftware/spine-runtimes/commit/a0b7bb6c445efdfac12b0cdee2057afa3eff3ead
@@ -119,6 +124,7 @@
 ## Lua
 ## Lua
 * **Breaking changes**
 * **Breaking changes**
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added `JitterEffect` and `SwirlEffect` and support for vertex effects in Corona and Love
   * Added `JitterEffect` and `SwirlEffect` and support for vertex effects in Corona and Love
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry:setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry.alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry:setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry.alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
@@ -132,6 +138,7 @@
 ## Typescript/Javascript
 ## Typescript/Javascript
 * **Breaking changes**
 * **Breaking changes**
   * The completion event will fire for looped 0 duration animations every frame.
   * The completion event will fire for looped 0 duration animations every frame.
+  * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
 * **Additions**
 * **Additions**
   * Added `AssetManager.loadTextureAtlas`. Instead of loading the `.atlas` and corresponding image files manually, you can simply specify the location of the `.atlas` file and AssetManager will load the atlas and all its images automatically. `AssetManager.get("atlasname.atlas")` will then return an instance of `spine.TextureAtlas`.
   * Added `AssetManager.loadTextureAtlas`. Instead of loading the `.atlas` and corresponding image files manually, you can simply specify the location of the `.atlas` file and AssetManager will load the atlas and all its images automatically. `AssetManager.get("atlasname.atlas")` will then return an instance of `spine.TextureAtlas`.
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. See https://github.com/EsotericSoftware/spine-runtimes/blob/f045d221836fa56191ccda73dd42ae884d4731b8/spine-ts/webgl/tests/test-additive-animation-blending.html for an example.
   * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. See https://github.com/EsotericSoftware/spine-runtimes/blob/f045d221836fa56191ccda73dd42ae884d4731b8/spine-ts/webgl/tests/test-additive-animation-blending.html for an example.

+ 3 - 3
spine-c/spine-c/include/spine/Skeleton.h

@@ -66,7 +66,7 @@ typedef struct spSkeleton {
 	spSkin* const skin;
 	spSkin* const skin;
 	spColor color;
 	spColor color;
 	float time;
 	float time;
-	int/*bool*/flipX, flipY;
+	float scaleX, scaleY;
 	float x, y;
 	float x, y;
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -88,8 +88,8 @@ typedef struct spSkeleton {
 		skin(0),
 		skin(0),
 		color(),
 		color(),
 		time(0),
 		time(0),
-		flipX(0),
-		flipY(0),
+		scaleX(1),
+		scaleY(1),
 		x(0), y(0) {
 		x(0), y(0) {
 	}
 	}
 #endif
 #endif

+ 16 - 35
spine-c/spine-c/src/spine/Bone.c

@@ -65,6 +65,8 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
 	float cosine, sine;
 	float cosine, sine;
 	float pa, pb, pc, pd;
 	float pa, pb, pc, pd;
 	spBone* parent = self->parent;
 	spBone* parent = self->parent;
+	float sx = self->skeleton->scaleX;
+	float sy = self->skeleton->scaleY * (spBone_isYDown() ? -1 : 1);
 
 
 	self->ax = x;
 	self->ax = x;
 	self->ay = y;
 	self->ay = y;
@@ -77,26 +79,12 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
 
 
 	if (!parent) { /* Root bone. */
 	if (!parent) { /* Root bone. */
 		float rotationY = rotation + 90 + shearY;
 		float rotationY = rotation + 90 + shearY;
-		float la = COS_DEG(rotation + shearX) * scaleX;
-		float lb = COS_DEG(rotationY) * scaleY;
-		float lc = SIN_DEG(rotation + shearX) * scaleX;
-		float ld = SIN_DEG(rotationY) * scaleY;
-		if (self->skeleton->flipX) {
-			x = -x;
-			la = -la;
-			lb = -lb;
-		}
-		if (self->skeleton->flipY != yDown) {
-			y = -y;
-			lc = -lc;
-			ld = -ld;
-		}
-		CONST_CAST(float, self->a) = la;
-		CONST_CAST(float, self->b) = lb;
-		CONST_CAST(float, self->c) = lc;
-		CONST_CAST(float, self->d) = ld;
-		CONST_CAST(float, self->worldX) = x + self->skeleton->x;
-		CONST_CAST(float, self->worldY) = y + self->skeleton->y;
+		CONST_CAST(float, self->a) = COS_DEG(rotation + shearX) * scaleX * sx;
+		CONST_CAST(float, self->b) = COS_DEG(rotationY) * scaleY * sy;
+		CONST_CAST(float, self->c) = SIN_DEG(rotation + shearX) * scaleX * sx;
+		CONST_CAST(float, self->d) = SIN_DEG(rotationY) * scaleY * sy;
+		CONST_CAST(float, self->worldX) = x * sx + self->skeleton->x;
+		CONST_CAST(float, self->worldY) = y * sy + self->skeleton->y;
 		return;
 		return;
 	}
 	}
 
 
@@ -159,8 +147,8 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
 			float za, zc, s;
 			float za, zc, s;
 			float r, zb, zd, la, lb, lc, ld;
 			float r, zb, zd, la, lb, lc, ld;
 			cosine = COS_DEG(rotation); sine = SIN_DEG(rotation);
 			cosine = COS_DEG(rotation); sine = SIN_DEG(rotation);
-			za = pa * cosine + pb * sine;
-			zc = pc * cosine + pd * sine;
+			za = (pa * cosine + pb * sine) / sx;
+			zc = (pc * cosine + pd * sine) / sy;
 			s = SQRT(za * za + zc * zc);
 			s = SQRT(za * za + zc * zc);
 			if (s > 0.00001f) s = 1 / s;
 			if (s > 0.00001f) s = 1 / s;
 			za *= s;
 			za *= s;
@@ -173,25 +161,18 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
 			lb = COS_DEG(90 + shearY) * scaleY;
 			lb = COS_DEG(90 + shearY) * scaleY;
 			lc = SIN_DEG(shearX) * scaleX;
 			lc = SIN_DEG(shearX) * scaleX;
 			ld = SIN_DEG(90 + shearY) * scaleY;
 			ld = SIN_DEG(90 + shearY) * scaleY;
-			if (self->data->transformMode != SP_TRANSFORMMODE_NOSCALEORREFLECTION ? pa * pd - pb * pc < 0 : self->skeleton->flipX != self->skeleton->flipY) {
-				zb = -zb;
-				zd = -zd;
-			}
 			CONST_CAST(float, self->a) = za * la + zb * lc;
 			CONST_CAST(float, self->a) = za * la + zb * lc;
 			CONST_CAST(float, self->b) = za * lb + zb * ld;
 			CONST_CAST(float, self->b) = za * lb + zb * ld;
 			CONST_CAST(float, self->c) = zc * la + zd * lc;
 			CONST_CAST(float, self->c) = zc * la + zd * lc;
 			CONST_CAST(float, self->d) = zc * lb + zd * ld;
 			CONST_CAST(float, self->d) = zc * lb + zd * ld;
-			return;
+			break;
 		}
 		}
 	}
 	}
-	if (self->skeleton->flipX) {
-		CONST_CAST(float, self->a) = -self->a;
-		CONST_CAST(float, self->b) = -self->b;
-	}
-	if (self->skeleton->flipY != yDown) {
-		CONST_CAST(float, self->c) = -self->c;
-		CONST_CAST(float, self->d) = -self->d;
-	}
+
+	CONST_CAST(float, self->a) *= sx;
+	CONST_CAST(float, self->b) *= sx;
+	CONST_CAST(float, self->c) *= sy;
+	CONST_CAST(float, self->d) *= sy;
 }
 }
 
 
 void spBone_setToSetupPose (spBone* self) {
 void spBone_setToSetupPose (spBone* self) {

+ 3 - 0
spine-c/spine-c/src/spine/Skeleton.c

@@ -119,6 +119,9 @@ spSkeleton* spSkeleton_create (spSkeletonData* data) {
 
 
 	spColor_setFromFloats(&self->color, 1, 1, 1, 1);
 	spColor_setFromFloats(&self->color, 1, 1, 1, 1);
 
 
+	self->scaleX = 1;
+	self->scaleY = 1;
+
 	spSkeleton_updateCache(self);
 	spSkeleton_updateCache(self);
 
 
 	FREE(childrenCounts);
 	FREE(childrenCounts);

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

@@ -204,13 +204,13 @@ public:
 
 
 	void setY(float inValue);
 	void setY(float inValue);
 
 
-	bool getFlipX();
+	float getScaleX();
 
 
-	void setFlipX(bool inValue);
+	void setScaleX(float inValue);
 
 
-	bool getFlipY();
+	float getScaleY();
 
 
-	void setFlipY(bool inValue);
+	void setScaleY(float inValue);
 
 
 private:
 private:
 	SkeletonData *_data;
 	SkeletonData *_data;
@@ -225,7 +225,7 @@ private:
 	Skin *_skin;
 	Skin *_skin;
 	Color _color;
 	Color _color;
 	float _time;
 	float _time;
-	bool _flipX, _flipY;
+	float _scaleX, _scaleY;
 	float _x, _y;
 	float _x, _y;
 
 
 	void sortIkConstraint(IkConstraint *constraint);
 	void sortIkConstraint(IkConstraint *constraint);

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

@@ -101,26 +101,14 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
 
 
 	if (!parent) { /* Root bone. */
 	if (!parent) { /* Root bone. */
 		float rotationY = rotation + 90 + shearY;
 		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;
-		if (_skeleton.getFlipX()) {
-			x = -x;
-			la = -la;
-			lb = -lb;
-		}
-		if (_skeleton.getFlipY() != yDown) {
-			y = -y;
-			lc = -lc;
-			ld = -ld;
-		}
-		_a = la;
-		_b = lb;
-		_c = lc;
-		_d = ld;
-		_worldX = x + _skeleton.getX();
-		_worldY = y + _skeleton.getY();
+		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;
 		return;
 	}
 	}
 
 
@@ -184,8 +172,8 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
 			float r, zb, zd, la, lb, lc, ld;
 			float r, zb, zd, la, lb, lc, ld;
 			cosine = MathUtil::cosDeg(rotation);
 			cosine = MathUtil::cosDeg(rotation);
 			sine = MathUtil::sinDeg(rotation);
 			sine = MathUtil::sinDeg(rotation);
-			za = pa * cosine + pb * sine;
-			zc = pc * cosine + pd * sine;
+			za = (pa * cosine + pb * sine) / _skeleton.getScaleX();
+			zc = (pc * cosine + pd * sine) / _skeleton.getScaleY();
 			s = MathUtil::sqrt(za * za + zc * zc);
 			s = MathUtil::sqrt(za * za + zc * zc);
 			if (s > 0.00001f) s = 1 / s;
 			if (s > 0.00001f) s = 1 / s;
 			za *= s;
 			za *= s;
@@ -198,26 +186,17 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
 			lb = MathUtil::cosDeg(90 + shearY) * scaleY;
 			lb = MathUtil::cosDeg(90 + shearY) * scaleY;
 			lc = MathUtil::sinDeg(shearX) * scaleX;
 			lc = MathUtil::sinDeg(shearX) * scaleX;
 			ld = MathUtil::sinDeg(90 + shearY) * scaleY;
 			ld = MathUtil::sinDeg(90 + shearY) * scaleY;
-			if (getData().getTransformMode() != TransformMode_NoScaleOrReflection ? pa * pd - pb * pc < 0 :
-				_skeleton.getFlipX() != _skeleton.getFlipY()) {
-				zb = -zb;
-				zd = -zd;
-			}
 			_a = za * la + zb * lc;
 			_a = za * la + zb * lc;
 			_b = za * lb + zb * ld;
 			_b = za * lb + zb * ld;
 			_c = zc * la + zd * lc;
 			_c = zc * la + zd * lc;
 			_d = zc * lb + zd * ld;
 			_d = zc * lb + zd * ld;
-			return;
+			break;
 		}
 		}
 	}
 	}
-	if (_skeleton.getFlipX()) {
-		_a = -_a;
-		_b = -_b;
-	}
-	if (_skeleton.getFlipY() != yDown) {
-		_c = -_c;
-		_d = -_d;
-	}
+	_a *= _skeleton.getScaleX();
+	_b *= _skeleton.getScaleX();
+	_c *= _skeleton.getScaleY();
+	_d *= _skeleton.getScaleY();
 }
 }
 
 
 void Bone::setToSetupPose() {
 void Bone::setToSetupPose() {

+ 10 - 10
spine-cpp/spine-cpp/src/spine/Skeleton.cpp

@@ -57,8 +57,8 @@ Skeleton::Skeleton(SkeletonData *skeletonData) :
 		_skin(NULL),
 		_skin(NULL),
 		_color(1, 1, 1, 1),
 		_color(1, 1, 1, 1),
 		_time(0),
 		_time(0),
-		_flipX(false),
-		_flipY(false),
+		_scaleX(1),
+		_scaleY(1),
 		_x(0),
 		_x(0),
 		_y(0) {
 		_y(0) {
 	_bones.ensureCapacity(_data->getBones().size());
 	_bones.ensureCapacity(_data->getBones().size());
@@ -513,20 +513,20 @@ void Skeleton::setY(float inValue) {
 	_y = inValue;
 	_y = inValue;
 }
 }
 
 
-bool Skeleton::getFlipX() {
-	return _flipX;
+float Skeleton::getScaleX() {
+	return _scaleX;
 }
 }
 
 
-void Skeleton::setFlipX(bool inValue) {
-	_flipX = inValue;
+void Skeleton::setScaleX(float inValue) {
+	_scaleX = inValue;
 }
 }
 
 
-bool Skeleton::getFlipY() {
-	return _flipY;
+float Skeleton::getScaleY() {
+	return _scaleY * (Bone::isYDown() ? -1 : 1);
 }
 }
 
 
-void Skeleton::setFlipY(bool inValue) {
-	_flipY = inValue;
+void Skeleton::setScaleY(float inValue) {
+	_scaleY = inValue;
 }
 }
 
 
 void Skeleton::sortIkConstraint(IkConstraint *constraint) {
 void Skeleton::sortIkConstraint(IkConstraint *constraint) {

+ 0 - 7
spine-sfml/c/example/main.cpp

@@ -119,8 +119,6 @@ void spineboy (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->flipX = false;
-	skeleton->flipY = false;
 	Skeleton_setToSetupPose(skeleton);
 	Skeleton_setToSetupPose(skeleton);
 
 
 	skeleton->x = 320;
 	skeleton->x = 320;
@@ -170,8 +168,6 @@ void goblins (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->flipX = false;
-	skeleton->flipY = false;
 	Skeleton_setSkinByName(skeleton, "goblin");
 	Skeleton_setSkinByName(skeleton, "goblin");
 	Skeleton_setSlotsToSetupPose(skeleton);
 	Skeleton_setSlotsToSetupPose(skeleton);
 	//Skeleton_setAttachment(skeleton, "left hand item", "dagger");
 	//Skeleton_setAttachment(skeleton, "left hand item", "dagger");
@@ -307,9 +303,6 @@ void stretchyman (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->flipX = false;
-	skeleton->flipY = false;
-
 	skeleton->x = 100;
 	skeleton->x = 100;
 	skeleton->y = 590;
 	skeleton->y = 590;
 	Skeleton_updateWorldTransform(skeleton);
 	Skeleton_updateWorldTransform(skeleton);

+ 0 - 6
spine-sfml/cpp/example/main.cpp

@@ -118,8 +118,6 @@ void spineboy (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->setFlipX(false);
-	skeleton->setFlipY(false);
 	skeleton->setToSetupPose();
 	skeleton->setToSetupPose();
 
 
 	skeleton->setPosition(320, 590);
 	skeleton->setPosition(320, 590);
@@ -168,8 +166,6 @@ void goblins (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->setFlipX(false);
-	skeleton->setFlipY(false);
 	skeleton->setSkin("goblin");
 	skeleton->setSkin("goblin");
 	skeleton->setSlotsToSetupPose();
 	skeleton->setSlotsToSetupPose();
 
 
@@ -309,8 +305,6 @@ void stretchyman (SkeletonData* skeletonData, Atlas* atlas) {
 	drawable->timeScale = 1;
 	drawable->timeScale = 1;
 
 
 	Skeleton* skeleton = drawable->skeleton;
 	Skeleton* skeleton = drawable->skeleton;
-	skeleton->setFlipX(false);
-	skeleton->setFlipY(false);
 
 
 	skeleton->setPosition(100, 590);
 	skeleton->setPosition(100, 590);
 	skeleton->updateWorldTransform();
 	skeleton->updateWorldTransform();

+ 48 - 48
spine-ts/build/spine-all.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1256,11 +1256,11 @@ declare module spine.canvas {
 		private tempColor;
 		private tempColor;
 		constructor(context: CanvasRenderingContext2D);
 		constructor(context: CanvasRenderingContext2D);
 		draw(skeleton: Skeleton): void;
 		draw(skeleton: Skeleton): void;
-		private drawImages(skeleton);
-		private drawTriangles(skeleton);
-		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
-		private computeRegionVertices(slot, region, pma);
-		private computeMeshVertices(slot, mesh, pma);
+		private drawImages;
+		private drawTriangles;
+		private drawTriangle;
+		private computeRegionVertices;
+		private computeMeshVertices;
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1315,7 +1315,7 @@ declare module spine.webgl {
 		touchesPool: Pool<Touch>;
 		touchesPool: Pool<Touch>;
 		private listeners;
 		private listeners;
 		constructor(element: HTMLElement);
 		constructor(element: HTMLElement);
-		private setupCallbacks(element);
+		private setupCallbacks;
 		addListener(listener: InputListener): void;
 		addListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 	}
 	}
@@ -1424,7 +1424,7 @@ declare module spine.webgl {
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		bind(shader: Shader): void;
 		bind(shader: Shader): void;
 		unbind(shader: Shader): void;
 		unbind(shader: Shader): void;
-		private update();
+		private update;
 		restore(): void;
 		restore(): void;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -1450,7 +1450,7 @@ declare module spine.webgl {
 		constructor();
 		constructor();
 	}
 	}
 	enum VertexAttributeType {
 	enum VertexAttributeType {
-		Float = 0,
+		Float = 0
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1469,7 +1469,7 @@ declare module spine.webgl {
 		begin(shader: Shader): void;
 		begin(shader: Shader): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
-		private flush();
+		private flush;
 		end(): void;
 		end(): void;
 		getDrawCalls(): number;
 		getDrawCalls(): number;
 		dispose(): void;
 		dispose(): void;
@@ -1509,13 +1509,13 @@ declare module spine.webgl {
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		end(): void;
 		end(): void;
 		resize(resizeMode: ResizeMode): void;
 		resize(resizeMode: ResizeMode): void;
-		private enableRenderer(renderer);
+		private enableRenderer;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ResizeMode {
 	enum ResizeMode {
 		Stretch = 0,
 		Stretch = 0,
 		Expand = 1,
 		Expand = 1,
-		Fit = 2,
+		Fit = 2
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1543,9 +1543,9 @@ declare module spine.webgl {
 		getVertexShaderSource(): string;
 		getVertexShaderSource(): string;
 		getFragmentSource(): string;
 		getFragmentSource(): string;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
-		private compile();
-		private compileShader(type, source);
-		private compileProgram(vs, fs);
+		private compile;
+		private compileShader;
+		private compileProgram;
 		restore(): void;
 		restore(): void;
 		bind(): void;
 		bind(): void;
 		unbind(): void;
 		unbind(): void;
@@ -1592,16 +1592,16 @@ declare module spine.webgl {
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
-		private vertex(x, y, color);
+		private vertex;
 		end(): void;
 		end(): void;
-		private flush();
-		private check(shapeType, numVertices);
+		private flush;
+		private check;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ShapeType {
 	enum ShapeType {
 		Point = 0,
 		Point = 0,
 		Line = 1,
 		Line = 1,
-		Filled = 4,
+		Filled = 4
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1741,9 +1741,9 @@ declare module spine.threejs {
 		private tempColor;
 		private tempColor;
 		constructor(skeletonData: SkeletonData);
 		constructor(skeletonData: SkeletonData);
 		update(deltaTime: number): void;
 		update(deltaTime: number): void;
-		private clearBatches();
-		private nextBatch();
-		private updateGeometry();
+		private clearBatches;
+		private nextBatch;
+		private updateGeometry;
 	}
 	}
 }
 }
 declare module spine.threejs {
 declare module spine.threejs {
@@ -1778,10 +1778,10 @@ declare module spine {
 		private loaded;
 		private loaded;
 		private bounds;
 		private bounds;
 		constructor(element: HTMLElement | string, config: SpineWidgetConfig);
 		constructor(element: HTMLElement | string, config: SpineWidgetConfig);
-		private validateConfig(config);
-		private load();
-		private render();
-		private resize();
+		private validateConfig;
+		private load;
+		private render;
+		private resize;
 		pause(): void;
 		pause(): void;
 		play(): void;
 		play(): void;
 		isPlaying(): boolean;
 		isPlaying(): boolean;
@@ -1789,7 +1789,7 @@ declare module spine {
 		static loadWidgets(): void;
 		static loadWidgets(): void;
 		static loadWidget(widget: HTMLElement): void;
 		static loadWidget(widget: HTMLElement): void;
 		static pageLoaded: boolean;
 		static pageLoaded: boolean;
-		private static ready();
+		private static ready;
 		static setupDOMListener(): void;
 		static setupDOMListener(): void;
 	}
 	}
 	class SpineWidgetConfig {
 	class SpineWidgetConfig {

+ 18 - 38
spine-ts/build/spine-all.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 27 - 27
spine-ts/build/spine-canvas.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1256,10 +1256,10 @@ declare module spine.canvas {
 		private tempColor;
 		private tempColor;
 		constructor(context: CanvasRenderingContext2D);
 		constructor(context: CanvasRenderingContext2D);
 		draw(skeleton: Skeleton): void;
 		draw(skeleton: Skeleton): void;
-		private drawImages(skeleton);
-		private drawTriangles(skeleton);
-		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
-		private computeRegionVertices(slot, region, pma);
-		private computeMeshVertices(slot, mesh, pma);
+		private drawImages;
+		private drawTriangles;
+		private drawTriangle;
+		private computeRegionVertices;
+		private computeMeshVertices;
 	}
 	}
 }
 }

+ 18 - 38
spine-ts/build/spine-canvas.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 22 - 22
spine-ts/build/spine-core.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {

+ 18 - 38
spine-ts/build/spine-core.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 25 - 25
spine-ts/build/spine-threejs.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1275,9 +1275,9 @@ declare module spine.threejs {
 		private tempColor;
 		private tempColor;
 		constructor(skeletonData: SkeletonData);
 		constructor(skeletonData: SkeletonData);
 		update(deltaTime: number): void;
 		update(deltaTime: number): void;
-		private clearBatches();
-		private nextBatch();
-		private updateGeometry();
+		private clearBatches;
+		private nextBatch;
+		private updateGeometry;
 	}
 	}
 }
 }
 declare module spine.threejs {
 declare module spine.threejs {

+ 18 - 38
spine-ts/build/spine-threejs.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 35 - 35
spine-ts/build/spine-webgl.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1284,7 +1284,7 @@ declare module spine.webgl {
 		touchesPool: Pool<Touch>;
 		touchesPool: Pool<Touch>;
 		private listeners;
 		private listeners;
 		constructor(element: HTMLElement);
 		constructor(element: HTMLElement);
-		private setupCallbacks(element);
+		private setupCallbacks;
 		addListener(listener: InputListener): void;
 		addListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 	}
 	}
@@ -1393,7 +1393,7 @@ declare module spine.webgl {
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		bind(shader: Shader): void;
 		bind(shader: Shader): void;
 		unbind(shader: Shader): void;
 		unbind(shader: Shader): void;
-		private update();
+		private update;
 		restore(): void;
 		restore(): void;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -1419,7 +1419,7 @@ declare module spine.webgl {
 		constructor();
 		constructor();
 	}
 	}
 	enum VertexAttributeType {
 	enum VertexAttributeType {
-		Float = 0,
+		Float = 0
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1438,7 +1438,7 @@ declare module spine.webgl {
 		begin(shader: Shader): void;
 		begin(shader: Shader): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
-		private flush();
+		private flush;
 		end(): void;
 		end(): void;
 		getDrawCalls(): number;
 		getDrawCalls(): number;
 		dispose(): void;
 		dispose(): void;
@@ -1478,13 +1478,13 @@ declare module spine.webgl {
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		end(): void;
 		end(): void;
 		resize(resizeMode: ResizeMode): void;
 		resize(resizeMode: ResizeMode): void;
-		private enableRenderer(renderer);
+		private enableRenderer;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ResizeMode {
 	enum ResizeMode {
 		Stretch = 0,
 		Stretch = 0,
 		Expand = 1,
 		Expand = 1,
-		Fit = 2,
+		Fit = 2
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1512,9 +1512,9 @@ declare module spine.webgl {
 		getVertexShaderSource(): string;
 		getVertexShaderSource(): string;
 		getFragmentSource(): string;
 		getFragmentSource(): string;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
-		private compile();
-		private compileShader(type, source);
-		private compileProgram(vs, fs);
+		private compile;
+		private compileShader;
+		private compileProgram;
 		restore(): void;
 		restore(): void;
 		bind(): void;
 		bind(): void;
 		unbind(): void;
 		unbind(): void;
@@ -1561,16 +1561,16 @@ declare module spine.webgl {
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
-		private vertex(x, y, color);
+		private vertex;
 		end(): void;
 		end(): void;
-		private flush();
-		private check(shapeType, numVertices);
+		private flush;
+		private check;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ShapeType {
 	enum ShapeType {
 		Point = 0,
 		Point = 0,
 		Line = 1,
 		Line = 1,
-		Filled = 4,
+		Filled = 4
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {

+ 18 - 38
spine-ts/build/spine-webgl.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-webgl.js.map


+ 40 - 40
spine-ts/build/spine-widget.d.ts

@@ -16,11 +16,11 @@ declare module spine {
 		setup = 0,
 		setup = 0,
 		first = 1,
 		first = 1,
 		replace = 2,
 		replace = 2,
-		add = 3,
+		add = 3
 	}
 	}
 	enum MixDirection {
 	enum MixDirection {
 		in = 0,
 		in = 0,
-		out = 1,
+		out = 1
 	}
 	}
 	enum TimelineType {
 	enum TimelineType {
 		rotate = 0,
 		rotate = 0,
@@ -37,7 +37,7 @@ declare module spine {
 		pathConstraintPosition = 11,
 		pathConstraintPosition = 11,
 		pathConstraintSpacing = 12,
 		pathConstraintSpacing = 12,
 		pathConstraintMix = 13,
 		pathConstraintMix = 13,
-		twoColor = 14,
+		twoColor = 14
 	}
 	}
 	abstract class CurveTimeline implements Timeline {
 	abstract class CurveTimeline implements Timeline {
 		static LINEAR: number;
 		static LINEAR: number;
@@ -336,7 +336,7 @@ declare module spine {
 		end = 2,
 		end = 2,
 		dispose = 3,
 		dispose = 3,
 		complete = 4,
 		complete = 4,
-		event = 5,
+		event = 5
 	}
 	}
 	interface AnimationStateListener2 {
 	interface AnimationStateListener2 {
 		start(entry: TrackEntry): void;
 		start(entry: TrackEntry): void;
@@ -375,8 +375,8 @@ declare module spine {
 		private toLoad;
 		private toLoad;
 		private loaded;
 		private loaded;
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
 		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		private static downloadText(url, success, error);
-		private static downloadBinary(url, success, error);
+		private static downloadText;
+		private static downloadBinary;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
 		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@@ -409,7 +409,7 @@ declare module spine {
 		Normal = 0,
 		Normal = 0,
 		Additive = 1,
 		Additive = 1,
 		Multiply = 2,
 		Multiply = 2,
-		Screen = 3,
+		Screen = 3
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -478,7 +478,7 @@ declare module spine {
 		OnlyTranslation = 1,
 		OnlyTranslation = 1,
 		NoRotationOrReflection = 2,
 		NoRotationOrReflection = 2,
 		NoScale = 3,
 		NoScale = 3,
-		NoScaleOrReflection = 4,
+		NoScaleOrReflection = 4
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -578,17 +578,17 @@ declare module spine {
 	}
 	}
 	enum PositionMode {
 	enum PositionMode {
 		Fixed = 0,
 		Fixed = 0,
-		Percent = 1,
+		Percent = 1
 	}
 	}
 	enum SpacingMode {
 	enum SpacingMode {
 		Length = 0,
 		Length = 0,
 		Fixed = 1,
 		Fixed = 1,
-		Percent = 2,
+		Percent = 2
 	}
 	}
 	enum RotateMode {
 	enum RotateMode {
 		Tangent = 0,
 		Tangent = 0,
 		Chain = 1,
 		Chain = 1,
-		ChainScale = 2,
+		ChainScale = 2
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -599,12 +599,12 @@ declare module spine {
 		private rawAssets;
 		private rawAssets;
 		private errors;
 		private errors;
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
-		private queueAsset(clientId, textureLoader, path);
+		private queueAsset;
 		loadText(clientId: string, path: string): void;
 		loadText(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadJson(clientId: string, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
 		get(clientId: string, path: string): any;
 		get(clientId: string, path: string): any;
-		private updateClientAssets(clientAssets);
+		private updateClientAssets;
 		isLoadingComplete(clientId: string): boolean;
 		isLoadingComplete(clientId: string): boolean;
 		dispose(): void;
 		dispose(): void;
 		hasErrors(): boolean;
 		hasErrors(): boolean;
@@ -625,8 +625,8 @@ declare module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time: number;
 		time: number;
-		flipX: boolean;
-		flipY: boolean;
+		scaleX: number;
+		scaleY: number;
 		x: number;
 		x: number;
 		y: number;
 		y: number;
 		constructor(data: SkeletonData);
 		constructor(data: SkeletonData);
@@ -808,12 +808,12 @@ declare module spine {
 		MipMapNearestNearest = 9984,
 		MipMapNearestNearest = 9984,
 		MipMapLinearNearest = 9985,
 		MipMapLinearNearest = 9985,
 		MipMapNearestLinear = 9986,
 		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
+		MipMapLinearLinear = 9987
 	}
 	}
 	enum TextureWrap {
 	enum TextureWrap {
 		MirroredRepeat = 33648,
 		MirroredRepeat = 33648,
 		ClampToEdge = 33071,
 		ClampToEdge = 33071,
-		Repeat = 10497,
+		Repeat = 10497
 	}
 	}
 	class TextureRegion {
 	class TextureRegion {
 		renderObject: any;
 		renderObject: any;
@@ -840,7 +840,7 @@ declare module spine {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
 		regions: TextureAtlasRegion[];
 		regions: TextureAtlasRegion[];
 		constructor(atlasText: string, textureLoader: (path: string) => any);
 		constructor(atlasText: string, textureLoader: (path: string) => any);
-		private load(atlasText, textureLoader);
+		private load;
 		findRegion(name: string): TextureAtlasRegion;
 		findRegion(name: string): TextureAtlasRegion;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -916,9 +916,9 @@ declare module spine {
 		private polygonIndicesPool;
 		private polygonIndicesPool;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		triangulate(verticesArray: ArrayLike<number>): Array<number>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
 		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-		private static isConcave(index, vertexCount, vertices, indices);
-		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static isConcave;
+		private static positiveArea;
+		private static winding;
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1090,7 +1090,7 @@ declare module spine {
 		Mesh = 2,
 		Mesh = 2,
 		LinkedMesh = 3,
 		LinkedMesh = 3,
 		Path = 4,
 		Path = 4,
-		Point = 5,
+		Point = 5
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1284,7 +1284,7 @@ declare module spine.webgl {
 		touchesPool: Pool<Touch>;
 		touchesPool: Pool<Touch>;
 		private listeners;
 		private listeners;
 		constructor(element: HTMLElement);
 		constructor(element: HTMLElement);
-		private setupCallbacks(element);
+		private setupCallbacks;
 		addListener(listener: InputListener): void;
 		addListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 		removeListener(listener: InputListener): void;
 	}
 	}
@@ -1393,7 +1393,7 @@ declare module spine.webgl {
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
 		bind(shader: Shader): void;
 		bind(shader: Shader): void;
 		unbind(shader: Shader): void;
 		unbind(shader: Shader): void;
-		private update();
+		private update;
 		restore(): void;
 		restore(): void;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
@@ -1419,7 +1419,7 @@ declare module spine.webgl {
 		constructor();
 		constructor();
 	}
 	}
 	enum VertexAttributeType {
 	enum VertexAttributeType {
-		Float = 0,
+		Float = 0
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1438,7 +1438,7 @@ declare module spine.webgl {
 		begin(shader: Shader): void;
 		begin(shader: Shader): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		setBlendMode(srcBlend: number, dstBlend: number): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
 		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
-		private flush();
+		private flush;
 		end(): void;
 		end(): void;
 		getDrawCalls(): number;
 		getDrawCalls(): number;
 		dispose(): void;
 		dispose(): void;
@@ -1478,13 +1478,13 @@ declare module spine.webgl {
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		end(): void;
 		end(): void;
 		resize(resizeMode: ResizeMode): void;
 		resize(resizeMode: ResizeMode): void;
-		private enableRenderer(renderer);
+		private enableRenderer;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ResizeMode {
 	enum ResizeMode {
 		Stretch = 0,
 		Stretch = 0,
 		Expand = 1,
 		Expand = 1,
-		Fit = 2,
+		Fit = 2
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1512,9 +1512,9 @@ declare module spine.webgl {
 		getVertexShaderSource(): string;
 		getVertexShaderSource(): string;
 		getFragmentSource(): string;
 		getFragmentSource(): string;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
-		private compile();
-		private compileShader(type, source);
-		private compileProgram(vs, fs);
+		private compile;
+		private compileShader;
+		private compileProgram;
 		restore(): void;
 		restore(): void;
 		bind(): void;
 		bind(): void;
 		unbind(): void;
 		unbind(): void;
@@ -1561,16 +1561,16 @@ declare module spine.webgl {
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
 		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
-		private vertex(x, y, color);
+		private vertex;
 		end(): void;
 		end(): void;
-		private flush();
-		private check(shapeType, numVertices);
+		private flush;
+		private check;
 		dispose(): void;
 		dispose(): void;
 	}
 	}
 	enum ShapeType {
 	enum ShapeType {
 		Point = 0,
 		Point = 0,
 		Line = 1,
 		Line = 1,
-		Filled = 4,
+		Filled = 4
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1688,10 +1688,10 @@ declare module spine {
 		private loaded;
 		private loaded;
 		private bounds;
 		private bounds;
 		constructor(element: HTMLElement | string, config: SpineWidgetConfig);
 		constructor(element: HTMLElement | string, config: SpineWidgetConfig);
-		private validateConfig(config);
-		private load();
-		private render();
-		private resize();
+		private validateConfig;
+		private load;
+		private render;
+		private resize;
 		pause(): void;
 		pause(): void;
 		play(): void;
 		play(): void;
 		isPlaying(): boolean;
 		isPlaying(): boolean;
@@ -1699,7 +1699,7 @@ declare module spine {
 		static loadWidgets(): void;
 		static loadWidgets(): void;
 		static loadWidget(widget: HTMLElement): void;
 		static loadWidget(widget: HTMLElement): void;
 		static pageLoaded: boolean;
 		static pageLoaded: boolean;
-		private static ready();
+		private static ready;
 		static setupDOMListener(): void;
 		static setupDOMListener(): void;
 	}
 	}
 	class SpineWidgetConfig {
 	class SpineWidgetConfig {

+ 18 - 38
spine-ts/build/spine-widget.js

@@ -2358,28 +2358,16 @@ var spine;
 			this.appliedValid = true;
 			this.appliedValid = true;
 			var parent = this.parent;
 			var parent = this.parent;
 			if (parent == null) {
 			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
 				var skeleton = this.skeleton;
 				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				var rotationY = rotation + 90 + shearY;
+				var sx = skeleton.scaleX;
+				var sy = skeleton.scaleY;
+				this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
 			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
@@ -2436,8 +2424,8 @@ var spine;
 				case spine.TransformMode.NoScaleOrReflection: {
 				case spine.TransformMode.NoScaleOrReflection: {
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var cos = spine.MathUtils.cosDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
 					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
+					var za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+					var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 					var s = Math.sqrt(za * za + zc * zc);
 					var s = Math.sqrt(za * za + zc * zc);
 					if (s > 0.00001)
 					if (s > 0.00001)
 						s = 1 / s;
 						s = 1 / s;
@@ -2451,25 +2439,17 @@ var spine;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
 					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						zb = -zb;
-						zd = -zd;
-					}
 					this.a = za * la + zb * lc;
 					this.a = za * la + zb * lc;
 					this.b = za * lb + zb * ld;
 					this.b = za * lb + zb * ld;
 					this.c = zc * la + zd * lc;
 					this.c = zc * la + zd * lc;
 					this.d = zc * lb + zd * ld;
 					this.d = zc * lb + zd * ld;
-					return;
+					break;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		};
 		};
 		Bone.prototype.setToSetupPose = function () {
 		Bone.prototype.setToSetupPose = function () {
 			var data = this.data;
 			var data = this.data;
@@ -3386,8 +3366,8 @@ var spine;
 			this._updateCache = new Array();
 			this._updateCache = new Array();
 			this.updateCacheReset = new Array();
 			this.updateCacheReset = new Array();
 			this.time = 0;
 			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
+			this.scaleX = 1;
+			this.scaleY = 1;
 			this.x = 0;
 			this.x = 0;
 			this.y = 0;
 			this.y = 0;
 			if (data == null)
 			if (data == null)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
spine-ts/build/spine-widget.js.map


+ 16 - 36
spine-ts/core/src/Bone.ts

@@ -76,28 +76,16 @@ module spine {
 
 
 			let parent = this.parent;
 			let parent = this.parent;
 			if (parent == null) { // Root bone.
 			if (parent == null) { // Root bone.
-				let rotationY = rotation + 90 + shearY;
-				let la = MathUtils.cosDeg(rotation + shearX) * scaleX;
-				let lb = MathUtils.cosDeg(rotationY) * scaleY;
-				let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;
-				let ld = MathUtils.sinDeg(rotationY) * scaleY;
 				let skeleton = this.skeleton;
 				let skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
-				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
+				let rotationY = rotation + 90 + shearY;
+				let sx = skeleton.scaleX;
+				let sy = skeleton.scaleY;
+				this.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
+				this.b = MathUtils.cosDeg(rotationY) * scaleY * sy;
+				this.c = MathUtils.sinDeg(rotation + shearX) * scaleX * sx;
+				this.d = MathUtils.sinDeg(rotationY) * scaleY * sy;
+				this.worldX = x * sx + skeleton.x;
+				this.worldY = y * sy + skeleton.y;
 				return;
 				return;
 			}
 			}
 
 
@@ -155,8 +143,8 @@ module spine {
 			case TransformMode.NoScaleOrReflection: {
 			case TransformMode.NoScaleOrReflection: {
 				let cos = MathUtils.cosDeg(rotation);
 				let cos = MathUtils.cosDeg(rotation);
 				let sin = MathUtils.sinDeg(rotation);
 				let sin = MathUtils.sinDeg(rotation);
-				let za = pa * cos + pb * sin;
-				let zc = pc * cos + pd * sin;
+				let za = (pa * cos + pb * sin) / this.skeleton.scaleX;
+				let zc = (pc * cos + pd * sin) / this.skeleton.scaleY;
 				let s = Math.sqrt(za * za + zc * zc);
 				let s = Math.sqrt(za * za + zc * zc);
 				if (s > 0.00001) s = 1 / s;
 				if (s > 0.00001) s = 1 / s;
 				za *= s;
 				za *= s;
@@ -169,25 +157,17 @@ module spine {
 				let lb = MathUtils.cosDeg(90 + shearY) * scaleY;
 				let lb = MathUtils.cosDeg(90 + shearY) * scaleY;
 				let lc = MathUtils.sinDeg(shearX) * scaleX;
 				let lc = MathUtils.sinDeg(shearX) * scaleX;
 				let ld = MathUtils.sinDeg(90 + shearY) * scaleY;
 				let ld = MathUtils.sinDeg(90 + shearY) * scaleY;
-				if (this.data.transformMode != TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-					zb = -zb;
-					zd = -zd;
-				}
 				this.a = za * la + zb * lc;
 				this.a = za * la + zb * lc;
 				this.b = za * lb + zb * ld;
 				this.b = za * lb + zb * ld;
 				this.c = zc * la + zd * lc;
 				this.c = zc * la + zd * lc;
 				this.d = zc * lb + zd * ld;
 				this.d = zc * lb + zd * ld;
-				return;
-			}
-			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
+				break;
 			}
 			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
 			}
 			}
+			this.a *= this.skeleton.scaleX;
+			this.b *= this.skeleton.scaleX;
+			this.c *= this.skeleton.scaleY;
+			this.d *= this.skeleton.scaleY;
 		}
 		}
 
 
 		setToSetupPose () {
 		setToSetupPose () {

+ 1 - 1
spine-ts/core/src/Skeleton.ts

@@ -42,7 +42,7 @@ module spine {
 		skin: Skin;
 		skin: Skin;
 		color: Color;
 		color: Color;
 		time = 0;
 		time = 0;
-		flipX = false; flipY = false;
+		scaleX = 1; scaleY = 1;
 		x = 0; y = 0;
 		x = 0; y = 0;
 
 
 		constructor (data: SkeletonData) {
 		constructor (data: SkeletonData) {

+ 2 - 2
spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs

@@ -229,8 +229,8 @@ namespace Spine.Unity.Editor {
 
 
 		void CreateAnimationReferenceAssets () {
 		void CreateAnimationReferenceAssets () {
 			const string AssetFolderName = "ReferenceAssets";
 			const string AssetFolderName = "ReferenceAssets";
-			string parentFolder = AssetDatabase.GetAssetPath(targetSkeletonDataAsset);
-			string dataPath = System.IO.Path.GetDirectoryName(parentFolder) + "/" + AssetFolderName;
+			string parentFolder = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(targetSkeletonDataAsset));
+			string dataPath = parentFolder + "/" + AssetFolderName;
 			if (!AssetDatabase.IsValidFolder(dataPath)) {
 			if (!AssetDatabase.IsValidFolder(dataPath)) {
 				AssetDatabase.CreateFolder(parentFolder, AssetFolderName);
 				AssetDatabase.CreateFolder(parentFolder, AssetFolderName);
 			}
 			}

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs

@@ -188,7 +188,7 @@ namespace Spine.Unity {
 
 
 		#region API
 		#region API
 		protected Skeleton skeleton;
 		protected Skeleton skeleton;
-		public Skeleton Skeleton { get { return skeleton; } }
+		public Skeleton Skeleton { get { return skeleton; } internal set { skeleton = value; } }
 		public SkeletonData SkeletonData { get { return skeleton == null ? null : skeleton.data; } }
 		public SkeletonData SkeletonData { get { return skeleton == null ? null : skeleton.data; } }
 		public bool IsValid { get { return skeleton != null; } }
 		public bool IsValid { get { return skeleton != null; } }
 
 

+ 101 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs

@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.
+ *****************************************************************************/
+
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Spine.Unity.Modules {
+	public class SkeletonGraphicMirror : MonoBehaviour {
+
+		public SkeletonRenderer source;
+		public bool mirrorOnStart = true;
+		public bool restoreOnDisable = true;
+		SkeletonGraphic skeletonGraphic;
+
+		Skeleton originalSkeleton;
+		bool originalFreeze;
+		Texture2D overrideTexture;
+
+		private void Awake () {
+			skeletonGraphic = GetComponent<SkeletonGraphic>();
+		}
+
+		void Start () {
+			if (mirrorOnStart) StartMirroring();
+		}
+
+		void LateUpdate () {
+			skeletonGraphic.UpdateMesh();
+		}
+
+		void OnDisable () {
+			if (restoreOnDisable) RestoreIndependentSkeleton();
+		}
+
+		/// <summary>Freeze the SkeletonGraphic on this GameObject, and use the source as the Skeleton to be rendered by the SkeletonGraphic.</summary>
+		public void StartMirroring () {
+			if (source == null) return;
+			if (skeletonGraphic == null) return;
+
+			skeletonGraphic.startingAnimation = string.Empty;
+
+			if (originalSkeleton == null) {
+				originalSkeleton = skeletonGraphic.Skeleton;
+				originalFreeze = skeletonGraphic.freeze;
+			}
+
+			skeletonGraphic.Skeleton = source.skeleton;
+			skeletonGraphic.freeze = true;
+			if (overrideTexture != null)
+				skeletonGraphic.OverrideTexture = overrideTexture;
+		}
+
+		/// <summary>Use a new texture for the SkeletonGraphic. Use this if your source skeleton uses a repacked atlas. </summary>
+		public void UpdateTexture (Texture2D newOverrideTexture) {
+			overrideTexture = newOverrideTexture;
+			if (newOverrideTexture != null)
+				skeletonGraphic.OverrideTexture = overrideTexture;
+		}
+
+		/// <summary>Stops mirroring the source SkeletonRenderer and allows the SkeletonGraphic to become an independent Skeleton component again.</summary>
+		public void RestoreIndependentSkeleton () {
+			if (originalSkeleton == null)
+				return;
+
+			skeletonGraphic.Skeleton = originalSkeleton;
+			skeletonGraphic.freeze = originalFreeze;
+			skeletonGraphic.OverrideTexture = null;
+
+			originalSkeleton = null;
+		}
+	}
+
+}

+ 12 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dbeb0b9949e46754eb0e0b61021b4f1c
+timeCreated: 1532024358
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Неке датотеке нису приказане због велике количине промена