This commit is contained in:
badlogic 2017-05-24 13:25:29 +02:00
commit b7efbb74eb

View File

@ -1,4 +1,4 @@
/****************************************************************************** /******************************************************************************
* Spine Runtimes Software License v2.5 * Spine Runtimes Software License v2.5
* *
* Copyright (c) 2013-2016, Esoteric Software * Copyright (c) 2013-2016, Esoteric Software
@ -64,8 +64,9 @@ namespace Spine {
while (vertexCount > 3) { while (vertexCount > 3) {
// Find ear tip. // Find ear tip.
int previous = vertexCount - 1, i = 0, next = 1; int previous = vertexCount - 1, i = 0, next = 1;
// outer:
while (true) { while (true) {
outer:
if (!isConcave[i]) { if (!isConcave[i]) {
int p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; int p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;
float p1x = vertices[p1], p1y = vertices[p1 + 1]; float p1x = vertices[p1], p1y = vertices[p1 + 1];
@ -77,7 +78,7 @@ namespace Spine {
float vx = vertices[v], vy = vertices[v + 1]; float vx = vertices[v], vy = vertices[v + 1];
if (PositiveArea(p3x, p3y, p1x, p1y, vx, vy)) { if (PositiveArea(p3x, p3y, p1x, p1y, vx, vy)) {
if (PositiveArea(p1x, p1y, p2x, p2y, vx, vy)) { if (PositiveArea(p1x, p1y, p2x, p2y, vx, vy)) {
if (PositiveArea(p2x, p2y, p3x, p3y, vx, vy)) goto outer; if (PositiveArea(p2x, p2y, p3x, p3y, vx, vy)) goto outer; // break outer;
} }
} }
} }
@ -96,6 +97,7 @@ namespace Spine {
i = next; i = next;
next = (next + 1) % vertexCount; next = (next + 1) % vertexCount;
} }
outer:
// Cut ear tip. // Cut ear tip.
triangles.Add(indices[(vertexCount + i - 1) % vertexCount]); triangles.Add(indices[(vertexCount + i - 1) % vertexCount]);