fix bug where vertices > 512 ran out of memory

This commit is contained in:
benfry
2006-03-01 13:28:04 +00:00
parent 5764823818
commit f9144b0f2f
+4 -1
View File
@@ -515,9 +515,12 @@ public class PGraphics3 extends PGraphics {
protected void setup_vertex(float x, float y, float z) {
if (vertexCount == vertices.length) {
float temp[][] = new float[vertexCount<<1][VERTEX_FIELD_COUNT];
float temp[][] = new float[vertexCount << 1][VERTEX_FIELD_COUNT];
System.arraycopy(vertices, 0, temp, 0, vertexCount);
vertices = temp;
int temp2[] = new int[vertexCount << 1];
System.arraycopy(vertex_order, 0, temp2, 0, vertexCount);
vertex_order = temp2;
//message(CHATTER, "allocating more vertices " + vertices.length);
}
float vertex[] = vertices[vertexCount++];