aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2014-03-07 14:07:43 -0800
committerHarvey Harrison <[email protected]>2014-05-03 09:08:38 -0700
commit7a6102dbbb3660c6ce15aa4a64f3d289cbf09b59 (patch)
treeb2f9f851b1df7b02aa1ccc0e320316cc36f021cd
parentc5a01013647f2df1e48e6888ca1ab42f5ba29cd4 (diff)
j3dcore: prepare to refactor the Font3D tesselation code, move variables next to use
Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r--src/classes/share/javax/media/j3d/Font3D.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/classes/share/javax/media/j3d/Font3D.java b/src/classes/share/javax/media/j3d/Font3D.java
index ecdc352..7dc3a44 100644
--- a/src/classes/share/javax/media/j3d/Font3D.java
+++ b/src/classes/share/javax/media/j3d/Font3D.java
@@ -287,8 +287,6 @@ private static class IntVector {
float tmpCoords[] = new float[6];
float lastX= .0f, lastY= .0f;
float firstPntx = Float.MAX_VALUE, firstPnty = Float.MAX_VALUE;
- GeometryInfo gi = null;
- NormalGenerator ng = new NormalGenerator();
IntVector contours = new IntVector();
float maxY = -Float.MAX_VALUE;
int maxYIndex = 0, beginIdx = 0, endIdx = 0, start = 0;
@@ -470,20 +468,21 @@ private static class IntVector {
numPoints = 0;
//Now loop thru each island, calling triangulator once per island.
//Combine triangle data for all islands together in one object.
- for (i=0;i < islandCounts.length;i++) {
- contourCounts[0] = islandCounts[i].length;
- numPoints += outVerts[i].length;
- gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
- gi.setCoordinates(outVerts[i]);
- gi.setStripCounts(islandCounts[i]);
- gi.setContourCounts(contourCounts);
- ng.generateNormals(gi);
-
- GeometryArray ga = gi.getGeometryArray(false, false, false);
- vertOffset += ga.getVertexCount();
-
- triangData.add(ga);
- }
+ NormalGenerator ng = new NormalGenerator();
+ for (i = 0; i < islandCounts.length; i++) {
+ contourCounts[0] = islandCounts[i].length;
+ numPoints += outVerts[i].length;
+ GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
+ gi.setCoordinates(outVerts[i]);
+ gi.setStripCounts(islandCounts[i]);
+ gi.setContourCounts(contourCounts);
+ ng.generateNormals(gi);
+
+ GeometryArray ga = gi.getGeometryArray(false, false, false);
+ vertOffset += ga.getVertexCount();
+
+ triangData.add(ga);
+ }
// Multiply by 2 since we create 2 faces of the font
// Second term is for side-faces along depth of the font
if (fontExtrusion == null)