.. | .. |
---|
8022 | 8022 | } |
---|
8023 | 8023 | } |
---|
8024 | 8024 | |
---|
8025 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8025 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8026 | 8026 | { |
---|
8027 | 8027 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8028 | 8028 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8067 | 8067 | return; // true; |
---|
8068 | 8068 | } |
---|
8069 | 8069 | |
---|
8070 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8070 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8071 | 8071 | { |
---|
8072 | 8072 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8073 | 8073 | |
---|
.. | .. |
---|
8184 | 8184 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8185 | 8185 | |
---|
8186 | 8186 | |
---|
8187 | | - if (texturedata != null) |
---|
| 8187 | + if (texturedata == null) |
---|
| 8188 | + throw new Exception(); |
---|
| 8189 | + |
---|
8188 | 8190 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8189 | 8191 | //texture = GetTexture(tex, bump); |
---|
8190 | 8192 | } |
---|
.. | .. |
---|
8306 | 8308 | return texture; |
---|
8307 | 8309 | } |
---|
8308 | 8310 | |
---|
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 |
---|
8310 | 8312 | { |
---|
8311 | 8313 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8312 | 8314 | |
---|
.. | .. |
---|
8324 | 8326 | return texture!=null?texture.texture:null; |
---|
8325 | 8327 | } |
---|
8326 | 8328 | |
---|
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 |
---|
8328 | 8330 | { |
---|
8329 | 8331 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8330 | 8332 | |
---|
8331 | 8333 | return texture!=null?texture.texturedata:null; |
---|
8332 | 8334 | } |
---|
8333 | 8335 | |
---|
8334 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8336 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8335 | 8337 | { |
---|
8336 | 8338 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8337 | 8339 | { |
---|
.. | .. |
---|
10798 | 10800 | // Bump noise |
---|
10799 | 10801 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10800 | 10802 | //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 | + |
---|
10802 | 10813 | |
---|
10803 | 10814 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10804 | 10815 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11354 | 11365 | |
---|
11355 | 11366 | usedtextures.clear(); |
---|
11356 | 11367 | |
---|
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 | + } |
---|
11358 | 11376 | } |
---|
11359 | 11377 | //System.out.println("--> " + stackdepth); |
---|
11360 | 11378 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11445 | 11463 | if (checker != null && DrawMode() == DEFAULT) |
---|
11446 | 11464 | { |
---|
11447 | 11465 | //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 | + } |
---|
11449 | 11474 | // NEAREST |
---|
11450 | 11475 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11451 | 11476 | DrawChecker(gl); |
---|
.. | .. |
---|
14870 | 14895 | //RESIZETEXTURE ^= true; |
---|
14871 | 14896 | //break; |
---|
14872 | 14897 | case 'z': |
---|
14873 | | - RENDERSHADOW ^= true; |
---|
| 14898 | + Globals.RENDERSHADOW ^= true; |
---|
14874 | 14899 | Globals.lighttouched = true; |
---|
14875 | 14900 | repaint(); |
---|
14876 | 14901 | break; |
---|
.. | .. |
---|
16592 | 16617 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16593 | 16618 | } |
---|
16594 | 16619 | |
---|
16595 | | - if (!RENDERSHADOW) |
---|
| 16620 | + if (!Globals.RENDERSHADOW) |
---|
16596 | 16621 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16597 | 16622 | |
---|
16598 | 16623 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16602 | 16627 | //gl.glColorMask(false, false, false, false); |
---|
16603 | 16628 | |
---|
16604 | 16629 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16605 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16630 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16606 | 16631 | { |
---|
16607 | 16632 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16608 | 16633 | |
---|