From 9930e2916dd78998f70bf066293a7f5e8017b2ac Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Tue, 26 Jun 2012 22:41:54 -0700 Subject: j3dcore: annotate lists of fog and lights Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/BackgroundRetained.java | 8 +-- .../media/j3d/RenderingEnvironmentStructure.java | 61 +++++++++++----------- 2 files changed, 35 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/classes/share/javax/media/j3d/BackgroundRetained.java b/src/classes/share/javax/media/j3d/BackgroundRetained.java index 2a0ebed..cc32217 100644 --- a/src/classes/share/javax/media/j3d/BackgroundRetained.java +++ b/src/classes/share/javax/media/j3d/BackgroundRetained.java @@ -91,11 +91,11 @@ class BackgroundRetained extends LeafRetained { // This is true when this background is referenced in an immediate mode context boolean inImmCtx = false; - // list of light nodes for background geometry - ArrayList lights = new ArrayList(); +// list of light nodes for background geometry +ArrayList lights = new ArrayList(); - // list of fog nodes for background geometry - ArrayList fogs = new ArrayList(); +// list of fog nodes for background geometry +ArrayList fogs = new ArrayList(); // a list of background geometry atoms ArrayList bgGeometryAtomList = new ArrayList(); diff --git a/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java b/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java index 1de685b..3bd66ea 100644 --- a/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java +++ b/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java @@ -660,25 +660,25 @@ void addObjArrayToFreeList(Object[] objs) { LightRetained[] getInfluencingLights(RenderAtom ra, View view) { LightRetained[] lightAry = null; - ArrayList globalLights; - int numLights; - int i, j, n; + int i, j; // Need to lock retlights, since on a multi-processor // system with 2 views on a single universe, there might // be councurrent access synchronized (retlights) { - numLights = 0; - if (ra.geometryAtom.source.inBackgroundGroup) { - globalLights = ra.geometryAtom.source.geometryBackground.lights; - numLights = processLights(globalLights, ra, numLights); - } else { - if ((globalLights = (ArrayList)viewScopedLights.get(view)) != null) { - numLights = processLights(globalLights, ra, numLights); + ArrayList globalLights; + int numLights = 0; + if (ra.geometryAtom.source.inBackgroundGroup) { + globalLights = ra.geometryAtom.source.geometryBackground.lights; + numLights = processLights(globalLights, ra, numLights); + } + else { + if ((globalLights = viewScopedLights.get(view)) != null) { + numLights = processLights(globalLights, ra, numLights); + } + // now process the common lights + numLights = processLights(nonViewScopedLights, ra, numLights); } - // now process the common lights - numLights = processLights(nonViewScopedLights, ra, numLights); - } boolean newLights = false; if (ra.lights != null && ra.lights.length == numLights) { @@ -708,8 +708,8 @@ void addObjArrayToFreeList(Object[] objs) { } } - // Called while holding the retlights lock - int processLights(ArrayList globalLights, RenderAtom ra, int numLights) { +// Called while holding the retlights lock +private int processLights(ArrayList globalLights, RenderAtom ra, int numLights) { LightRetained[] shapeScopedLt; Bounds bounds; int i, j, n; @@ -718,7 +718,7 @@ void addObjArrayToFreeList(Object[] objs) { if (size > 0) { for (i=0; i