diff options
author | Harvey Harrison <[email protected]> | 2013-02-02 10:38:59 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2013-02-02 10:38:59 -0800 |
commit | 13ec3eed5543f91eacc562479aae8bad3c9beea9 (patch) | |
tree | d8969e46291061048a2d2387b5ee2b2056ee60bf /src/classes/share | |
parent | 1bbc76a0d0ac0d968d57531724c254d05391b594 (diff) |
j3dcore: annotate list of lights in GraphicsContext3D
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/javax/media/j3d/GraphicsContext3D.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/classes/share/javax/media/j3d/GraphicsContext3D.java b/src/classes/share/javax/media/j3d/GraphicsContext3D.java index 5b01630..baff345 100644 --- a/src/classes/share/javax/media/j3d/GraphicsContext3D.java +++ b/src/classes/share/javax/media/j3d/GraphicsContext3D.java @@ -153,7 +153,7 @@ public class GraphicsContext3D extends Object { AppearanceRetained defaultAppearanceRetained = new AppearanceRetained(); // The vector of lights - Vector lights = new Vector(); + Vector<Light> lights = new Vector<Light>(); // Current High resolution coordinate HiResCoord hiRes = new HiResCoord(); @@ -878,14 +878,13 @@ public class GraphicsContext3D extends Object { void doSetLight(Light light, int index) { - Light oldlight; - oldlight = (Light)this.lights.elementAt(index); + Light oldlight = this.lights.get(index); if (oldlight != null) { ((LightRetained)oldlight.retained).setInImmCtx(false); } ((LightRetained)light.retained).setInImmCtx(true); updateLightState((LightRetained)light.retained); - this.lights.setElementAt(light, index); + this.lights.set(index, light); this.lightsChanged = true; } @@ -923,7 +922,7 @@ public class GraphicsContext3D extends Object { void doInsertLight(Light light, int index) { ((LightRetained)light.retained).setInImmCtx(true); updateLightState((LightRetained)light.retained); - this.lights.insertElementAt(light, index); + this.lights.add(index, light); this.lightsChanged = true; } @@ -949,10 +948,10 @@ public class GraphicsContext3D extends Object { } void doRemoveLight(int index) { - Light light = (Light) this.lights.elementAt(index); + Light light = this.lights.get(index); ((LightRetained)light.retained).setInImmCtx(false); - this.lights.removeElementAt(index); + this.lights.remove(index); this.lightsChanged = true; } @@ -1010,7 +1009,7 @@ public Enumeration<Light> getAllLights() { ((LightRetained)light.retained).setInImmCtx(true); updateLightState((LightRetained)light.retained); - this.lights.addElement(light); + this.lights.add(light); this.lightsChanged = true; } @@ -2439,7 +2438,7 @@ public int numSounds() { int n = 0; int nLight = lights.size();; for (i = 0; i < nLight;i++) { - LightRetained lt = (LightRetained)((Light)lights.get(i)).retained; + LightRetained lt = (LightRetained)(lights.get(i)).retained; if (lt instanceof AmbientLightRetained) { sceneAmbient.x += lt.color.x; sceneAmbient.y += lt.color.y; |