diff options
author | Sven Gothel <[email protected]> | 2014-04-02 19:25:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-04-02 19:25:16 +0200 |
commit | abc833631e0ab30a06c7aff47a39a551544fd735 (patch) | |
tree | 1d6e5a94d2149d7b2635de5b5eccb330bc41cd2c /src/jogl/classes/com/jogamp/graph/geom/SVertex.java | |
parent | e8a5a1cbb988670ca206ab1ac633e19a91bfa478 (diff) |
Bug 801: Reduce temp. object creation, i.e. GC load
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/geom/SVertex.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/geom/SVertex.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java index d13607d71..579f92455 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java +++ b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java @@ -75,10 +75,10 @@ public class SVertex implements Vertex { } public SVertex(final Vertex src) { - this.id = src.getId(); + this.id = Integer.MAX_VALUE; System.arraycopy(src.getCoord(), 0, coord, 0, 3); - setOnCurve(src.isOnCurve()); System.arraycopy(src.getTexCoord(), 0, texCoord, 0, 3); + setOnCurve(src.isOnCurve()); } public SVertex(final int id, final boolean onCurve, final float[] texCoordsBuffer) { @@ -99,13 +99,6 @@ public class SVertex implements Vertex { setOnCurve(onCurve); } - public SVertex(float[] coordsBuffer, float[] texCoordsBuffer, boolean onCurve) { - this.id = Integer.MAX_VALUE; - System.arraycopy(coordsBuffer, 0, coord, 0, 3); - System.arraycopy(texCoordsBuffer, 0, texCoord, 0, 3); - setOnCurve(onCurve); - } - @Override public final void setCoord(float x, float y, float z) { coord[0] = x; @@ -215,7 +208,7 @@ public class SVertex implements Vertex { */ @Override public SVertex clone(){ - return new SVertex(this.coord, this.texCoord, this.onCurve); + return new SVertex(this); } @Override |