Improve code / xml formatting, #54
This commit is contained in:
parent
e793e8851b
commit
43ca550832
@ -6,7 +6,7 @@ import com.badlogic.gdx.jnigen.NativeCodeGenerator;
|
|||||||
|
|
||||||
public class JniBuilder {
|
public class JniBuilder {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
String[] headers = { ".", "libtess2/Include" };
|
String[] headers = {".", "libtess2/Include"};
|
||||||
String[] sources = {
|
String[] sources = {
|
||||||
"gl/utils.c",
|
"gl/utils.c",
|
||||||
"libtess2/Source/bucketalloc.c",
|
"libtess2/Source/bucketalloc.c",
|
||||||
|
@ -148,9 +148,11 @@ public class TessJNI {
|
|||||||
//ma.extraVertices = 256;
|
//ma.extraVertices = 256;
|
||||||
return (long)tessNewTess(&ma);
|
return (long)tessNewTess(&ma);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
static native void freeTess(long inst); /* {
|
static native void freeTess(long inst); /* {
|
||||||
tessDeleteTess((TESStesselator*) inst);
|
tessDeleteTess((TESStesselator*) inst);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a contour to be tesselated.
|
* Adds a contour to be tesselated.
|
||||||
* The type of the vertex coordinates is assumed to be TESSreal.
|
* The type of the vertex coordinates is assumed to be TESSreal.
|
||||||
@ -164,6 +166,7 @@ public class TessJNI {
|
|||||||
static native void addContour(long inst, int size, float[] contour, int stride, int offset, int count);/* {
|
static native void addContour(long inst, int size, float[] contour, int stride, int offset, int count);/* {
|
||||||
tessAddContour((TESStesselator*) inst, size, contour + (offset * stride), stride, count);
|
tessAddContour((TESStesselator*) inst, size, contour + (offset * stride), stride, count);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
static native void addMultiContour2D(long inst, int[] index, float[] contour, int idxStart, int idxCount);/* {
|
static native void addMultiContour2D(long inst, int[] index, float[] contour, int idxStart, int idxCount);/* {
|
||||||
TESStesselator* tess = (TESStesselator*) inst;
|
TESStesselator* tess = (TESStesselator*) inst;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
@ -180,6 +183,7 @@ public class TessJNI {
|
|||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tesselate contours.
|
* Tesselate contours.
|
||||||
*
|
*
|
||||||
@ -194,9 +198,11 @@ public class TessJNI {
|
|||||||
static native int tessContour2D(long inst, int windingRule, int elementType, int polySize, int vertexSize);/*{
|
static native int tessContour2D(long inst, int windingRule, int elementType, int polySize, int vertexSize);/*{
|
||||||
return tessTesselate((TESStesselator*) inst, windingRule, elementType, polySize, vertexSize, 0);
|
return tessTesselate((TESStesselator*) inst, windingRule, elementType, polySize, vertexSize, 0);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
static native int getVertexCount(long inst); /*{
|
static native int getVertexCount(long inst); /*{
|
||||||
return tessGetVertexCount((TESStesselator*) inst);
|
return tessGetVertexCount((TESStesselator*) inst);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pointer to first coordinate of first vertex.
|
* Returns pointer to first coordinate of first vertex.
|
||||||
*/
|
*/
|
||||||
@ -207,6 +213,7 @@ public class TessJNI {
|
|||||||
memcpy(out, vertices + offset, length * sizeof(TESSreal));
|
memcpy(out, vertices + offset, length * sizeof(TESSreal));
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pointer to first coordinate of first vertex.
|
* Returns pointer to first coordinate of first vertex.
|
||||||
*/
|
*/
|
||||||
@ -215,9 +222,10 @@ public class TessJNI {
|
|||||||
for(int i = 0; i < length; i++)
|
for(int i = 0; i < length; i++)
|
||||||
out[i] = (short)(vertices[offset++] * scale + 0.5f);
|
out[i] = (short)(vertices[offset++] * scale + 0.5f);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pointer to first vertex index.
|
* Returns pointer to first vertex index.
|
||||||
*
|
* <p/>
|
||||||
* Vertex indices can be used to map the generated vertices to the original vertices.
|
* Vertex indices can be used to map the generated vertices to the original vertices.
|
||||||
* Every point added using tessAddContour() will get a new index starting at 0.
|
* Every point added using tessAddContour() will get a new index starting at 0.
|
||||||
* New vertices generated at the intersections of segments are assigned value TESS_UNDEF.
|
* New vertices generated at the intersections of segments are assigned value TESS_UNDEF.
|
||||||
@ -229,12 +237,14 @@ public class TessJNI {
|
|||||||
memcpy(out, indices + offset, length * sizeof(TESSindex));
|
memcpy(out, indices + offset, length * sizeof(TESSindex));
|
||||||
return 1;
|
return 1;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns number of elements in the the tesselated output.
|
* Returns number of elements in the the tesselated output.
|
||||||
*/
|
*/
|
||||||
static native int getElementCount(long inst);/*{
|
static native int getElementCount(long inst);/*{
|
||||||
return tessGetElementCount((TESStesselator*) inst);
|
return tessGetElementCount((TESStesselator*) inst);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pointer to the first element.
|
* Returns pointer to the first element.
|
||||||
*/
|
*/
|
||||||
@ -245,6 +255,7 @@ public class TessJNI {
|
|||||||
memcpy(out, elements + offset, length * sizeof(TESSindex));
|
memcpy(out, elements + offset, length * sizeof(TESSindex));
|
||||||
return 1;
|
return 1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pointer to the first element.
|
* Returns pointer to the first element.
|
||||||
*/
|
*/
|
||||||
@ -253,6 +264,7 @@ public class TessJNI {
|
|||||||
for(int i = 0; i < length; i++)
|
for(int i = 0; i < length; i++)
|
||||||
out[i] = (short)elements[offset++];
|
out[i] = (short)elements[offset++];
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns list of triangles indices (or to the first element of convex polygons).
|
* Returns list of triangles indices (or to the first element of convex polygons).
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user