diff options
author | Rami Santina <[email protected]> | 2011-05-21 17:49:08 +0300 |
---|---|---|
committer | Rami Santina <[email protected]> | 2011-05-21 17:49:08 +0300 |
commit | 5ea211cde39be9669d1f2f289abbba460398f82e (patch) | |
tree | 79a3db238a55faa6aebad7493e772065c69411b5 /src/jogl/classes/com | |
parent | 9e599f84bc02ef2db63b6eb1cadfa33f56dddd66 (diff) |
Remove implicit for loops reduces temp objects
Diffstat (limited to 'src/jogl/classes/com')
3 files changed, 6 insertions, 4 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index 7f8e386a1..5b94d6bda 100755 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -394,7 +394,8 @@ public class OutlineShape implements Comparable<OutlineShape> { int maxVertexId = 0;
for(int i=0; i<outlines.size(); i++) {
final ArrayList<Vertex> vertices = outlines.get(i).getVertices();
- for(Vertex vert:vertices){
+ for(int pos=0; pos<vertices.size(); pos++) {
+ Vertex vert = vertices.get(pos);
vert.setId(maxVertexId);
maxVertexId++;
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index 20b4d61a1..c6165b6b3 100755 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -60,14 +60,16 @@ public abstract class GLRegion extends Region { int numVertices = region.getNumVertices();
- for(OutlineShape outlineShape:outlineShapes){
+ for(int index=0; index<outlineShapes.length; index++) {
+ OutlineShape outlineShape = outlineShapes[index];
outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
ArrayList<Triangle> triangles = outlineShape.triangulate();
region.addTriangles(triangles);
ArrayList<Vertex> vertices = outlineShape.getVertices();
- for(Vertex vert:vertices){
+ for(int pos=0; pos < vertices.size(); pos++){
+ Vertex vert = vertices.get(pos);
vert.setId(numVertices++);
}
region.addVertices(vertices);
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java index 9de295616..fce2e1bae 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -83,7 +83,6 @@ public class CDTriangulator2D { // FIXME: multiple in/out and CW/CCW tests (as follows) ?? if(!loops.isEmpty()) { - // FIXME: #1 in/out test loop = getContainerLoop(polyline); } |