mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
[cs][xna] Fixed tint black, see #1003. Opened up Triangulator and SkeletonClipping for debug rendering.
This commit is contained in:
parent
9cb8745deb
commit
791d813bf1
@ -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;
|
||||
|
||||
|
||||
@ -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>>();
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user