mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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;
|
return clipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MakeClockwise (ExposedList<float> polygon) {
|
public static void MakeClockwise (ExposedList<float> polygon) {
|
||||||
float[] vertices = polygon.Items;
|
float[] vertices = polygon.Items;
|
||||||
int verticeslength = polygon.Count;
|
int verticeslength = polygon.Count;
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Spine {
|
namespace Spine {
|
||||||
internal class Triangulator {
|
public class Triangulator {
|
||||||
private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
|
private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
|
||||||
private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();
|
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;
|
float alpha = texColor.a * input.Color.a;
|
||||||
float4 output;
|
float4 output;
|
||||||
output.a = alpha;
|
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;
|
return output;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,10 +85,10 @@ namespace Spine {
|
|||||||
skeletonDebugRenderer.DrawClipping = true;
|
skeletonDebugRenderer.DrawClipping = true;
|
||||||
|
|
||||||
// String name = "spineboy-ess";
|
// String name = "spineboy-ess";
|
||||||
String name = "goblins-pro";
|
// String name = "goblins-pro";
|
||||||
// String name = "raptor-pro";
|
// String name = "raptor-pro";
|
||||||
// String name = "tank-pro";
|
// String name = "tank-pro";
|
||||||
// String name = "coin-pro";
|
String name = "coin-pro";
|
||||||
String atlasName = name.Replace("-pro", "").Replace("-ess", "");
|
String atlasName = name.Replace("-pro", "").Replace("-ess", "");
|
||||||
if (name == "goblins-pro") atlasName = "goblins-mesh";
|
if (name == "goblins-pro") atlasName = "goblins-mesh";
|
||||||
bool binaryData = false;
|
bool binaryData = false;
|
||||||
|
|||||||
@ -163,8 +163,13 @@ namespace Spine {
|
|||||||
|
|
||||||
Color darkColor = new Color();
|
Color darkColor = new Color();
|
||||||
if (slot.HasSecondColor) {
|
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
|
// clip
|
||||||
if (clipper.IsClipping()) {
|
if (clipper.IsClipping()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user