Tessellator: formatting, dbg--

This commit is contained in:
Hannes Janetzek 2013-09-28 22:41:43 +02:00
parent f807e003fd
commit 7ef611945d

View File

@ -125,13 +125,17 @@ public class Tessellator {
break; break;
} }
long ctx = Tessellator.tessellate(geom.points, 0, geom.index, 0, numRings, result); long ctx = Tessellator.tessellate(geom.points, 0,
geom.index, 0,
numRings, result);
Log.d(TAG, "got " + result[RESULT_VERTICES] + " " + result[RESULT_TRIANGLES]); //Log.d(TAG, "got "
// + result[RESULT_VERTICES] + " "
// + result[RESULT_TRIANGLES]);
boolean verticesAdded = false; boolean verticesAdded = false;
if (numPoints < result[RESULT_VERTICES] * 2) { if (numPoints < result[RESULT_VERTICES] * 2) {
Log.d(TAG, "grow vertices" + geom.pointPos); //Log.d(TAG, "grow vertices" + geom.pointPos);
verticesAdded = true; verticesAdded = true;
} }
@ -188,6 +192,7 @@ public class Tessellator {
numRings++; numRings++;
numPoints += (geom.index[i]) / 2; numPoints += (geom.index[i]) / 2;
} }
if (numRings == 0 || numPoints == 0) { if (numRings == 0 || numPoints == 0) {
Log.d(TAG, "missing " + numPoints + ":" + numRings); Log.d(TAG, "missing " + numPoints + ":" + numRings);
return 0; return 0;
@ -212,7 +217,6 @@ public class Tessellator {
outPoints.vertices, outPoints.vertices,
outPoints.used, outPoints.used,
scale)) > 0) { scale)) > 0) {
outPoints.used += cnt; outPoints.used += cnt;
if (outPoints.used == VertexItem.SIZE) { if (outPoints.used == VertexItem.SIZE) {
@ -234,7 +238,6 @@ public class Tessellator {
while ((cnt = Tessellator.tessGetIndicesWO(ctx, while ((cnt = Tessellator.tessGetIndicesWO(ctx,
outTris.vertices, outTris.vertices,
outTris.used)) > 0) { outTris.used)) > 0) {
// shift by vertexOffset // shift by vertexOffset
for (int pos = outTris.used, end = pos + cnt; pos < end; pos++) for (int pos = outTris.used, end = pos + cnt; pos < end; pos++)
outTris.vertices[pos] += vertexOffset; outTris.vertices[pos] += vertexOffset;