From f6a8eae55c4b49194f6a280cd351190c5accd7c0 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Fri, 23 Nov 2012 23:31:46 -0800 Subject: j3dcore: annotate some BackGroundRetained lists Signed-off-by: Harvey Harrison --- .../media/j3d/RenderingEnvironmentStructure.java | 57 ++++++++++------------ 1 file changed, 26 insertions(+), 31 deletions(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java b/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java index a3a375d..d29920b 100644 --- a/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java +++ b/src/classes/share/javax/media/j3d/RenderingEnvironmentStructure.java @@ -92,7 +92,6 @@ int numberOfClips = 0; Transform3D localeXform = new Transform3D(); Vector3d localeTranslation = new Vector3d(); - Bounds localeBounds = null; // For closest Fog selection FogRetained[] intersectedFogs = new FogRetained[1]; @@ -933,9 +932,6 @@ int processModelClips(ArrayList globalModelClips, RenderAtom Bounds closestBounds; int j = 0; int nbacks; - ArrayList globalBgs; - - // Need to lock lockObj, since on a multi-processor // system with 2 views on a single universe, there might @@ -946,11 +942,11 @@ int processModelClips(ArrayList globalModelClips, RenderAtom intersectedBounds = new Bounds[numberOfBgs]; + ArrayList globalBgs = viewScopedBackgrounds.get(view); + if (globalBgs != null) + nbacks = processBgs(globalBgs, bounds, nbacks, viewLocale); - if ((globalBgs = (ArrayList)viewScopedBackgrounds.get(view)) != null) { - nbacks = processBgs(globalBgs, bounds, nbacks, viewLocale); - } - nbacks = processBgs(nonViewScopedBackgrounds, bounds, nbacks, viewLocale); + nbacks = processBgs(nonViewScopedBackgrounds, bounds, nbacks, viewLocale); // If there are no intersections, set to black. if (nbacks == 1) { @@ -971,37 +967,36 @@ int processModelClips(ArrayList globalModelClips, RenderAtom } - // Called while holding lockObj lock - int processBgs(ArrayList globalBgs, BoundingSphere bounds, int nbacks, Locale viewLocale) { +// Called while holding lockObj lock +int processBgs(ArrayList globalBgs, BoundingSphere bounds, int nbacks, Locale viewLocale) { int size = globalBgs.size(); - int i; - BackgroundRetained back; - for (i=0; i