Normand Briere
2019-06-03 e24558ddeacfc945b9e9ba0a32b552d04e2ed4dd
CameraPane.java
....@@ -1628,7 +1628,7 @@
16281628
16291629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16301630
1631
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
16321632
16331633 /**/
16341634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -2140,7 +2140,7 @@
21402140 System.err.println("LIVE = " + Globals.isLIVE());
21412141
21422142 if (!Globals.isLIVE()) // save sound
2143
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
21442144 // else
21452145 repaint(); // start loop // may 2013
21462146 }
....@@ -8022,7 +8022,7 @@
80228022 }
80238023 }
80248024
8025
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8025
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80268026 {
80278027 if (// DrawMode() != 0 || /*tex == null ||*/
80288028 ambientOcclusion ) // || !textureon)
....@@ -8067,7 +8067,7 @@
80678067 return; // true;
80688068 }
80698069
8070
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8070
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
80718071 {
80728072 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80738073
....@@ -8184,7 +8184,9 @@
81848184 texturedata = GetFileTexture(cachename, processbump, resolution);
81858185
81868186
8187
- if (texturedata != null)
8187
+ if (texturedata == null)
8188
+ throw new Exception();
8189
+
81888190 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81898191 //texture = GetTexture(tex, bump);
81908192 }
....@@ -8306,7 +8308,7 @@
83068308 return texture;
83078309 }
83088310
8309
- com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution)
8311
+ com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception
83108312 {
83118313 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83128314
....@@ -8324,14 +8326,14 @@
83248326 return texture!=null?texture.texture:null;
83258327 }
83268328
8327
- public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
8329
+ public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception
83288330 {
83298331 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83308332
83318333 return texture!=null?texture.texturedata:null;
83328334 }
83338335
8334
- boolean BindTexture(String tex, boolean bump, int resolution)
8336
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83358337 {
83368338 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83378339 {
....@@ -9542,7 +9544,7 @@
95429544
95439545 if (!BOXMODE)
95449546 {
9545
- System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")");
9547
+ System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")");
95469548 }
95479549
95489550 if (!BOXMODE)
....@@ -9580,7 +9582,7 @@
95809582 ABORTED = false;
95819583 }
95829584 else
9583
- GrafreeD.wav.cursor += 735 * ACSIZE;
9585
+ Grafreed.wav.cursor += 735 * ACSIZE;
95849586
95859587 if (false)
95869588 {
....@@ -10243,11 +10245,11 @@
1024310245
1024410246 public void display(GLAutoDrawable drawable)
1024510247 {
10246
- if (GrafreeD.savesound && GrafreeD.hassound)
10248
+ if (Grafreed.savesound && Grafreed.hassound)
1024710249 {
10248
- GrafreeD.wav.save();
10249
- GrafreeD.savesound = false;
10250
- GrafreeD.hassound = false;
10250
+ Grafreed.wav.save();
10251
+ Grafreed.savesound = false;
10252
+ Grafreed.hassound = false;
1025110253 }
1025210254 // if (DEBUG_SELECTION)
1025310255 // {
....@@ -10377,7 +10379,7 @@
1037710379 Object3D theobject = object;
1037810380 Object3D theparent = object.parent;
1037910381 object.parent = null;
10380
- object = (Object3D)GrafreeD.clone(object);
10382
+ object = (Object3D)Grafreed.clone(object);
1038110383 object.Stripify();
1038210384 if (theobject.selection == null || theobject.selection.Size() == 0)
1038310385 theobject.PreprocessOcclusion(this);
....@@ -10798,7 +10800,16 @@
1079810800 // Bump noise
1079910801 gl.glActiveTexture(GL.GL_TEXTURE6);
1080010802 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10801
- BindTexture(NOISE_TEXTURE, false, 2);
10803
+
10804
+ try
10805
+ {
10806
+ BindTexture(NOISE_TEXTURE, false, 2);
10807
+ }
10808
+ catch (Exception e)
10809
+ {
10810
+ System.err.println("FAILED: " + NOISE_TEXTURE);
10811
+ }
10812
+
1080210813
1080310814 gl.glActiveTexture(GL.GL_TEXTURE0);
1080410815 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -11283,8 +11294,8 @@
1128311294 e.printStackTrace();
1128411295 }
1128511296
11286
- if (GrafreeD.RENDERME > 0)
11287
- GrafreeD.RENDERME--; // mechante magouille
11297
+ if (Grafreed.RENDERME > 0)
11298
+ Grafreed.RENDERME--; // mechante magouille
1128811299
1128911300 Globals.ONESTEP = false;
1129011301 }
....@@ -11354,7 +11365,14 @@
1135411365
1135511366 usedtextures.clear();
1135611367
11357
- BindTextures(DEFAULT_TEXTURES, 2);
11368
+ try
11369
+ {
11370
+ BindTextures(DEFAULT_TEXTURES, 2);
11371
+ }
11372
+ catch (Exception e)
11373
+ {
11374
+ System.err.println("FAILED: " + DEFAULT_TEXTURES);
11375
+ }
1135811376 }
1135911377 //System.out.println("--> " + stackdepth);
1136011378 // GrafreeD.traceon();
....@@ -11445,7 +11463,14 @@
1144511463 if (checker != null && DrawMode() == DEFAULT)
1144611464 {
1144711465 //BindTexture(IMMORTAL_TEXTURE);
11448
- BindTextures(checker.GetTextures(), checker.texres);
11466
+ try
11467
+ {
11468
+ BindTextures(checker.GetTextures(), checker.texres);
11469
+ }
11470
+ catch (Exception e)
11471
+ {
11472
+ System.err.println("FAILED: " + checker.GetTextures());
11473
+ }
1144911474 // NEAREST
1145011475 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1145111476 DrawChecker(gl);
....@@ -13656,6 +13681,10 @@
1365613681 // wasliveok = true;
1365713682 // waslive = false;
1365813683
13684
+ // May 2019 Forget it:
13685
+ if (true)
13686
+ return;
13687
+
1365913688 // source == timer
1366013689 if (mouseDown)
1366113690 {
....@@ -14359,7 +14388,7 @@
1435914388 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1436014389 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1436114390
14362
- if (control || command || IsFrozen())
14391
+// No delay if (control || command || IsFrozen())
1436314392 timeout = true;
1436414393 // ?? May 2019 else
1436514394 // timer.setDelay((modifiers & 128) != 0?0:350);
....@@ -14866,7 +14895,7 @@
1486614895 //RESIZETEXTURE ^= true;
1486714896 //break;
1486814897 case 'z':
14869
- RENDERSHADOW ^= true;
14898
+ Globals.RENDERSHADOW ^= true;
1487014899 Globals.lighttouched = true;
1487114900 repaint();
1487214901 break;
....@@ -16423,16 +16452,16 @@
1642316452 System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
1642416453 }
1642516454
16426
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16455
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1642716456 }
1642816457 }
1642916458
1643016459 if (!movingcamera && !PAINTMODE)
1643116460 object.editWindow.ScreenFitPoint(); // fev 2014
1643216461
16433
- if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
16462
+ if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1643416463 {
16435
- Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16464
+ Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1643616465
1643716466 Object3D group = new Object3D("inst" + paintcount++);
1643816467
....@@ -16588,7 +16617,7 @@
1658816617 gl.glDisable(gl.GL_CULL_FACE);
1658916618 }
1659016619
16591
- if (!RENDERSHADOW)
16620
+ if (!Globals.RENDERSHADOW)
1659216621 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1659316622
1659416623 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16598,7 +16627,7 @@
1659816627 //gl.glColorMask(false, false, false, false);
1659916628
1660016629 //render_scene_from_light_view(gl, drawable, 0, 0);
16601
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16630
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1660216631 {
1660316632 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1660416633