From 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sun, 05 May 2019 10:27:02 -0400 Subject: [PATCH] Disabled timer for instant selection. --- CameraPane.java | 85 +++++++++++++++++++++++------------------- 1 files changed, 47 insertions(+), 38 deletions(-) diff --git a/CameraPane.java b/CameraPane.java index 235a4c3..ea29a28 100644 --- a/CameraPane.java +++ b/CameraPane.java @@ -106,7 +106,7 @@ static boolean OEIL = true; static boolean OEILONCE = false; // do oeilon then oeiloff static boolean LOOKAT = true; -static boolean RANDOM = true; // false; +static boolean SWITCH = true; // false; static boolean HANDLES = false; // selection doesn't work!! static boolean PAINTMODE = false; @@ -2267,7 +2267,7 @@ void ToggleRandom() { - RANDOM ^= true; + SWITCH ^= true; } void ToggleHandles() @@ -8075,12 +8075,16 @@ { String texname = tex; - String[] split = tex.split("Textures"); - if (split.length > 1) - texname = "/Users/nbriere/Textures" + split[split.length-1]; - else - if (!texname.startsWith("/")) - texname = "/Users/nbriere/Textures/" + texname; +// String[] split = tex.split("Textures"); +// if (split.length > 1) +// texname = "/Users/nbriere/Textures" + split[split.length-1]; +// else +// if (!texname.startsWith("/")) +// texname = "/Users/nbriere/Textures/" + texname; + if (!new File(tex).exists()) + { + texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; + } if (CACHETEXTURE) texture = textures.get(texname); // TEXTURE CACHE @@ -12754,7 +12758,7 @@ "MUL final.y, fragment.texcoord[0].x, c256;" + "FLR final.x, final.y;" + "SUB final.y, final.y, final.x;" + - //"MUL final.x, final.x, c256i;" + + "MUL final.x, final.x, c256i;" + "MOV final.z, zero.x;" + "MOV final.a, one.w;":"" ) + @@ -12762,7 +12766,7 @@ "MUL final.y, fragment.texcoord[0].y, c256;" + "FLR final.x, final.y;" + "SUB final.y, final.y, final.x;" + - //"MUL final.x, final.x, c256i;" + + "MUL final.x, final.x, c256i;" + "MOV final.z, zero.x;" + "MOV final.a, one.w;":"" ) + @@ -13515,7 +13519,7 @@ public void mousePressed(MouseEvent e) { //System.out.println("mousePressed: " + e); - clickStart(e.getX(), e.getY(), e.getModifiersEx()); + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); } static long prevtime = 0; @@ -13591,8 +13595,8 @@ // mode |= META; //} - SetMouseMode(WHEEL | e.getModifiersEx()); - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); anchorX = ax; anchorY = ay; prevX = px; @@ -13652,6 +13656,10 @@ // wasliveok = true; // waslive = false; + // May 2019 Forget it: + if (true) + return; + // source == timer if (mouseDown) { @@ -13690,7 +13698,7 @@ javax.swing.Timer timer = new javax.swing.Timer(350, this); - void clickStart(int x, int y, int modifiers) + void clickStart(int x, int y, int modifiers, int modifiersex) { if (!wasliveok) return; @@ -13707,7 +13715,7 @@ // touched = true; // main DL if (isRenderer) { - SetMouseMode(modifiers); + SetMouseMode(modifiers, modifiersex); } selectX = anchorX = x; @@ -13720,7 +13728,7 @@ clicked = true; hold = false; - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection { // System.out.println("RESTART II " + modifiers); @@ -13751,7 +13759,7 @@ info.camera = renderCamera; info.x = x; info.y = y; - info.modifiers = modifiers; + info.modifiers = modifiersex; editObj = object.doEditClick(info, 0); if (!editObj) { @@ -13780,7 +13788,7 @@ clickEnd(e.getX(), e.getY(), e.getModifiersEx()); } else - drag(e.getX(), e.getY(), e.getModifiersEx()); + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); //try { Thread.sleep(1); } catch (Exception ex) {} } @@ -14017,7 +14025,7 @@ { Globals.lighttouched = true; } - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); } //else } @@ -14117,7 +14125,7 @@ int X, Y; boolean SX, SY; - void drag(int x, int y, int modifiers) + void drag(int x, int y, int modifiers, int modifiersex) { if (IsFrozen()) { @@ -14126,17 +14134,17 @@ drag = true; // NEW - boolean continuous = (modifiers & COMMAND) == COMMAND; + boolean continuous = (modifiersex & COMMAND) == COMMAND; X = x; Y = y; // floating state for animation - MODIFIERS = modifiers; - modifiers &= ~1024; + MODIFIERS = modifiersex; + modifiersex &= ~1024; if (false) // modifiers != 0) { //new Exception().printStackTrace(); - System.out.println("mouseDragged: " + modifiers); + System.out.println("mouseDragged: " + modifiersex); System.out.println("SHIFT = " + SHIFT); System.out.println("CONTROL = " + COMMAND); System.out.println("META = " + META); @@ -14156,7 +14164,7 @@ info.camera = renderCamera; info.x = x; info.y = y; - object.editWindow.copy.doEditDrag(info); + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); } else { if (x < startX) @@ -14355,9 +14363,9 @@ boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection - if (control || command || IsFrozen()) +// No delay if (control || command || IsFrozen()) timeout = true; - else +// ?? May 2019 else // timer.setDelay((modifiers & 128) != 0?0:350); mouseDown = false; if (!control && !command) // june 2013 @@ -14467,7 +14475,7 @@ System.out.println("keyReleased: " + e); } - void SetMouseMode(int modifiers) + void SetMouseMode(int modifiers, int modifiersex) { //System.out.println("SetMouseMode = " + modifiers); //modifiers &= ~1024; @@ -14479,25 +14487,25 @@ //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) // return; //System.out.println("SetMode = " + modifiers); - if ((modifiers & WHEEL) == WHEEL) + if ((modifiersex & WHEEL) == WHEEL) { mouseMode |= ZOOM; } boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); - if (capsLocked || (modifiers & META) == META) + if (capsLocked) // || (modifiers & META) == META) { mouseMode |= VR; // BACKFORTH; } - if ((modifiers & CTRLCLICK) == CTRLCLICK) + if ((modifiersex & CTRLCLICK) == CTRLCLICK) { mouseMode |= SELECT; } - if ((modifiers & COMMAND) == COMMAND) + if ((modifiersex & COMMAND) == COMMAND) { mouseMode |= SELECT; } - if ((modifiers & SHIFT) == SHIFT || forcetranslate) + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) { mouseMode &= ~VR; mouseMode |= TRANSLATE; @@ -14526,7 +14534,7 @@ if (isRenderer) // { - SetMouseMode(modifiers); + SetMouseMode(0, modifiers); } Globals.theRenderer.keyPressed(key); @@ -14986,7 +14994,7 @@ //mode = ROTATE; if ((MODIFIERS & COMMAND) == 0) // VR?? { - SetMouseMode(modifiers); + SetMouseMode(0, modifiers); } } @@ -15122,7 +15130,7 @@ { //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) { mouseMoved(e); } else @@ -15559,6 +15567,7 @@ public boolean mouseDown(Event evt, int x, int y) { System.out.println("mouseDown: " + evt); + System.exit(0); /* locked = true; drag = false; @@ -15602,7 +15611,7 @@ { keyPressed(0, modifiers); } - clickStart(x, y, modifiers); + // clickStart(x, y, modifiers); return true; } @@ -15720,7 +15729,7 @@ { keyReleased(0, 0); } - drag(x, y, modifiers); + drag(x, y, 0, modifiers); return true; } -- Gitblit v1.6.2