[csharp] Minor formatting changes.

This commit is contained in:
pharan 2017-04-30 21:33:44 +08:00
parent 1a6c2b8d9f
commit 4c043c0eb6
2 changed files with 23 additions and 26 deletions

View File

@ -32,21 +32,23 @@ using System;
namespace Spine { namespace Spine {
public class SkeletonClipping { public class SkeletonClipping {
private readonly Triangulator triangulator = new Triangulator(); internal readonly Triangulator triangulator = new Triangulator();
private readonly ExposedList<float> clippingPolygon = new ExposedList<float>(); internal readonly ExposedList<float> clippingPolygon = new ExposedList<float>();
private readonly ExposedList<float> clipOutput = new ExposedList<float>(128); internal readonly ExposedList<float> clipOutput = new ExposedList<float>(128);
private readonly ExposedList<float> clippedVertices = new ExposedList<float>(128); internal readonly ExposedList<float> clippedVertices = new ExposedList<float>(128);
private readonly ExposedList<int> clippedTriangles = new ExposedList<int>(128); internal readonly ExposedList<int> clippedTriangles = new ExposedList<int>(128);
private readonly ExposedList<float> clippedUVs = new ExposedList<float>(128); internal readonly ExposedList<float> clippedUVs = new ExposedList<float>(128);
private readonly ExposedList<float> scratch = new ExposedList<float>(); internal readonly ExposedList<float> scratch = new ExposedList<float>();
private ClippingAttachment clipAttachment; internal ClippingAttachment clipAttachment;
private ExposedList<ExposedList<float>> clippingPolygons; internal ExposedList<ExposedList<float>> clippingPolygons;
public ExposedList<float> ClippedVertices { get { return clippedVertices; } } public ExposedList<float> ClippedVertices { get { return clippedVertices; } }
public ExposedList<int> ClippedTriangles { get { return clippedTriangles; } } public ExposedList<int> ClippedTriangles { get { return clippedTriangles; } }
public ExposedList<float> ClippedUVs { get { return clippedUVs; } } public ExposedList<float> ClippedUVs { get { return clippedUVs; } }
public bool IsClipping () { return clipAttachment != null; }
public int ClipStart (Slot slot, ClippingAttachment clip) { public int ClipStart (Slot slot, ClippingAttachment clip) {
if (clipAttachment != null) return 0; if (clipAttachment != null) return 0;
clipAttachment = clip; clipAttachment = clip;
@ -77,12 +79,7 @@ namespace Spine {
clippingPolygon.Clear(); clippingPolygon.Clear();
} }
public bool IsClipping() {
return clipAttachment != null;
}
public void ClipTriangles (float[] vertices, int verticesLength, int[] triangles, int trianglesLength, float[] uvs) { public void ClipTriangles (float[] vertices, int verticesLength, int[] triangles, int trianglesLength, float[] uvs) {
ExposedList<float> clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; ExposedList<float> clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
var clippedTriangles = this.clippedTriangles; var clippedTriangles = this.clippedTriangles;
var polygons = clippingPolygons.Items; var polygons = clippingPolygons.Items;