BoundaryRep.java | ●●●●● patch | view | raw | blame | history | |
CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Globals.java | ●●●●● patch | view | raw | blame | history | |
Grafreed.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history |
BoundaryRep.java
.. .. @@ -4022,8 +4022,6 @@ 4022 4022 //System.out.println("NEW = " + positions.length); 4023 4023 uvmap = new float[ta.getVertexCount() * 2]; 4024 4024 4025 - colors = new float[ta.getVertexCount()]; // * 3];4026 -4027 4025 ta.getCoordinates(0, positions); 4028 4026 ta.getNormals(0, normals); 4029 4027 // ta.getColors(0, colors); .. .. @@ -4031,6 +4029,14 @@ 4031 4029 4032 4030 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";"); 4033 4031 4032 + colors = null;4033 +// colors = new float[ta.getVertexCount()]; // * 3];4034 +//4035 +// for (int i=colors.length; --i>=0;)4036 +// {4037 +// colors[i] = 1;4038 +// }4039 +4034 4040 triangles = new int[ta.getVertexCount()]; 4035 4041 4036 4042 for (int i = 0; i < triangles.length; i++) .. .. @@ -4068,17 +4074,18 @@ 4068 4074 positions = new float[3 * ga.getVertexCount()]; 4069 4075 normals = new float[3 * ga.getVertexCount()]; 4070 4076 uvmap = new float[2 * ga.getVertexCount()]; 4071 - colors = new float[1 * ga.getVertexCount()];4072 4077 4073 4078 tsa.getCoordinates(0, positions); 4074 4079 tsa.getNormals(0, normals); 4075 4080 tsa.getTextureCoordinates(0, 0, uvmap); 4076 4081 // tsa.getColors(0, colors); 4077 -4078 - for (int i=colors.length; --i>=0;)4079 - {4080 - colors[i] = 1;4081 - }4082 +4083 + colors = null;4084 +// colors = new float[1 * ga.getVertexCount()];4085 +// for (int i=colors.length; --i>=0;)4086 +// {4087 +// colors[i] = 1;4088 +// }4082 4089 4083 4090 int stripcount = tsa.getNumStrips(); 4084 4091 triangles = new int[stripcount]; .. .. @@ -4087,6 +4094,7 @@ 4087 4094 stripified = true; 4088 4095 } catch (ClassCastException e) 4089 4096 { 4097 + // ??? aug 20194090 4098 TriangleArray ta = (TriangleArray) ga; 4091 4099 4092 4100 positions = new float[3 * ga.getVertexCount()]; CameraPane.java
.. .. @@ -173,7 +173,7 @@ 173 173 static boolean doublesided = false; // true; // reversed normals are awful for conformance 174 174 boolean anisotropy = true; 175 175 boolean softshadow = true; // slower but better false; 176 - boolean opacityhalo = false;176 + boolean opacityhalo = false; // reverse the halo effect (e.g. glass)177 177 178 178 boolean macromode = false; 179 179 .. .. @@ -17533,10 +17533,14 @@ 17533 17533 gl.glFlush(); 17534 17534 17535 17535 /**/ 17536 - gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusionsizebuffer);17536 + gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusiondepthbuffer);17537 17537 17538 - float[] pixels = occlusionsizebuffer.array();17538 + float[] depths = occlusiondepthbuffer.array();17539 17539 17540 + gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_BGRA, GL.GL_UNSIGNED_INT_8_8_8_8_REV, occlusioncolorbuffer);17541 +17542 + int[] pixels = selectsizebuffer.array();17543 +17540 17544 double r = 0, g = 0, b = 0; 17541 17545 17542 17546 double count = 0; .. .. @@ -17547,7 +17551,7 @@ 17547 17551 17548 17552 double FACTOR = 1; 17549 17553 17550 - for (int i = 0; i < pixels.length; i++)17554 + for (int i = 0; i < depths.length; i++)17551 17555 { 17552 17556 int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2; 17553 17557 int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2; .. .. @@ -17630,7 +17634,7 @@ 17630 17634 17631 17635 double scale = ray.z; // 1; // cos 17632 17636 17633 - float depth = pixels[newindex];17637 + float depth = depths[newindex];17634 17638 17635 17639 /* 17636 17640 int newindex2 = (x + 1) * OCCLUSION_SIZE + y; .. .. @@ -17827,11 +17831,14 @@ 17827 17831 static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE); 17828 17832 static IntBuffer bigAAbuffer; 17829 17833 static java.nio.FloatBuffer histogram = BufferUtil.newFloatBuffer(HISTOGRAM_SIZE * 3); 17830 - static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);17834 + //static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);17831 17835 static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE); 17832 17836 static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE); 17833 17837 //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); 17834 - static java.nio.FloatBuffer occlusionsizebuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);17838 + static java.nio.FloatBuffer occlusiondepthbuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);17839 +17840 + static IntBuffer occlusioncolorbuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);17841 +17835 17842 static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB); 17836 17843 static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); 17837 17844 static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>(); Globals.java
.. .. @@ -1,6 +1,7 @@ 1 1 2 2 public class Globals 3 3 { 4 + public static boolean TOOLTIPS = false;4 5 public static boolean ADVANCED = false; 5 6 public static boolean DEBUG = false; 6 7 Grafreed.java
.. .. @@ -935,6 +935,8 @@ 935 935 //mon.stop(); 936 936 //System.out.println(mon); 937 937 //timeflow.app.TimeflowAppLauncher.GetTimeFlow(); 938 +939 + javax.swing.ToolTipManager.sharedInstance().setEnabled(Globals.TOOLTIPS);938 940 } 939 941 940 942 static Object3D materials; GroupEditor.java
.. .. @@ -31,7 +31,7 @@ 31 31 final String path = "cubemaps/" + f + "-skyboxes/" + s; 32 32 row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); 33 33 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); 34 - skyboxButton.setToolTipText(s);34 + skyboxButton.setToolTipText(s.equals("") ? "No background" : s);35 35 skyboxButton.addActionListener(new ActionListener() 36 36 { 37 37 @Override .. .. @@ -73,7 +73,7 @@ 73 73 cGridBag row5 = new cGridBag(); 74 74 cGridBag row6 = new cGridBag(); 75 75 76 - AddSkyboxButton("default", "rgb", row0);76 + AddSkyboxButton("default", "", row0);77 77 //AddSkyboxButton("default", "cornell", row0); 78 78 AddSkyboxButton("penguins", "dust", row0); 79 79 AddSkyboxButton("penguins", "tropic", row0); .. .. @@ -330,10 +330,19 @@ 330 330 331 331 public void ChangeSkybox(String skybox) 332 332 { 333 - //cameraView.envyoff = false;334 - group.skyboxname = skybox;335 - group.skyboxext = "jpg";336 - cameraView.repaint();333 + if (skybox.endsWith("/"))334 + {335 + group.skyboxname = null;336 + group.skyboxext = null;337 + cameraView.repaint();338 + }339 + else340 + {341 + //cameraView.envyoff = false;342 + group.skyboxname = skybox;343 + group.skyboxext = "jpg";344 + cameraView.repaint();345 + }337 346 } 338 347 339 348 public void CreateSkyboxPanel(cGridBag skyboxPanel) .. .. @@ -1459,11 +1468,11 @@ 1459 1468 { 1460 1469 assert(obj instanceof Composite); 1461 1470 1462 - if (obj.versionlist == null)1463 - {1464 - obj.versionlist = new Object3D[100];1465 - obj.versionindex = -1;1466 - }1471 +// if (obj.versionlist == null)1472 +// {1473 +// obj.versionlist = new Object3D[100];1474 +// obj.versionindex = -1;1475 +// }1467 1476 1468 1477 cRadio radioButton = new cRadio(obj.name); 1469 1478 .. .. @@ -4067,7 +4076,17 @@ 4067 4076 */ 4068 4077 radio.layout.doClick(); 4069 4078 4070 - SetUndoStates();4079 + assert(copy instanceof Composite);4080 +4081 + if (copy.versionlist == null)4082 + {4083 + copy.versionlist = new Object3D[100];4084 + copy.versionindex = -1;4085 +4086 + Save(true);4087 + }4088 +4089 + SetVersionStates();4071 4090 4072 4091 ClearUnpinned(); 4073 4092 ObjEditor.java
.. .. @@ -4129,7 +4129,7 @@ 4129 4129 { 4130 4130 //Save(true); 4131 4131 Replace(); 4132 - SetUndoStates();4132 + SetVersionStates();4133 4133 } 4134 4134 4135 4135 private boolean Equal(byte[] compress, byte[] name) .. .. @@ -4159,7 +4159,7 @@ 4159 4159 4160 4160 CopyChanged(); 4161 4161 4162 - SetUndoStates();4162 + SetVersionStates();4163 4163 } 4164 4164 4165 4165 public boolean Save(boolean user) .. .. @@ -4205,7 +4205,7 @@ 4205 4205 // copy.versionlist[i] = null; 4206 4206 // } 4207 4207 4208 - SetUndoStates();4208 + SetVersionStates();4209 4209 4210 4210 // test save 4211 4211 if (false) .. .. @@ -4265,7 +4265,7 @@ 4265 4265 { 4266 4266 Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); 4267 4267 4268 - SetUndoStates();4268 + SetVersionStates();4269 4269 4270 4270 boolean temp = CameraPane.SWITCH; 4271 4271 CameraPane.SWITCH = false; .. .. @@ -4332,7 +4332,7 @@ 4332 4332 return count; 4333 4333 } 4334 4334 4335 - void SetUndoStates()4335 + void SetVersionStates()4336 4336 { 4337 4337 //if (true) 4338 4338 // return; .. .. @@ -5111,7 +5111,7 @@ 5111 5111 } 5112 5112 5113 5113 if (previousVersionButton != null && copy.versionlist != null) 5114 - SetUndoStates();5114 + SetVersionStates();5115 5115 } 5116 5116 5117 5117 static TweenManager tweenManager = new TweenManager(); .. .. @@ -5596,6 +5596,8 @@ 5596 5596 5597 5597 void save() 5598 5598 { 5599 + Replace();5600 +5599 5601 if (lastname == null) 5600 5602 { 5601 5603 return;