.. | .. |
---|
45 | 45 | |
---|
46 | 46 | static int STEP = 1; |
---|
47 | 47 | |
---|
| 48 | + private static BufferedImage CreateBim(byte[] bytes, int width, int height) |
---|
| 49 | + { |
---|
| 50 | + int[] pixels = new int[bytes.length/3]; |
---|
| 51 | + for (int i=pixels.length; --i>=0;) |
---|
| 52 | + { |
---|
| 53 | + int i3 = i*3; |
---|
| 54 | + pixels[i] = 0xFF; |
---|
| 55 | + pixels[i] <<= 8; |
---|
| 56 | + pixels[i] |= bytes[i3+2] & 0xFF; |
---|
| 57 | + pixels[i] <<= 8; |
---|
| 58 | + pixels[i] |= bytes[i3+1] & 0xFF; |
---|
| 59 | + pixels[i] <<= 8; |
---|
| 60 | + pixels[i] |= bytes[i3] & 0xFF; |
---|
| 61 | + } |
---|
| 62 | + /* |
---|
| 63 | + int r=0,g=0,b=0,a=0; |
---|
| 64 | + for (int i=0; i<width; i++) |
---|
| 65 | + for (int j=0; j<height; j++) |
---|
| 66 | + { |
---|
| 67 | + int index = j*width+i; |
---|
| 68 | + int p = pixels[index]; |
---|
| 69 | + a = ((p>>24) & 0xFF); |
---|
| 70 | + r = ((p>>16) & 0xFF); |
---|
| 71 | + g = ((p>>8) & 0xFF); |
---|
| 72 | + b = (p & 0xFF); |
---|
| 73 | + pixels[index] = (a<<24) | (b<<16) | (g<<8) | r; |
---|
| 74 | + } |
---|
| 75 | + /**/ |
---|
| 76 | + BufferedImage rendImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // ImageIO.read(infile); |
---|
| 77 | + rendImage.setRGB(0,0,width,height,pixels,width*(height-1),-width); |
---|
| 78 | + return rendImage; |
---|
| 79 | + } |
---|
| 80 | + |
---|
48 | 81 | /*static*/ private boolean CULLFACE = false; // true; |
---|
49 | 82 | /*static*/ boolean NEAREST = false; // true; |
---|
50 | 83 | /*static*/ boolean WIREFRAME = false; // true; |
---|
.. | .. |
---|
60 | 93 | //boolean REDUCETEXTURE = true; |
---|
61 | 94 | boolean CACHETEXTURE = true; |
---|
62 | 95 | boolean CLEANCACHE = false; // true; |
---|
63 | | - boolean MIPMAP = false; // true; |
---|
| 96 | + boolean MIPMAP = true; // false; // true; |
---|
64 | 97 | boolean COMPRESSTEXTURE = false; |
---|
65 | 98 | boolean KOMPACTTEXTURE = false; // true; |
---|
66 | 99 | boolean RESIZETEXTURE = false; |
---|
.. | .. |
---|
335 | 368 | display.options1[2] = material.shadowbias; |
---|
336 | 369 | display.options1[3] = material.aniso; |
---|
337 | 370 | display.options1[4] = material.anisoV; |
---|
| 371 | +// System.out.println("display.options1[0] " + display.options1[0]); |
---|
| 372 | +// System.out.println("display.options1[1] " + display.options1[1]); |
---|
| 373 | +// System.out.println("display.options1[2] " + display.options1[2]); |
---|
| 374 | +// System.out.println("display.options1[3] " + display.options1[3]); |
---|
| 375 | +// System.out.println("display.options1[4] " + display.options1[4]); |
---|
338 | 376 | display.options2[0] = material.opacity; |
---|
339 | 377 | display.options2[1] = material.diffuse; |
---|
340 | 378 | display.options2[2] = material.factor; |
---|
| 379 | +// System.out.println("display.options2[0] " + display.options2[0]); |
---|
| 380 | +// System.out.println("display.options2[1] " + display.options2[1]); |
---|
| 381 | +// System.out.println("display.options2[2] " + display.options2[2]); |
---|
341 | 382 | |
---|
342 | 383 | cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); |
---|
| 384 | +// System.out.println("display.options3[0] " + display.options3[0]); |
---|
| 385 | +// System.out.println("display.options3[1] " + display.options3[1]); |
---|
| 386 | +// System.out.println("display.options3[2] " + display.options3[2]); |
---|
343 | 387 | display.options4[0] = material.cameralight/0.2f; |
---|
344 | 388 | display.options4[1] = material.subsurface; |
---|
345 | 389 | display.options4[2] = material.sheen; |
---|
| 390 | +// System.out.println("display.options4[0] " + display.options4[0]); |
---|
| 391 | +// System.out.println("display.options4[1] " + display.options4[1]); |
---|
| 392 | +// System.out.println("display.options4[2] " + display.options4[2]); |
---|
346 | 393 | |
---|
347 | 394 | // if (display.CURRENTANTIALIAS > 0) |
---|
348 | 395 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
2051 | 2098 | //System.err.println("Oeil on"); |
---|
2052 | 2099 | OEIL = true; |
---|
2053 | 2100 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2054 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2101 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2055 | 2102 | //pingthread.StepToTarget(true); |
---|
2056 | 2103 | } |
---|
2057 | 2104 | |
---|
.. | .. |
---|
2284 | 2331 | HANDLES ^= true; |
---|
2285 | 2332 | } |
---|
2286 | 2333 | |
---|
| 2334 | + Object3D paintFolder; |
---|
| 2335 | + |
---|
2287 | 2336 | void TogglePaint() |
---|
2288 | 2337 | { |
---|
2289 | 2338 | PAINTMODE ^= true; |
---|
2290 | 2339 | paintcount = 0; |
---|
| 2340 | + |
---|
| 2341 | + if (PAINTMODE) |
---|
| 2342 | + { |
---|
| 2343 | + paintFolder = GetFolder(); |
---|
| 2344 | + } |
---|
2291 | 2345 | } |
---|
2292 | 2346 | |
---|
2293 | 2347 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
2384 | 2438 | return currentGL; |
---|
2385 | 2439 | } |
---|
2386 | 2440 | |
---|
| 2441 | + static private BufferedImage CreateBim(TextureData texturedata) |
---|
| 2442 | + { |
---|
| 2443 | + Grafreed.Assert(texturedata != null); |
---|
| 2444 | + |
---|
| 2445 | + int width = texturedata.getWidth(); |
---|
| 2446 | + int height = texturedata.getHeight(); |
---|
| 2447 | + |
---|
| 2448 | + Buffer buffer = texturedata.getBuffer(); |
---|
| 2449 | + ByteBuffer bytebuf = (ByteBuffer)buffer; |
---|
| 2450 | + |
---|
| 2451 | + byte[] bytes = bytebuf.array(); |
---|
| 2452 | + |
---|
| 2453 | + return CreateBim(bytes, width, height); |
---|
| 2454 | + } |
---|
| 2455 | + |
---|
2387 | 2456 | /**/ |
---|
2388 | 2457 | class CacheTexture |
---|
2389 | 2458 | { |
---|
.. | .. |
---|
2392 | 2461 | |
---|
2393 | 2462 | int resolution; |
---|
2394 | 2463 | |
---|
2395 | | - CacheTexture(com.sun.opengl.util.texture.Texture tex, int res) |
---|
| 2464 | + CacheTexture(com.sun.opengl.util.texture.TextureData texdata, int res) |
---|
2396 | 2465 | { |
---|
2397 | | - texture = tex; |
---|
| 2466 | + texture = com.sun.opengl.util.texture.TextureIO.newTexture(texdata); |
---|
| 2467 | + texturedata = texdata; |
---|
2398 | 2468 | resolution = res; |
---|
2399 | 2469 | } |
---|
2400 | 2470 | } |
---|
2401 | 2471 | /**/ |
---|
2402 | 2472 | |
---|
2403 | 2473 | // TEXTURE static Texture texture; |
---|
2404 | | - static public java.util.Hashtable<String, CacheTexture/*com.sun.opengl.util.texture.Texture*/> textures |
---|
2405 | | - = new java.util.Hashtable<String, CacheTexture/*com.sun.opengl.util.texture.Texture*/>(); |
---|
2406 | | - static public java.util.Hashtable<String, String> usedtextures = new java.util.Hashtable<String, String>(); |
---|
| 2474 | + static public Hashtable<cTexture, CacheTexture> texturepigment = new Hashtable<cTexture, CacheTexture>(); |
---|
| 2475 | + static public Hashtable<cTexture, CacheTexture> texturebump = new Hashtable<cTexture, CacheTexture>(); |
---|
| 2476 | + static public Hashtable<byte[], CacheTexture> bimtextures = new Hashtable<byte[], CacheTexture>(); |
---|
| 2477 | + static public java.util.HashSet<cTexture> usedtextures = new java.util.HashSet<cTexture>(); |
---|
| 2478 | + |
---|
2407 | 2479 | int pigmentdepth = 0; |
---|
2408 | 2480 | public com.sun.opengl.util.texture.Texture[] pigmentstack = new com.sun.opengl.util.texture.Texture[65536]; |
---|
2409 | 2481 | int bumpdepth = 0; |
---|
2410 | 2482 | public com.sun.opengl.util.texture.Texture[] bumpstack = new com.sun.opengl.util.texture.Texture[65536]; |
---|
2411 | 2483 | //public static String DEFAULT_TEXTURE = "DEFAULT_TEXTURE"; |
---|
2412 | 2484 | public static cTexture DEFAULT_TEXTURES = new cTexture("DEFAULT_TEXTURE" + ":" + "DEFAULT_TEXTURE_BUMP"); |
---|
2413 | | - public static String NOISE_TEXTURE = "WHITE_NOISE"; |
---|
| 2485 | + public static cTexture NOISE_TEXTURE = new cTexture("WHITE_NOISE:"); |
---|
2414 | 2486 | // public static cTexture IMMORTAL_TEXTURE = new cTexture("IMMORTAL"); |
---|
2415 | 2487 | |
---|
2416 | | - com.sun.opengl.util.texture.Texture GetResourceTexture(String name, boolean bump) |
---|
| 2488 | + com.sun.opengl.util.texture.TextureData GetResourceTexture(String name, boolean bump) |
---|
2417 | 2489 | { |
---|
2418 | 2490 | TextureData texturedata = null; |
---|
2419 | 2491 | |
---|
.. | .. |
---|
2432 | 2504 | if (bump) |
---|
2433 | 2505 | texturedata = ConvertBump(texturedata, false); |
---|
2434 | 2506 | |
---|
2435 | | - com.sun.opengl.util.texture.Texture texture = |
---|
2436 | | - com.sun.opengl.util.texture.TextureIO.newTexture(texturedata); |
---|
| 2507 | +// com.sun.opengl.util.texture.Texture texture = |
---|
| 2508 | +// com.sun.opengl.util.texture.TextureIO.newTexture(texturedata); |
---|
2437 | 2509 | |
---|
2438 | | - texture.setTexParameteri(javax.media.opengl.GL.GL_TEXTURE_WRAP_S, javax.media.opengl.GL.GL_REPEAT); |
---|
2439 | | - texture.setTexParameteri(javax.media.opengl.GL.GL_TEXTURE_WRAP_T, javax.media.opengl.GL.GL_REPEAT); |
---|
| 2510 | + //texture.setTexParameteri(javax.media.opengl.GL.GL_TEXTURE_WRAP_S, javax.media.opengl.GL.GL_REPEAT); |
---|
| 2511 | + //texture.setTexParameteri(javax.media.opengl.GL.GL_TEXTURE_WRAP_T, javax.media.opengl.GL.GL_REPEAT); |
---|
2440 | 2512 | |
---|
2441 | | - return texture; |
---|
| 2513 | + return texturedata; |
---|
| 2514 | + } |
---|
| 2515 | + |
---|
| 2516 | + com.sun.opengl.util.texture.TextureData GetBimTexture(BufferedImage bim, boolean bump) |
---|
| 2517 | + { |
---|
| 2518 | + TextureData texturedata = null; |
---|
| 2519 | + |
---|
| 2520 | + try |
---|
| 2521 | + { |
---|
| 2522 | + texturedata = |
---|
| 2523 | + com.sun.opengl.util.texture.TextureIO.newTextureData( |
---|
| 2524 | + bim, |
---|
| 2525 | + true); |
---|
| 2526 | + } catch (Exception e) |
---|
| 2527 | + { |
---|
| 2528 | + throw new javax.media.opengl.GLException(e); |
---|
| 2529 | + } |
---|
| 2530 | + |
---|
| 2531 | + if (bump) |
---|
| 2532 | + texturedata = ConvertBump(texturedata, false); |
---|
| 2533 | + |
---|
| 2534 | + return texturedata; |
---|
2442 | 2535 | } |
---|
2443 | 2536 | |
---|
2444 | 2537 | boolean HUESMOOTH = true; // wrap around bug... true; |
---|
.. | .. |
---|
3511 | 3604 | |
---|
3512 | 3605 | System.out.println("LOADING TEXTURE : " + name); |
---|
3513 | 3606 | |
---|
| 3607 | + Object x = texturedata.getMipmapData(); // .getBuffer(); |
---|
| 3608 | + |
---|
3514 | 3609 | // |
---|
3515 | 3610 | if (false) // compressbit > 0) |
---|
3516 | 3611 | { |
---|
.. | .. |
---|
7909 | 8004 | String pigment = Object3D.GetPigment(tex); |
---|
7910 | 8005 | String bump = Object3D.GetBump(tex); |
---|
7911 | 8006 | |
---|
7912 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8007 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7913 | 8008 | { |
---|
7914 | 8009 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7915 | 8010 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7924 | 8019 | pigment = null; |
---|
7925 | 8020 | } |
---|
7926 | 8021 | |
---|
7927 | | - ReleaseTexture(bump, true); |
---|
7928 | | - ReleaseTexture(pigment, false); |
---|
| 8022 | + ReleaseTexture(tex, true); |
---|
| 8023 | + ReleaseTexture(tex, false); |
---|
7929 | 8024 | } |
---|
7930 | 8025 | |
---|
7931 | 8026 | public void ReleasePigmentTexture(cTexture tex) // INTERFACE |
---|
.. | .. |
---|
7943 | 8038 | |
---|
7944 | 8039 | String pigment = Object3D.GetPigment(tex); |
---|
7945 | 8040 | |
---|
7946 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8041 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7947 | 8042 | { |
---|
7948 | 8043 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7949 | 8044 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7954 | 8049 | pigment = null; |
---|
7955 | 8050 | } |
---|
7956 | 8051 | |
---|
7957 | | - ReleaseTexture(pigment, false); |
---|
| 8052 | + ReleaseTexture(tex, false); |
---|
7958 | 8053 | } |
---|
7959 | 8054 | |
---|
7960 | 8055 | public void ReleaseBumpTexture(cTexture tex) // INTERFACE |
---|
.. | .. |
---|
7972 | 8067 | |
---|
7973 | 8068 | String bump = Object3D.GetBump(tex); |
---|
7974 | 8069 | |
---|
7975 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8070 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7976 | 8071 | { |
---|
7977 | 8072 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7978 | 8073 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7983 | 8078 | bump = null; |
---|
7984 | 8079 | } |
---|
7985 | 8080 | |
---|
7986 | | - ReleaseTexture(bump, true); |
---|
| 8081 | + ReleaseTexture(tex, true); |
---|
7987 | 8082 | } |
---|
7988 | 8083 | |
---|
7989 | | - void ReleaseTexture(String tex, boolean bump) |
---|
| 8084 | + void ReleaseTexture(cTexture tex, boolean bump) |
---|
7990 | 8085 | { |
---|
7991 | 8086 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
7992 | 8087 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
7997 | 8092 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
7998 | 8093 | |
---|
7999 | 8094 | if (tex != null) |
---|
8000 | | - texture = textures.get(tex); |
---|
| 8095 | + texture = bump ? texturebump.get(tex) : texturepigment.get(tex); |
---|
8001 | 8096 | |
---|
8002 | 8097 | // //assert( texture != null ); |
---|
8003 | 8098 | // if (texture == null) |
---|
.. | .. |
---|
8091 | 8186 | |
---|
8092 | 8187 | /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8093 | 8188 | { |
---|
8094 | | - if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8095 | | - ambientOcclusion ) // || !textureon) |
---|
8096 | | - { |
---|
8097 | | - return; // false; |
---|
8098 | | - } |
---|
8099 | | - |
---|
8100 | | - if (tex == null) |
---|
8101 | | - { |
---|
8102 | | - BindTexture(null,false,resolution); |
---|
8103 | | - BindTexture(null,true,resolution); |
---|
8104 | | - return; |
---|
8105 | | - } |
---|
| 8189 | +// if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8190 | +// ambientOcclusion ) // || !textureon) |
---|
| 8191 | +// { |
---|
| 8192 | +// return; // false; |
---|
| 8193 | +// } |
---|
| 8194 | +// |
---|
| 8195 | +// if (tex == null) |
---|
| 8196 | +// { |
---|
| 8197 | +// BindTexture(null,false,resolution); |
---|
| 8198 | +// BindTexture(null,true,resolution); |
---|
| 8199 | +// return; |
---|
| 8200 | +// } |
---|
| 8201 | +// |
---|
| 8202 | +// String pigment = Object3D.GetPigment(tex); |
---|
| 8203 | +// String bump = Object3D.GetBump(tex); |
---|
| 8204 | +// |
---|
| 8205 | +// usedtextures.add(pigment); |
---|
| 8206 | +// usedtextures.add(bump); |
---|
| 8207 | +// |
---|
| 8208 | +// //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8209 | +// { |
---|
| 8210 | +// // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8211 | +// // System.out.println("; bump = " + bump); |
---|
| 8212 | +// } |
---|
| 8213 | +// |
---|
| 8214 | +// if (bump.equals("")) |
---|
| 8215 | +// { |
---|
| 8216 | +// bump = null; |
---|
| 8217 | +// } |
---|
| 8218 | +// if (pigment.equals("")) |
---|
| 8219 | +// { |
---|
| 8220 | +// pigment = null; |
---|
| 8221 | +// } |
---|
| 8222 | +// |
---|
| 8223 | +// GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8224 | +// BindTexture(pigment, false, resolution); |
---|
| 8225 | +// GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
| 8226 | +// BindTexture(bump, true, resolution); |
---|
| 8227 | +// GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8228 | +// |
---|
| 8229 | +// return; // true; |
---|
8106 | 8230 | |
---|
8107 | | - String pigment = Object3D.GetPigment(tex); |
---|
8108 | | - String bump = Object3D.GetBump(tex); |
---|
8109 | | - |
---|
8110 | | - usedtextures.put(pigment, pigment); |
---|
8111 | | - usedtextures.put(bump, bump); |
---|
8112 | | - |
---|
8113 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8114 | | - { |
---|
8115 | | - // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8116 | | - // System.out.println("; bump = " + bump); |
---|
8117 | | - } |
---|
8118 | | - |
---|
8119 | | - if (bump.equals("")) |
---|
8120 | | - { |
---|
8121 | | - bump = null; |
---|
8122 | | - } |
---|
8123 | | - if (pigment.equals("")) |
---|
8124 | | - { |
---|
8125 | | - pigment = null; |
---|
8126 | | - } |
---|
8127 | | - |
---|
8128 | | - GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8129 | | - BindTexture(pigment, false, resolution); |
---|
8130 | | - GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
8131 | | - BindTexture(bump, true, resolution); |
---|
8132 | | - GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8133 | | - |
---|
8134 | | - return; // true; |
---|
| 8231 | + BindPigmentTexture(tex, resolution); |
---|
| 8232 | + BindBumpTexture(tex, resolution); |
---|
8135 | 8233 | } |
---|
8136 | 8234 | |
---|
8137 | 8235 | /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
.. | .. |
---|
8150 | 8248 | |
---|
8151 | 8249 | String pigment = Object3D.GetPigment(tex); |
---|
8152 | 8250 | |
---|
8153 | | - usedtextures.put(pigment, pigment); |
---|
| 8251 | + usedtextures.add(tex); |
---|
8154 | 8252 | |
---|
8155 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8253 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8156 | 8254 | { |
---|
8157 | 8255 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8158 | 8256 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8164 | 8262 | } |
---|
8165 | 8263 | |
---|
8166 | 8264 | GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8167 | | - BindTexture(pigment, false, resolution); |
---|
| 8265 | + BindTexture(tex, false, resolution); |
---|
8168 | 8266 | } |
---|
8169 | 8267 | |
---|
8170 | 8268 | /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
.. | .. |
---|
8183 | 8281 | |
---|
8184 | 8282 | String bump = Object3D.GetBump(tex); |
---|
8185 | 8283 | |
---|
8186 | | - usedtextures.put(bump, bump); |
---|
| 8284 | + usedtextures.add(tex); |
---|
8187 | 8285 | |
---|
8188 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8286 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8189 | 8287 | { |
---|
8190 | 8288 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8191 | 8289 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8197 | 8295 | } |
---|
8198 | 8296 | |
---|
8199 | 8297 | GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
8200 | | - BindTexture(bump, true, resolution); |
---|
| 8298 | + BindTexture(tex, true, resolution); |
---|
8201 | 8299 | GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8202 | 8300 | } |
---|
8203 | 8301 | |
---|
.. | .. |
---|
8221 | 8319 | return fileExists; |
---|
8222 | 8320 | } |
---|
8223 | 8321 | |
---|
8224 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
| 8322 | + CacheTexture GetCacheTexture(cTexture tex, boolean bump, int resolution) throws Exception |
---|
8225 | 8323 | { |
---|
8226 | | - CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
| 8324 | + CacheTexture texturecache = null; |
---|
8227 | 8325 | |
---|
8228 | 8326 | if (tex != null) |
---|
8229 | 8327 | { |
---|
8230 | | - String texname = tex; |
---|
| 8328 | + String texname = bump ? Object3D.GetBump(tex) : Object3D.GetPigment(tex); |
---|
| 8329 | + byte[] texdata = bump ? tex.bumpdata : tex.pigmentdata; |
---|
| 8330 | + |
---|
| 8331 | + if (texname.equals("") && texdata == null) |
---|
| 8332 | + { |
---|
| 8333 | + return null; |
---|
| 8334 | + } |
---|
8231 | 8335 | |
---|
8232 | 8336 | String fallbackTextureName = defaultDirectory + "/Textures/" + texname; |
---|
8233 | 8337 | |
---|
.. | .. |
---|
8237 | 8341 | // else |
---|
8238 | 8342 | // if (!texname.startsWith("/")) |
---|
8239 | 8343 | // texname = "/Users/nbriere/Textures/" + texname; |
---|
8240 | | - if (!FileExists(tex)) |
---|
| 8344 | + if (!FileExists(texname)) |
---|
8241 | 8345 | { |
---|
8242 | 8346 | texname = fallbackTextureName; |
---|
8243 | 8347 | } |
---|
8244 | 8348 | |
---|
8245 | 8349 | if (CACHETEXTURE) |
---|
8246 | | - texture = textures.get(texname); // TEXTURE CACHE |
---|
8247 | | - |
---|
8248 | | - TextureData texturedata = null; |
---|
8249 | | - |
---|
8250 | | - if (texture == null || texture.resolution < resolution) |
---|
8251 | 8350 | { |
---|
8252 | | - if (tex.equals("DEFAULT_TEXTURE")) // ||*/ tex.equals("")) |
---|
| 8351 | + if (texdata == null) |
---|
| 8352 | + texturecache = bump ? texturebump.get(tex) : texturepigment.get(tex); |
---|
| 8353 | + else |
---|
| 8354 | + texturecache = bimtextures.get(texdata); |
---|
| 8355 | + } |
---|
| 8356 | + |
---|
| 8357 | + if (texturecache == null || texturecache.resolution != -1 && texturecache.resolution < resolution) |
---|
| 8358 | + { |
---|
| 8359 | + TextureData texturedata = null; |
---|
| 8360 | + |
---|
| 8361 | + if (texdata != null) |
---|
| 8362 | + { |
---|
| 8363 | + BufferedImage bim = //new BufferedImage(bump?tex.bw:tex.pw, bump?tex.bh:tex.ph, BufferedImage.TYPE_INT_RGB); |
---|
| 8364 | + |
---|
| 8365 | + CreateBim(texdata, bump?tex.bw:tex.pw, bump?tex.bh:tex.ph); |
---|
| 8366 | + |
---|
| 8367 | + texturecache = new CacheTexture(GetBimTexture(bim, bump), -1); |
---|
| 8368 | + bimtextures.put(texdata, texturecache); |
---|
| 8369 | + } |
---|
| 8370 | + else |
---|
| 8371 | + if (texname.endsWith("DEFAULT_TEXTURE")) // ||*/ tex.equals("")) |
---|
8253 | 8372 | { |
---|
8254 | 8373 | assert(!bump); |
---|
8255 | 8374 | // if (bump) |
---|
.. | .. |
---|
8260 | 8379 | // } |
---|
8261 | 8380 | // else |
---|
8262 | 8381 | // { |
---|
8263 | | - texture = textures.get(tex); |
---|
8264 | | - if (texture == null) |
---|
| 8382 | + // texturecache = textures.get(texname); // suspicious |
---|
| 8383 | + if (texturecache == null) |
---|
8265 | 8384 | { |
---|
8266 | | - texture = new CacheTexture(GetResourceTexture("default.png", bump),resolution); |
---|
| 8385 | + texturecache = new CacheTexture(GetResourceTexture("default.png", bump),resolution); |
---|
8267 | 8386 | } |
---|
| 8387 | + else |
---|
| 8388 | + new Exception().printStackTrace(); |
---|
8268 | 8389 | // } |
---|
8269 | 8390 | } else |
---|
8270 | | - if (tex.equals("DEFAULT_TEXTURE_BUMP")) // ||*/ tex.equals("")) |
---|
| 8391 | + if (texname.endsWith("DEFAULT_TEXTURE_BUMP")) // ||*/ tex.equals("")) |
---|
8271 | 8392 | { |
---|
8272 | 8393 | assert(bump); |
---|
8273 | | - texture = textures.get(tex); |
---|
8274 | | - if (texture == null) |
---|
8275 | | - texture = new CacheTexture(GetResourceTexture("default.png", bump),resolution); |
---|
| 8394 | + // texturecache = textures.get(texname); // suspicious |
---|
| 8395 | + if (texturecache == null) |
---|
| 8396 | + texturecache = new CacheTexture(GetResourceTexture("default.png", bump),resolution); |
---|
| 8397 | + else |
---|
| 8398 | + new Exception().printStackTrace(); |
---|
8276 | 8399 | } else |
---|
8277 | 8400 | { |
---|
8278 | 8401 | //if (tex.equals("IMMORTAL")) |
---|
.. | .. |
---|
8280 | 8403 | // texture = GetResourceTexture("default.png"); |
---|
8281 | 8404 | //} else |
---|
8282 | 8405 | //{ |
---|
8283 | | - if (tex.equals("WHITE_NOISE")) |
---|
| 8406 | + if (texname.endsWith("WHITE_NOISE")) |
---|
8284 | 8407 | { |
---|
8285 | | - texture = textures.get(tex); |
---|
8286 | | - if (texture == null) |
---|
8287 | | - texture = new CacheTexture(GetResourceTexture("whitenoise.png", bump),resolution); |
---|
| 8408 | + // texturecache = textures.get(texname); // suspicious |
---|
| 8409 | + if (texturecache == null) |
---|
| 8410 | + texturecache = new CacheTexture(GetResourceTexture("whitenoise.png", bump),resolution); |
---|
| 8411 | + else |
---|
| 8412 | + new Exception().printStackTrace(); |
---|
8288 | 8413 | } else |
---|
8289 | 8414 | { |
---|
8290 | 8415 | if (textureon) |
---|
.. | .. |
---|
8343 | 8468 | if (texturedata == null) |
---|
8344 | 8469 | throw new Exception(); |
---|
8345 | 8470 | |
---|
8346 | | - texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
| 8471 | + texturecache = new CacheTexture(texturedata,resolution); |
---|
8347 | 8472 | //texture = GetTexture(tex, bump); |
---|
8348 | 8473 | } |
---|
8349 | 8474 | } |
---|
8350 | 8475 | //} |
---|
8351 | 8476 | } |
---|
8352 | 8477 | |
---|
8353 | | - if (/*CACHETEXTURE &&*/ texture != null && textureon) |
---|
| 8478 | + if (texdata == null && /*CACHETEXTURE &&*/ texturecache != null && textureon) |
---|
8354 | 8479 | { |
---|
8355 | 8480 | //return false; |
---|
8356 | 8481 | |
---|
8357 | 8482 | // System.out.println("CACHE +++++++++++++++ TEXTURE : " + texname + " (" + texture.getEstimatedMemorySize() + ")"); |
---|
8358 | | - if (texturedata != null && (texname.endsWith(".jpg") || texname.endsWith(".JPG"))) |
---|
| 8483 | + if (texturedata != null && texname.toLowerCase().endsWith(".jpg")) |
---|
8359 | 8484 | { |
---|
8360 | 8485 | // String ext = "_highres"; |
---|
8361 | 8486 | // if (REDUCETEXTURE) |
---|
.. | .. |
---|
8372 | 8497 | File cachefile = new File(texname.substring(0, texname.length()-4)+ext+".jpg"); |
---|
8373 | 8498 | if (!cachefile.exists()) |
---|
8374 | 8499 | { |
---|
8375 | | - // cache to disk |
---|
8376 | | - Buffer buffer = texturedata.getBuffer(); // getMipmapData(); |
---|
8377 | | - //buffers[0]. |
---|
8378 | | - |
---|
8379 | | - ByteBuffer bytebuf = (ByteBuffer)buffer; // ).asIntBuffer(); |
---|
8380 | | - int[] pixels = new int[bytebuf.capacity()/3]; |
---|
8381 | | - |
---|
8382 | | - // squared size heuristic... |
---|
8383 | | - if ((int)Math.sqrt(pixels.length) == Math.sqrt(pixels.length)) |
---|
| 8500 | + //if (texturedata.getWidth() == texturedata.getHeight()) |
---|
8384 | 8501 | { |
---|
8385 | | - for (int i=pixels.length; --i>=0;) |
---|
8386 | | - { |
---|
8387 | | - int i3 = i*3; |
---|
8388 | | - pixels[i] = 0xFF; |
---|
8389 | | - pixels[i] <<= 8; |
---|
8390 | | - pixels[i] |= bytebuf.get(i3+2) & 0xFF; |
---|
8391 | | - pixels[i] <<= 8; |
---|
8392 | | - pixels[i] |= bytebuf.get(i3+1) & 0xFF; |
---|
8393 | | - pixels[i] <<= 8; |
---|
8394 | | - pixels[i] |= bytebuf.get(i3) & 0xFF; |
---|
8395 | | - } |
---|
8396 | | - |
---|
8397 | | - /* |
---|
8398 | | - int r=0,g=0,b=0,a=0; |
---|
8399 | | - for (int i=0; i<width; i++) |
---|
8400 | | - for (int j=0; j<height; j++) |
---|
8401 | | - { |
---|
8402 | | - int index = j*width+i; |
---|
8403 | | - int p = pixels[index]; |
---|
8404 | | - a = ((p>>24) & 0xFF); |
---|
8405 | | - r = ((p>>16) & 0xFF); |
---|
8406 | | - g = ((p>>8) & 0xFF); |
---|
8407 | | - b = (p & 0xFF); |
---|
8408 | | - pixels[index] = (a<<24) | (b<<16) | (g<<8) | r; |
---|
8409 | | - } |
---|
8410 | | - /**/ |
---|
8411 | | - int width = (int)Math.sqrt(pixels.length); // squared |
---|
8412 | | - int height = width; |
---|
8413 | | - BufferedImage rendImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // ImageIO.read(infile); |
---|
8414 | | - rendImage.setRGB(0,0,width,height,pixels,width*(height-1),-width); |
---|
| 8502 | + BufferedImage rendImage = CreateBim(texturedata); |
---|
| 8503 | + |
---|
8415 | 8504 | ImageWriter writer = null; |
---|
8416 | 8505 | Iterator iter = ImageIO.getImageWritersByFormatName("jpg"); |
---|
8417 | 8506 | if (iter.hasNext()) { |
---|
8418 | 8507 | writer = (ImageWriter)iter.next(); |
---|
8419 | 8508 | } |
---|
8420 | | - float compressionQuality = 0.9f; |
---|
| 8509 | + |
---|
| 8510 | + float compressionQuality = 0.85f; |
---|
8421 | 8511 | try |
---|
8422 | 8512 | { |
---|
8423 | 8513 | ImageOutputStream ios = ImageIO.createImageOutputStream(cachefile); |
---|
.. | .. |
---|
8434 | 8524 | } |
---|
8435 | 8525 | } |
---|
8436 | 8526 | } |
---|
8437 | | - |
---|
| 8527 | + |
---|
| 8528 | + Hashtable<cTexture, CacheTexture> textures = bump ? texturebump : texturepigment; |
---|
| 8529 | + |
---|
8438 | 8530 | //System.out.println("Texture = " + tex); |
---|
8439 | | - if (textures.containsKey(texname)) |
---|
| 8531 | + if (textures.containsKey(tex)) |
---|
8440 | 8532 | { |
---|
8441 | | - CacheTexture thetex = textures.get(texname); |
---|
| 8533 | + CacheTexture thetex = textures.get(tex); |
---|
8442 | 8534 | thetex.texture.disable(); |
---|
8443 | 8535 | thetex.texture.dispose(); |
---|
8444 | | - textures.remove(texname); |
---|
| 8536 | + textures.remove(tex); |
---|
8445 | 8537 | } |
---|
8446 | 8538 | |
---|
8447 | | - texture.texturedata = texturedata; |
---|
8448 | | - textures.put(texname, texture); |
---|
| 8539 | + //texture.texturedata = texturedata; |
---|
| 8540 | + textures.put(tex, texturecache); |
---|
8449 | 8541 | |
---|
8450 | 8542 | // newtex = true; |
---|
8451 | 8543 | } |
---|
.. | .. |
---|
8461 | 8553 | } |
---|
8462 | 8554 | } |
---|
8463 | 8555 | |
---|
8464 | | - return texture; |
---|
| 8556 | + return texturecache; |
---|
8465 | 8557 | } |
---|
8466 | 8558 | |
---|
8467 | | - com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception |
---|
| 8559 | + static void EmbedTextures(cTexture tex) |
---|
| 8560 | + { |
---|
| 8561 | + if (tex.pigmentdata == null) |
---|
| 8562 | + { |
---|
| 8563 | + String texname = Object3D.GetPigment(tex); |
---|
| 8564 | + |
---|
| 8565 | + CacheTexture texturecache = texturepigment.get(tex); |
---|
| 8566 | + |
---|
| 8567 | + if (texturecache != null) |
---|
| 8568 | + { |
---|
| 8569 | + tex.pigmentdata = ((ByteBuffer)texturecache.texturedata.getBuffer()).array(); |
---|
| 8570 | + tex.pw = texturecache.texturedata.getWidth(); |
---|
| 8571 | + tex.ph = texturecache.texturedata.getHeight(); |
---|
| 8572 | + } |
---|
| 8573 | + } |
---|
| 8574 | + |
---|
| 8575 | + if (tex.bumpdata == null) |
---|
| 8576 | + { |
---|
| 8577 | + String texname = Object3D.GetBump(tex); |
---|
| 8578 | + |
---|
| 8579 | + CacheTexture texturecache = texturebump.get(tex); |
---|
| 8580 | + |
---|
| 8581 | + if (texturecache != null) |
---|
| 8582 | + { |
---|
| 8583 | + tex.bumpdata = ((ByteBuffer)texturecache.texturedata.getBuffer()).array(); |
---|
| 8584 | + tex.bw = texturecache.texturedata.getWidth(); |
---|
| 8585 | + tex.bh = texturecache.texturedata.getHeight(); |
---|
| 8586 | + } |
---|
| 8587 | + } |
---|
| 8588 | + } |
---|
| 8589 | + |
---|
| 8590 | + com.sun.opengl.util.texture.Texture GetTexture(cTexture tex, boolean bump, int resolution) throws Exception |
---|
8468 | 8591 | { |
---|
8469 | 8592 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8470 | 8593 | |
---|
.. | .. |
---|
8482 | 8605 | return texture!=null?texture.texture:null; |
---|
8483 | 8606 | } |
---|
8484 | 8607 | |
---|
8485 | | - public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception |
---|
| 8608 | + public com.sun.opengl.util.texture.TextureData GetTextureData(cTexture tex, boolean bump, int resolution) throws Exception |
---|
8486 | 8609 | { |
---|
8487 | 8610 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8488 | 8611 | |
---|
8489 | 8612 | return texture!=null?texture.texturedata:null; |
---|
8490 | 8613 | } |
---|
8491 | 8614 | |
---|
8492 | | - boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
| 8615 | + boolean BindTexture(cTexture tex, boolean bump, int resolution) throws Exception |
---|
8493 | 8616 | { |
---|
8494 | 8617 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8495 | 8618 | { |
---|
8496 | 8619 | return false; |
---|
8497 | 8620 | } |
---|
8498 | 8621 | |
---|
8499 | | - boolean newtex = false; |
---|
| 8622 | + //boolean newtex = false; |
---|
8500 | 8623 | |
---|
8501 | 8624 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8502 | 8625 | |
---|
.. | .. |
---|
8528 | 8651 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); |
---|
8529 | 8652 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); |
---|
8530 | 8653 | |
---|
8531 | | - return newtex; |
---|
| 8654 | + return true; // Warning: not used. |
---|
8532 | 8655 | } |
---|
8533 | 8656 | |
---|
8534 | 8657 | ShadowBuffer shadowPBuf; |
---|
.. | .. |
---|
9366 | 9489 | jy8[3] = 0.5f; |
---|
9367 | 9490 | } |
---|
9368 | 9491 | |
---|
9369 | | - float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
| 9492 | + float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
9370 | 9493 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9371 | 9494 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9372 | 9495 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9373 | 9496 | |
---|
| 9497 | + void ResetOptions() |
---|
| 9498 | + { |
---|
| 9499 | + options1[0] = 100; |
---|
| 9500 | + options1[1] = 0.025f; |
---|
| 9501 | + options1[2] = 0.01f; |
---|
| 9502 | + options1[3] = 0; |
---|
| 9503 | + options1[4] = 0; |
---|
| 9504 | + |
---|
| 9505 | + options2[0] = 0; |
---|
| 9506 | + options2[1] = 0.75f; |
---|
| 9507 | + options2[2] = 0; |
---|
| 9508 | + options2[3] = 0; |
---|
| 9509 | + |
---|
| 9510 | + options3[0] = 1; |
---|
| 9511 | + options3[1] = 1; |
---|
| 9512 | + options3[2] = 1; |
---|
| 9513 | + options3[3] = 0; |
---|
| 9514 | + |
---|
| 9515 | + options4[0] = 1; |
---|
| 9516 | + options4[1] = 0; |
---|
| 9517 | + options4[2] = 1; |
---|
| 9518 | + options4[3] = 0; |
---|
| 9519 | + } |
---|
| 9520 | + |
---|
9374 | 9521 | static int imagecount = 0; // movie generation |
---|
9375 | 9522 | |
---|
9376 | 9523 | static int jitter = 0; |
---|
.. | .. |
---|
10990 | 11137 | |
---|
10991 | 11138 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
10992 | 11139 | |
---|
10993 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
10994 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
10995 | | -//gl.glEnable(gl.GL_MULTISAMPLE); |
---|
| 11140 | +gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
| 11141 | +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
| 11142 | +gl.glEnable(gl.GL_MULTISAMPLE); |
---|
10996 | 11143 | } else |
---|
10997 | 11144 | { |
---|
10998 | 11145 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11003 | 11150 | //System.out.println("BLENDING ON"); |
---|
11004 | 11151 | gl.glEnable(GL.GL_BLEND); |
---|
11005 | 11152 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11006 | | - |
---|
| 11153 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11007 | 11154 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11008 | 11155 | gl.glLoadIdentity(); |
---|
11009 | 11156 | |
---|
.. | .. |
---|
11480 | 11627 | |
---|
11481 | 11628 | void DrawObject(GL gl, boolean draw) |
---|
11482 | 11629 | { |
---|
| 11630 | + // To clear camera values |
---|
| 11631 | + ResetOptions(); |
---|
| 11632 | + |
---|
11483 | 11633 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11484 | 11634 | // DrawMode() = SELECTION; |
---|
11485 | 11635 | //GL gl = getGL(); |
---|
11486 | 11636 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11487 | 11637 | { |
---|
11488 | 11638 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11489 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11639 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11490 | 11640 | pingthread.StepToTarget(true); // true); |
---|
11491 | 11641 | // zoomonce = false; |
---|
11492 | 11642 | } |
---|
.. | .. |
---|
11614 | 11764 | ReleaseTextures(DEFAULT_TEXTURES); |
---|
11615 | 11765 | |
---|
11616 | 11766 | if (CLEANCACHE) |
---|
11617 | | - for (java.util.Enumeration<String> e = textures.keys() ; e.hasMoreElements();) |
---|
| 11767 | + for (java.util.Enumeration<cTexture> e = texturepigment.keys() ; e.hasMoreElements();) |
---|
11618 | 11768 | { |
---|
11619 | | - String tex = e.nextElement(); |
---|
| 11769 | + cTexture tex = e.nextElement(); |
---|
11620 | 11770 | |
---|
11621 | 11771 | // System.out.println("Texture --------- " + tex); |
---|
11622 | 11772 | |
---|
11623 | | - if (tex.equals("WHITE_NOISE")) |
---|
| 11773 | + if (tex.equals("WHITE_NOISE:")) |
---|
11624 | 11774 | continue; |
---|
11625 | 11775 | |
---|
11626 | | - if (!usedtextures.containsKey(tex)) |
---|
| 11776 | + if (!usedtextures.contains(tex)) |
---|
11627 | 11777 | { |
---|
| 11778 | + CacheTexture gettex = texturepigment.get(tex); |
---|
11628 | 11779 | // System.out.println("DISPOSE +++++++++++++++ " + tex); |
---|
11629 | | - textures.get(tex).texture.dispose(); |
---|
11630 | | - textures.remove(tex); |
---|
| 11780 | + if (gettex != null) |
---|
| 11781 | + { |
---|
| 11782 | + gettex.texture.dispose(); |
---|
| 11783 | + texturepigment.remove(tex); |
---|
| 11784 | + } |
---|
| 11785 | + |
---|
| 11786 | + gettex = texturebump.get(tex); |
---|
| 11787 | + // System.out.println("DISPOSE +++++++++++++++ " + tex); |
---|
| 11788 | + if (gettex != null) |
---|
| 11789 | + { |
---|
| 11790 | + gettex.texture.dispose(); |
---|
| 11791 | + texturebump.remove(tex); |
---|
| 11792 | + } |
---|
11631 | 11793 | } |
---|
11632 | 11794 | } |
---|
11633 | 11795 | } |
---|
.. | .. |
---|
13334 | 13496 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13335 | 13497 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13336 | 13498 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13337 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13338 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13339 | | - //"MOV " + dest + ".z," + "params2.w;" + |
---|
| 13499 | +// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET |
---|
| 13500 | +// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
| 13501 | + |
---|
| 13502 | + "MOV " + dest + ".z," + "params2.w;" + // EXACT |
---|
13340 | 13503 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13341 | 13504 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13342 | 13505 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13901 | 14064 | |
---|
13902 | 14065 | // fev 2014??? |
---|
13903 | 14066 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13904 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 14067 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13905 | 14068 | pingthread.StepToTarget(true); // true); |
---|
13906 | 14069 | } |
---|
13907 | 14070 | // if (!LIVE) |
---|
.. | .. |
---|
14255 | 14418 | void GoDown(int mod) |
---|
14256 | 14419 | { |
---|
14257 | 14420 | MODIFIERS |= COMMAND; |
---|
14258 | | - /* |
---|
| 14421 | + /**/ |
---|
14259 | 14422 | if((mod&SHIFT) == SHIFT) |
---|
14260 | 14423 | manipCamera.RotatePosition(0, -speed); |
---|
14261 | 14424 | else |
---|
14262 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14263 | | - */ |
---|
| 14425 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14426 | + /**/ |
---|
14264 | 14427 | if ((mod & SHIFT) == SHIFT) |
---|
14265 | 14428 | { |
---|
14266 | 14429 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14276 | 14439 | void GoUp(int mod) |
---|
14277 | 14440 | { |
---|
14278 | 14441 | MODIFIERS |= COMMAND; |
---|
14279 | | - /* |
---|
| 14442 | + /**/ |
---|
14280 | 14443 | if((mod&SHIFT) == SHIFT) |
---|
14281 | 14444 | manipCamera.RotatePosition(0, speed); |
---|
14282 | 14445 | else |
---|
14283 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14284 | | - */ |
---|
| 14446 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14447 | + /**/ |
---|
14285 | 14448 | if ((mod & SHIFT) == SHIFT) |
---|
14286 | 14449 | { |
---|
14287 | 14450 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14297 | 14460 | void GoLeft(int mod) |
---|
14298 | 14461 | { |
---|
14299 | 14462 | MODIFIERS |= COMMAND; |
---|
14300 | | - /* |
---|
| 14463 | + /**/ |
---|
14301 | 14464 | if((mod&SHIFT) == SHIFT) |
---|
14302 | | - manipCamera.RotatePosition(speed, 0); |
---|
14303 | | - else |
---|
14304 | 14465 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14305 | | - */ |
---|
| 14466 | + else |
---|
| 14467 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14468 | + /**/ |
---|
14306 | 14469 | if ((mod & SHIFT) == SHIFT) |
---|
14307 | 14470 | { |
---|
14308 | 14471 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14318 | 14481 | void GoRight(int mod) |
---|
14319 | 14482 | { |
---|
14320 | 14483 | MODIFIERS |= COMMAND; |
---|
14321 | | - /* |
---|
| 14484 | + /**/ |
---|
14322 | 14485 | if((mod&SHIFT) == SHIFT) |
---|
14323 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14324 | | - else |
---|
14325 | 14486 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14326 | | - */ |
---|
| 14487 | + else |
---|
| 14488 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14489 | + /**/ |
---|
14327 | 14490 | if ((mod & SHIFT) == SHIFT) |
---|
14328 | 14491 | { |
---|
14329 | 14492 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14562 | 14725 | Globals.MOUSEDRAGGED = false; |
---|
14563 | 14726 | |
---|
14564 | 14727 | movingcamera = false; |
---|
14565 | | - X = Y = 0; |
---|
| 14728 | + X = 0; // getBounds().width/2; |
---|
| 14729 | + Y = 0; // getBounds().height/2; |
---|
14566 | 14730 | //System.out.println("mouseReleased: " + e); |
---|
14567 | 14731 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14568 | 14732 | } |
---|
.. | .. |
---|
14818 | 14982 | // break; |
---|
14819 | 14983 | case 'T': |
---|
14820 | 14984 | CACHETEXTURE ^= true; |
---|
14821 | | - textures.clear(); |
---|
| 14985 | + texturepigment.clear(); |
---|
| 14986 | + texturebump.clear(); |
---|
14822 | 14987 | // repaint(); |
---|
14823 | 14988 | break; |
---|
14824 | 14989 | case 'Y': |
---|
.. | .. |
---|
14903 | 15068 | case 'E' : COMPACT ^= true; |
---|
14904 | 15069 | repaint(); |
---|
14905 | 15070 | break; |
---|
14906 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 15071 | + case 'W' : // Wide Window (fullscreen) |
---|
| 15072 | + //DEBUGHSB ^= true; |
---|
| 15073 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14907 | 15074 | repaint(); |
---|
14908 | 15075 | break; |
---|
14909 | 15076 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14929 | 15096 | repaint(); |
---|
14930 | 15097 | break; |
---|
14931 | 15098 | case 'l': |
---|
14932 | | - lightMode ^= true; |
---|
14933 | | - Globals.lighttouched = true; |
---|
14934 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14935 | | - targetLookAt.set(manipCamera.lookAt); |
---|
14936 | | - repaint(); |
---|
14937 | | - break; |
---|
14938 | | - case 'L': |
---|
| 15099 | + //case 'L': |
---|
14939 | 15100 | if (lightMode) |
---|
14940 | 15101 | { |
---|
14941 | 15102 | lightMode = false; |
---|
.. | .. |
---|
15078 | 15239 | case '_': |
---|
15079 | 15240 | kompactbit = 5; |
---|
15080 | 15241 | break; |
---|
15081 | | - case '+': |
---|
15082 | | - kompactbit = 6; |
---|
15083 | | - break; |
---|
| 15242 | +// case '+': |
---|
| 15243 | +// kompactbit = 6; |
---|
| 15244 | +// break; |
---|
15084 | 15245 | case ' ': |
---|
15085 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15246 | + lightMode ^= true; |
---|
| 15247 | + Globals.lighttouched = true; |
---|
| 15248 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15249 | + targetLookAt.set(manipCamera.lookAt); |
---|
15086 | 15250 | repaint(); |
---|
15087 | 15251 | break; |
---|
15088 | 15252 | //case '`' : |
---|
.. | .. |
---|
15129 | 15293 | case DELETE: |
---|
15130 | 15294 | ClearSelection(); |
---|
15131 | 15295 | break; |
---|
15132 | | - /* |
---|
15133 | 15296 | case '+': |
---|
| 15297 | + |
---|
| 15298 | + /* |
---|
15134 | 15299 | //fontsize += 1; |
---|
15135 | 15300 | bbzoom *= 2; |
---|
15136 | 15301 | repaint(); |
---|
.. | .. |
---|
15147 | 15312 | case '=': |
---|
15148 | 15313 | IncDepth(); |
---|
15149 | 15314 | //fontsize += 1; |
---|
15150 | | - object.editWindow.refreshContents(true); |
---|
| 15315 | + object.GetWindow().refreshContents(true); |
---|
15151 | 15316 | maskbit = 6; |
---|
15152 | 15317 | break; |
---|
15153 | 15318 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15154 | 15319 | DecDepth(); |
---|
15155 | 15320 | maskbit = 5; |
---|
15156 | 15321 | //if(fontsize > 1) fontsize -= 1; |
---|
15157 | | - if (object.editWindow == null) |
---|
15158 | | - new Exception().printStackTrace(); |
---|
15159 | | - else |
---|
15160 | | - object.editWindow.refreshContents(true); |
---|
| 15322 | +// if (object.editWindow == null) |
---|
| 15323 | +// new Exception().printStackTrace(); |
---|
| 15324 | +// else |
---|
| 15325 | + object.GetWindow().refreshContents(true); |
---|
15161 | 15326 | break; |
---|
15162 | 15327 | case '{': |
---|
15163 | 15328 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15381 | 15546 | } |
---|
15382 | 15547 | */ |
---|
15383 | 15548 | |
---|
15384 | | - object.editWindow.EditSelection(false); |
---|
| 15549 | + object.GetWindow().EditSelection(false); |
---|
15385 | 15550 | } |
---|
15386 | 15551 | |
---|
15387 | 15552 | void SelectParent() |
---|
.. | .. |
---|
15398 | 15563 | { |
---|
15399 | 15564 | //selectees.remove(i); |
---|
15400 | 15565 | System.out.println("select parent of " + elem); |
---|
15401 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15566 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15402 | 15567 | } else |
---|
15403 | 15568 | { |
---|
15404 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15569 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15405 | 15570 | } |
---|
15406 | 15571 | |
---|
15407 | 15572 | first = false; |
---|
.. | .. |
---|
15443 | 15608 | for (int j = 0; j < group.children.size(); j++) |
---|
15444 | 15609 | { |
---|
15445 | 15610 | elem = (Object3D) group.children.elementAt(j); |
---|
15446 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15611 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15447 | 15612 | first = false; |
---|
15448 | 15613 | } |
---|
15449 | 15614 | } else |
---|
15450 | 15615 | { |
---|
15451 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15616 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15452 | 15617 | } |
---|
15453 | 15618 | |
---|
15454 | 15619 | first = false; |
---|
.. | .. |
---|
15459 | 15624 | { |
---|
15460 | 15625 | //Composite group = (Composite) object; |
---|
15461 | 15626 | Object3D group = object; |
---|
15462 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15627 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15463 | 15628 | } |
---|
15464 | 15629 | |
---|
15465 | 15630 | void ResetTransform(int mask) |
---|
15466 | 15631 | { |
---|
15467 | 15632 | //Composite group = (Composite) object; |
---|
15468 | 15633 | Object3D group = object; |
---|
15469 | | - group.editWindow.ResetTransform(mask); |
---|
| 15634 | + group.GetWindow().ResetTransform(mask); |
---|
15470 | 15635 | } |
---|
15471 | 15636 | |
---|
15472 | 15637 | void FlipTransform() |
---|
15473 | 15638 | { |
---|
15474 | 15639 | //Composite group = (Composite) object; |
---|
15475 | 15640 | Object3D group = object; |
---|
15476 | | - group.editWindow.FlipTransform(); |
---|
| 15641 | + group.GetWindow().FlipTransform(); |
---|
15477 | 15642 | // group.editWindow.ReduceMesh(true); |
---|
15478 | 15643 | } |
---|
15479 | 15644 | |
---|
.. | .. |
---|
15481 | 15646 | { |
---|
15482 | 15647 | //Composite group = (Composite) object; |
---|
15483 | 15648 | Object3D group = object; |
---|
15484 | | - group.editWindow.PrintMemory(); |
---|
| 15649 | + group.GetWindow().PrintMemory(); |
---|
15485 | 15650 | // group.editWindow.ReduceMesh(true); |
---|
15486 | 15651 | } |
---|
15487 | 15652 | |
---|
.. | .. |
---|
15489 | 15654 | { |
---|
15490 | 15655 | //Composite group = (Composite) object; |
---|
15491 | 15656 | Object3D group = object; |
---|
15492 | | - group.editWindow.ResetCentroid(); |
---|
| 15657 | + group.GetWindow().ResetCentroid(); |
---|
15493 | 15658 | } |
---|
15494 | 15659 | |
---|
15495 | 15660 | void IncDepth() |
---|
.. | .. |
---|
15665 | 15830 | info.bounds.y += (height - desired) / 2; |
---|
15666 | 15831 | } |
---|
15667 | 15832 | } |
---|
| 15833 | + |
---|
15668 | 15834 | info.g = gr; |
---|
15669 | 15835 | info.camera = renderCamera; |
---|
15670 | 15836 | /* |
---|
.. | .. |
---|
15674 | 15840 | */ |
---|
15675 | 15841 | if (!isRenderer) |
---|
15676 | 15842 | { |
---|
15677 | | - object.drawEditHandles(info, 0); |
---|
15678 | | - |
---|
15679 | | - if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15843 | + Grafreed.Assert(object != null); |
---|
| 15844 | + Grafreed.Assert(object.selection != null); |
---|
| 15845 | + if (object.selection.Size() > 0) |
---|
15680 | 15846 | { |
---|
15681 | | - switch (object.selection.get(0).hitSomething) |
---|
| 15847 | + int hitSomething = object.selection.get(0).hitSomething; |
---|
| 15848 | + |
---|
| 15849 | + info.DX = 0; |
---|
| 15850 | + info.DY = 0; |
---|
| 15851 | + info.W = 1; |
---|
| 15852 | + if (hitSomething == Object3D.hitCenter) |
---|
15682 | 15853 | { |
---|
15683 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15684 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15685 | | - break; |
---|
15686 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15687 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15688 | | - break; |
---|
15689 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15690 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15691 | | - break; |
---|
| 15854 | + info.DX = X; |
---|
| 15855 | + if (X != 0) |
---|
| 15856 | + info.DX -= info.bounds.width/2; |
---|
| 15857 | + |
---|
| 15858 | + info.DY = Y; |
---|
| 15859 | + if (Y != 0) |
---|
| 15860 | + info.DY -= info.bounds.height/2; |
---|
15692 | 15861 | } |
---|
15693 | | - |
---|
| 15862 | + |
---|
| 15863 | + object.drawEditHandles(info, 0); |
---|
| 15864 | + |
---|
| 15865 | + if (drag && (X != 0 || Y != 0)) |
---|
| 15866 | + { |
---|
| 15867 | + switch (hitSomething) |
---|
| 15868 | + { |
---|
| 15869 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15870 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15871 | + break; |
---|
| 15872 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15873 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15874 | + break; |
---|
| 15875 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15876 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15877 | + break; |
---|
| 15878 | + } |
---|
| 15879 | + |
---|
| 15880 | + } |
---|
15694 | 15881 | } |
---|
15695 | 15882 | } |
---|
15696 | 15883 | } |
---|
.. | .. |
---|
16488 | 16675 | } |
---|
16489 | 16676 | } |
---|
16490 | 16677 | |
---|
| 16678 | + private Object3D GetFolder() |
---|
| 16679 | + { |
---|
| 16680 | + Object3D folder = object.GetWindow().copy; |
---|
| 16681 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16682 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16683 | + return folder; |
---|
| 16684 | + } |
---|
| 16685 | + |
---|
16491 | 16686 | class SelectBuffer implements GLEventListener |
---|
16492 | 16687 | { |
---|
16493 | 16688 | |
---|
.. | .. |
---|
16567 | 16762 | |
---|
16568 | 16763 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16569 | 16764 | |
---|
| 16765 | + if (PAINTMODE) |
---|
| 16766 | + { |
---|
| 16767 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16768 | + { |
---|
| 16769 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16770 | + |
---|
| 16771 | + // Make what you paint not selectable. |
---|
| 16772 | + paintobj.ResetSelectable(); |
---|
| 16773 | + } |
---|
| 16774 | + } |
---|
| 16775 | + |
---|
16570 | 16776 | //int tmp = selection_view; |
---|
16571 | 16777 | //selection_view = -1; |
---|
16572 | 16778 | int temp = DrawMode(); |
---|
.. | .. |
---|
16578 | 16784 | // temp = DEFAULT; // patch for selection debug |
---|
16579 | 16785 | Globals.drawMode = temp; // WARNING |
---|
16580 | 16786 | |
---|
| 16787 | + if (PAINTMODE) |
---|
| 16788 | + { |
---|
| 16789 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16790 | + { |
---|
| 16791 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16792 | + |
---|
| 16793 | + // Revert. |
---|
| 16794 | + paintobj.RestoreSelectable(); |
---|
| 16795 | + } |
---|
| 16796 | + } |
---|
| 16797 | + |
---|
16581 | 16798 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16582 | 16799 | |
---|
16583 | 16800 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16681 | 16898 | } |
---|
16682 | 16899 | |
---|
16683 | 16900 | if (!movingcamera && !PAINTMODE) |
---|
16684 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16901 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16685 | 16902 | |
---|
16686 | | - if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16903 | + if (PAINTMODE) // && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16687 | 16904 | { |
---|
16688 | | - Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16905 | + //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16689 | 16906 | |
---|
16690 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16907 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16908 | + { |
---|
| 16909 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16691 | 16910 | |
---|
16692 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16693 | | - |
---|
16694 | | - group.add(paintobj); // link |
---|
16695 | | - |
---|
16696 | | - object.editWindow.SnapObject(group); |
---|
16697 | | - |
---|
16698 | | - Object3D folder = object.editWindow.copy; |
---|
16699 | | - |
---|
16700 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16701 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16702 | | - |
---|
16703 | | - folder.add(group); |
---|
16704 | | - |
---|
16705 | | - object.editWindow.ResetModel(); |
---|
16706 | | - object.editWindow.refreshContents(); |
---|
| 16911 | + Object3D inst = new Object3D("inst" + paintcount++); |
---|
| 16912 | + |
---|
| 16913 | + inst.CreateMaterial(); // use a void leaf to select instances |
---|
| 16914 | + |
---|
| 16915 | + inst.add(paintobj); // link |
---|
| 16916 | + |
---|
| 16917 | + object.GetWindow().SnapObject(inst); |
---|
| 16918 | + |
---|
| 16919 | + Object3D folder = paintFolder; // GetFolder(); |
---|
| 16920 | + |
---|
| 16921 | + folder.add(inst); |
---|
| 16922 | + |
---|
| 16923 | + object.GetWindow().ResetModel(); |
---|
| 16924 | + object.GetWindow().refreshContents(); |
---|
| 16925 | + } |
---|
16707 | 16926 | } |
---|
16708 | 16927 | else |
---|
16709 | 16928 | paintcount = 0; |
---|
.. | .. |
---|
16742 | 16961 | //System.out.println("objects[color] = " + objects[color]); |
---|
16743 | 16962 | //objects[color].Select(); |
---|
16744 | 16963 | indexcount = 0; |
---|
| 16964 | + ObjEditor window = object.GetWindow(); |
---|
| 16965 | + if (window != null && deselect) |
---|
| 16966 | + { |
---|
| 16967 | + window.Select(null, deselect, true); |
---|
| 16968 | + } |
---|
16745 | 16969 | object.Select(color, deselect); |
---|
16746 | 16970 | } |
---|
16747 | 16971 | |
---|