From f9144b0f2f3499b3df042d0e3997cb8a698246c9 Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 1 Mar 2006 13:28:04 +0000 Subject: [PATCH] fix bug where vertices > 512 ran out of memory --- core/PGraphics3.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/PGraphics3.java b/core/PGraphics3.java index 5f6e630c2..c02eb1033 100644 --- a/core/PGraphics3.java +++ b/core/PGraphics3.java @@ -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++];