[cs][xna] Fixed tint black, see #1003. Opened up Triangulator and SkeletonClipping for debug rendering.

This commit is contained in:
badlogic 2017-10-13 14:12:57 +02:00
parent 9cb8745deb
commit 791d813bf1
5 changed files with 11 additions and 6 deletions

View File

@ -258,7 +258,7 @@ namespace Spine {
return clipped;
}
static void MakeClockwise (ExposedList<float> polygon) {
public static void MakeClockwise (ExposedList<float> polygon) {
float[] vertices = polygon.Items;
int verticeslength = polygon.Count;

View File

@ -31,7 +31,7 @@
using System;
namespace Spine {
internal class Triangulator {
public class Triangulator {
private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();

View File

@ -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;
}

View File

@ -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;

View File

@ -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()) {