diff --git a/spine-csharp/src/SkeletonClipping.cs b/spine-csharp/src/SkeletonClipping.cs index 07d052895..1dcbb0a0e 100644 --- a/spine-csharp/src/SkeletonClipping.cs +++ b/spine-csharp/src/SkeletonClipping.cs @@ -258,7 +258,7 @@ namespace Spine { return clipped; } - static void MakeClockwise (ExposedList polygon) { + public static void MakeClockwise (ExposedList polygon) { float[] vertices = polygon.Items; int verticeslength = polygon.Count; diff --git a/spine-csharp/src/Triangulator.cs b/spine-csharp/src/Triangulator.cs index c4bdb0418..ad9f39ee2 100644 --- a/spine-csharp/src/Triangulator.cs +++ b/spine-csharp/src/Triangulator.cs @@ -31,7 +31,7 @@ using System; namespace Spine { - internal class Triangulator { + public class Triangulator { private readonly ExposedList> convexPolygons = new ExposedList>(); private readonly ExposedList> convexPolygonsIndices = new ExposedList>(); diff --git a/spine-xna/example-content/SpineEffect.fx b/spine-xna/example-content/SpineEffect.fx index 565709b37..38d1ef0be 100644 --- a/spine-xna/example-content/SpineEffect.fx +++ b/spine-xna/example-content/SpineEffect.fx @@ -42,7 +42,7 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float alpha = texColor.a * input.Color.a; float4 output; output.a = alpha; - output.rgb = (1.0 - texColor.rgb) * input.Color2.rgb * alpha + texColor.rgb * input.Color.rgb; + output.rgb = ((texColor.a - 1.0) * input.Color2.a + 1.0 - texColor.rgb) * input.Color2.rgb + texColor.rgb * input.Color.rgb; return output; } diff --git a/spine-xna/example/src/ExampleGame.cs b/spine-xna/example/src/ExampleGame.cs index aa81a027f..a7b251457 100644 --- a/spine-xna/example/src/ExampleGame.cs +++ b/spine-xna/example/src/ExampleGame.cs @@ -85,10 +85,10 @@ namespace Spine { skeletonDebugRenderer.DrawClipping = true; // String name = "spineboy-ess"; - String name = "goblins-pro"; + // String name = "goblins-pro"; // String name = "raptor-pro"; // String name = "tank-pro"; - // String name = "coin-pro"; + String name = "coin-pro"; String atlasName = name.Replace("-pro", "").Replace("-ess", ""); if (name == "goblins-pro") atlasName = "goblins-mesh"; bool binaryData = false; diff --git a/spine-xna/src/SkeletonRenderer.cs b/spine-xna/src/SkeletonRenderer.cs index 8f105dec1..0c1a83c6c 100644 --- a/spine-xna/src/SkeletonRenderer.cs +++ b/spine-xna/src/SkeletonRenderer.cs @@ -163,8 +163,13 @@ namespace Spine { Color darkColor = new Color(); if (slot.HasSecondColor) { - darkColor = new Color(slot.R2, slot.G2, slot.B2); + if (premultipliedAlpha) { + darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a); + } else { + darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a); + } } + darkColor.A = premultipliedAlpha ? (byte)255 : (byte)0; // clip if (clipper.IsClipping()) {