improve Tessellator, no more 'synchronized' needed

- pass VertexItem arrays to tessGetVertices/Indices until
  everything is fetched
- re-reverse vertices in jni
This commit is contained in:
Hannes Janetzek
2013-09-25 02:50:48 +02:00
parent 768df7f6d6
commit 836f6a60e0
6 changed files with 291 additions and 71 deletions

View File

@@ -1,6 +1,7 @@
package org.oscim.utils;
import org.oscim.backend.Log;
import org.oscim.core.GeometryBuffer;
import org.oscim.renderer.elements.VertexItem;
import com.google.gwt.core.client.JavaScriptException;
@@ -11,7 +12,7 @@ import com.google.gwt.typedarrays.shared.Int32Array;
public class Tessellator {
public static synchronized int triangulate(float[] points, int ppos, int plen, short[] index,
public static int tessellate(float[] points, int ppos, int plen, short[] index,
int ipos, int rings, int vertexOffset, VertexItem outTris) {
//JavaScriptObject o;
@@ -68,6 +69,15 @@ public class Tessellator {
return numIndices;
}
public static int tessellate(GeometryBuffer geom, GeometryBuffer out) {
return 0;
}
public static int tessellate(GeometryBuffer geom, float scale,
VertexItem outPoints, VertexItem outTris, int vertexOffset) {
return 0;
}
static native Int32Array tessellate(JsArrayNumber points, int pOffset, int pLength,
JsArrayInteger bounds, int bOffset, int bLength)/*-{