From b1d79b74514041a059b454a9f6fc3970773c0cb8 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Mon, 12 Aug 2019 18:19:30 -0400 Subject: [PATCH] Compact toolbar. --- CameraPane.java | 56 +++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 37 insertions(+), 19 deletions(-) diff --git a/CameraPane.java b/CameraPane.java index 28924e5..e816ebc 100644 --- a/CameraPane.java +++ b/CameraPane.java @@ -8358,7 +8358,7 @@ // else // if (!texname.startsWith("/")) // texname = "/Users/nbriere/Textures/" + texname; - if (!FileExists(texname)) + if (!FileExists(texname) && !texname.startsWith("@")) { texname = fallbackTextureName; } @@ -8441,6 +8441,15 @@ new Exception().printStackTrace(); } else { + if (texname.startsWith("@")) + { + // texturecache = textures.get(texname); // suspicious + if (texturecache == null) + texturecache = new CacheTexture(GetResourceTexture(texname.substring(1), bump),resolution); + else + new Exception().printStackTrace(); + } else + { if (textureon) { String cachename = texname; @@ -8500,6 +8509,7 @@ texturecache = new CacheTexture(texturedata,resolution); //texture = GetTexture(tex, bump); } + } } //} } @@ -10841,7 +10851,7 @@ if (wait) { - Sleep(500); + Sleep(200); // blocks everything wait = false; } @@ -11379,7 +11389,7 @@ // if (cam != lightCamera) //for (int count = parentcam.GetTransformCount(); --count>=0;) - LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 + LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013 } LA.xformDir(lightposition, cam.toScreen, lightposition); @@ -12453,7 +12463,7 @@ //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0); - String program0 = + String programmin = // Min shader "!!ARBfp1.0\n" + "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + @@ -12520,7 +12530,7 @@ "MOV result.color, temp;" + "END"; - String program = + String programmax = "!!ARBfp1.0\n" + //"OPTION ARB_fragment_program_shadow;" + @@ -13376,6 +13386,13 @@ //once = true; } + String program = programmax; + + if (Globals.MINSHADER) + { + program = programmin; + } + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); @@ -14625,9 +14642,9 @@ MODIFIERS |= COMMAND; /**/ if((mod&SHIFT) == SHIFT) - manipCamera.RotatePosition(0, -speed); - else manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); + else + manipCamera.RotatePosition(0, -speed); /**/ if ((mod & SHIFT) == SHIFT) { @@ -14646,9 +14663,9 @@ MODIFIERS |= COMMAND; /**/ if((mod&SHIFT) == SHIFT) - manipCamera.RotatePosition(0, speed); - else manipCamera.BackForth(0, speed*delta, 0); // getWidth()); + else + manipCamera.RotatePosition(0, speed); /**/ if ((mod & SHIFT) == SHIFT) { @@ -16091,7 +16108,7 @@ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); break; case Object3D.hitScale: gr.setColor(Color.cyan); - gr.drawLine(X, Y, 0, 0); + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); break; } @@ -16650,6 +16667,7 @@ private void DrawSkyBox(GL gl, float ratio) { if (//envyoff || + WIREFRAME || cubemap == null) { gl.glClearColor(BGcolor, BGcolor, BGcolor, 1); @@ -16667,14 +16685,14 @@ gl.glLoadIdentity(); gl.glScalef(1,ratio,1); - colorV[0] = 2; - colorV[1] = 2; - colorV[2] = 2; - colorV[3] = 1; - gl.glDisable(gl.GL_COLOR_MATERIAL); - gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0); - - gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0); +// colorV[0] = 2; +// colorV[1] = 2; +// colorV[2] = 2; +// colorV[3] = 1; +// gl.glDisable(gl.GL_COLOR_MATERIAL); +// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0); +// +// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0); //gl.glActiveTexture(GL.GL_TEXTURE1); //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP); @@ -16688,7 +16706,7 @@ // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting // causes the normals to be sent down. Thanks to Ken Dyke. //gl.glEnable(GL.GL_LIGHTING); - gl.glEnable(GL.GL_LIGHTING); + gl.glDisable(GL.GL_LIGHTING); gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); -- Gitblit v1.6.2