diff options
Diffstat (limited to 'NET/worlds/scape/RoomEnvironment.java')
| -rw-r--r-- | NET/worlds/scape/RoomEnvironment.java | 202 |
1 files changed, 202 insertions, 0 deletions
diff --git a/NET/worlds/scape/RoomEnvironment.java b/NET/worlds/scape/RoomEnvironment.java new file mode 100644 index 0000000..b9c4bdc --- /dev/null +++ b/NET/worlds/scape/RoomEnvironment.java @@ -0,0 +1,202 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import java.awt.Color; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class RoomEnvironment +/* */ extends WObject +/* */ { +/* 51 */ static { nativeInit(); } +/* */ +/* */ public static native void nativeInit(); +/* */ +/* 55 */ protected void addRwChildren(WObject parent) { createClump(); +/* 56 */ Room r = (Room)getOwner(); +/* 57 */ createScene(r); +/* */ +/* 59 */ newRwChildHelper(); +/* */ +/* 61 */ addLight(r.getLightPosition(), r.getLightColor()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 69 */ private int lightid = 0; +/* 70 */ private int lightid2 = 0; +/* */ +/* */ protected void noteAddingTo(SuperRoot owner) {} +/* */ +/* 74 */ private void addLight(Point3Temp pos, Color c) { assert (this.lightid == 0); +/* */ +/* 76 */ float red = c.getRed() / 256.0F; +/* 77 */ float green = c.getGreen() / 256.0F; +/* 78 */ float blue = c.getBlue() / 256.0F; +/* */ +/* 80 */ this.lightid = Room.addLight(this.sceneID, pos.x, pos.y, pos.z, +/* 81 */ red, green, blue); +/* */ +/* 83 */ this.lightid2 = Room.addLight(this.sceneID, -pos.x, -pos.y, -pos.z, +/* 84 */ red * 0.5F, green * 0.5F, blue * 0.5F); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void setLightPosition(float x, float y, float z) +/* */ { +/* 93 */ if (this.lightid != 0) +/* */ { +/* 95 */ Room.setLightPosition(this.lightid, x, y, z); +/* */ } +/* */ +/* 98 */ if (this.lightid2 != 0) +/* */ { +/* 100 */ Room.setLightPosition(this.lightid2, -x, -y, -z); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void setLightColor(float red, float green, float blue) +/* */ { +/* 111 */ if (this.lightid != 0) +/* */ { +/* 113 */ Room.setLightColor(this.lightid, red, green, blue); +/* */ } +/* */ +/* 116 */ if (this.lightid2 != 0) +/* */ { +/* 118 */ Room.setLightColor(this.lightid2, red * 0.5F, +/* 119 */ green * 0.5F, blue * 0.5F); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public BoundBoxTemp getBoundBox() +/* */ { +/* 128 */ return BoundBoxTemp.make(Point3Temp.make(), Point3Temp.make()); +/* */ } +/* */ +/* */ +/* */ protected void markVoid() +/* */ { +/* 134 */ super.markVoid(); +/* */ +/* 136 */ destroyScene(); +/* 137 */ this.lightid = 0; +/* 138 */ this.lightid2 = 0; +/* */ } +/* */ +/* */ +/* */ +/* 143 */ int nextVertex = 1; +/* */ +/* */ +/* */ +/* 147 */ boolean wasEdited = false; +/* */ +/* */ public void markClumpEdited() +/* */ { +/* 151 */ this.wasEdited = true; +/* */ } +/* */ +/* */ public void prerender() +/* */ { +/* 156 */ if (this.wasEdited) +/* */ { +/* 158 */ this.wasEdited = false; +/* 159 */ doneWithEditing(); +/* */ } +/* */ } +/* */ +/* 163 */ private static Object classCookie = new Object(); +/* */ +/* */ private int sceneID; +/* */ +/* */ public void saveState(Saver s) +/* */ throws IOException +/* */ { +/* 170 */ s.saveVersion(1, classCookie); +/* 171 */ super.saveState(s); +/* */ } +/* */ +/* */ +/* */ +/* */ public void restoreState(Restorer r) +/* */ throws IOException, TooNewException +/* */ { +/* 179 */ switch (r.restoreVersion(classCookie)) { +/* */ case 1: +/* 181 */ super.restoreState(r); +/* 182 */ break; +/* */ case 0: +/* 184 */ r.setOldFlag(); +/* 185 */ super.restoreState(r); +/* 186 */ r.restore(); +/* 187 */ break; +/* */ default: +/* 189 */ throw new TooNewException(); +/* */ } +/* */ } +/* */ +/* */ native void createScene(Room paramRoom); +/* */ +/* */ native void destroyScene(); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\RoomEnvironment.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |