.. | .. |
---|
106 | 106 | static boolean OEIL = true; |
---|
107 | 107 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
108 | 108 | static boolean LOOKAT = true; |
---|
109 | | -static boolean RANDOM = true; // false; |
---|
| 109 | +static boolean SWITCH = true; // false; |
---|
110 | 110 | static boolean HANDLES = false; // selection doesn't work!! |
---|
111 | 111 | static boolean PAINTMODE = false; |
---|
112 | 112 | |
---|
.. | .. |
---|
2267 | 2267 | |
---|
2268 | 2268 | void ToggleRandom() |
---|
2269 | 2269 | { |
---|
2270 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2271 | 2271 | } |
---|
2272 | 2272 | |
---|
2273 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
8075 | 8075 | { |
---|
8076 | 8076 | String texname = tex; |
---|
8077 | 8077 | |
---|
8078 | | - String[] split = tex.split("Textures"); |
---|
8079 | | - if (split.length > 1) |
---|
8080 | | - texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8081 | | - else |
---|
8082 | | - if (!texname.startsWith("/")) |
---|
8083 | | - texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8078 | +// String[] split = tex.split("Textures"); |
---|
| 8079 | +// if (split.length > 1) |
---|
| 8080 | +// texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
| 8081 | +// else |
---|
| 8082 | +// if (!texname.startsWith("/")) |
---|
| 8083 | +// texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8084 | + if (!new File(tex).exists()) |
---|
| 8085 | + { |
---|
| 8086 | + texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; |
---|
| 8087 | + } |
---|
8084 | 8088 | |
---|
8085 | 8089 | if (CACHETEXTURE) |
---|
8086 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
12754 | 12758 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12755 | 12759 | "FLR final.x, final.y;" + |
---|
12756 | 12760 | "SUB final.y, final.y, final.x;" + |
---|
12757 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12761 | + "MUL final.x, final.x, c256i;" + |
---|
12758 | 12762 | "MOV final.z, zero.x;" + |
---|
12759 | 12763 | "MOV final.a, one.w;":"" |
---|
12760 | 12764 | ) + |
---|
.. | .. |
---|
12762 | 12766 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12763 | 12767 | "FLR final.x, final.y;" + |
---|
12764 | 12768 | "SUB final.y, final.y, final.x;" + |
---|
12765 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12769 | + "MUL final.x, final.x, c256i;" + |
---|
12766 | 12770 | "MOV final.z, zero.x;" + |
---|
12767 | 12771 | "MOV final.a, one.w;":"" |
---|
12768 | 12772 | ) + |
---|
.. | .. |
---|
13515 | 13519 | public void mousePressed(MouseEvent e) |
---|
13516 | 13520 | { |
---|
13517 | 13521 | //System.out.println("mousePressed: " + e); |
---|
13518 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13522 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13519 | 13523 | } |
---|
13520 | 13524 | |
---|
13521 | 13525 | static long prevtime = 0; |
---|
.. | .. |
---|
13591 | 13595 | // mode |= META; |
---|
13592 | 13596 | //} |
---|
13593 | 13597 | |
---|
13594 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13595 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13598 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13599 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13596 | 13600 | anchorX = ax; |
---|
13597 | 13601 | anchorY = ay; |
---|
13598 | 13602 | prevX = px; |
---|
.. | .. |
---|
13690 | 13694 | |
---|
13691 | 13695 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13692 | 13696 | |
---|
13693 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13697 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13694 | 13698 | { |
---|
13695 | 13699 | if (!wasliveok) |
---|
13696 | 13700 | return; |
---|
.. | .. |
---|
13707 | 13711 | // touched = true; // main DL |
---|
13708 | 13712 | if (isRenderer) |
---|
13709 | 13713 | { |
---|
13710 | | - SetMouseMode(modifiers); |
---|
| 13714 | + SetMouseMode(modifiers, modifiersex); |
---|
13711 | 13715 | } |
---|
13712 | 13716 | |
---|
13713 | 13717 | selectX = anchorX = x; |
---|
.. | .. |
---|
13720 | 13724 | clicked = true; |
---|
13721 | 13725 | hold = false; |
---|
13722 | 13726 | |
---|
13723 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13727 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13724 | 13728 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13725 | 13729 | { |
---|
13726 | 13730 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13751 | 13755 | info.camera = renderCamera; |
---|
13752 | 13756 | info.x = x; |
---|
13753 | 13757 | info.y = y; |
---|
13754 | | - info.modifiers = modifiers; |
---|
| 13758 | + info.modifiers = modifiersex; |
---|
13755 | 13759 | editObj = object.doEditClick(info, 0); |
---|
13756 | 13760 | if (!editObj) |
---|
13757 | 13761 | { |
---|
.. | .. |
---|
13780 | 13784 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13781 | 13785 | } |
---|
13782 | 13786 | else |
---|
13783 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13787 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13784 | 13788 | |
---|
13785 | 13789 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13786 | 13790 | } |
---|
.. | .. |
---|
14017 | 14021 | { |
---|
14018 | 14022 | Globals.lighttouched = true; |
---|
14019 | 14023 | } |
---|
14020 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14024 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14021 | 14025 | } |
---|
14022 | 14026 | //else |
---|
14023 | 14027 | } |
---|
.. | .. |
---|
14117 | 14121 | int X, Y; |
---|
14118 | 14122 | boolean SX, SY; |
---|
14119 | 14123 | |
---|
14120 | | - void drag(int x, int y, int modifiers) |
---|
| 14124 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14121 | 14125 | { |
---|
14122 | 14126 | if (IsFrozen()) |
---|
14123 | 14127 | { |
---|
.. | .. |
---|
14126 | 14130 | |
---|
14127 | 14131 | drag = true; // NEW |
---|
14128 | 14132 | |
---|
14129 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14133 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14130 | 14134 | |
---|
14131 | 14135 | X = x; |
---|
14132 | 14136 | Y = y; |
---|
14133 | 14137 | // floating state for animation |
---|
14134 | | - MODIFIERS = modifiers; |
---|
14135 | | - modifiers &= ~1024; |
---|
| 14138 | + MODIFIERS = modifiersex; |
---|
| 14139 | + modifiersex &= ~1024; |
---|
14136 | 14140 | if (false) // modifiers != 0) |
---|
14137 | 14141 | { |
---|
14138 | 14142 | //new Exception().printStackTrace(); |
---|
14139 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14143 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14140 | 14144 | System.out.println("SHIFT = " + SHIFT); |
---|
14141 | 14145 | System.out.println("CONTROL = " + COMMAND); |
---|
14142 | 14146 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14156 | 14160 | info.camera = renderCamera; |
---|
14157 | 14161 | info.x = x; |
---|
14158 | 14162 | info.y = y; |
---|
14159 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14163 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14160 | 14164 | } else |
---|
14161 | 14165 | { |
---|
14162 | 14166 | if (x < startX) |
---|
.. | .. |
---|
14357 | 14361 | |
---|
14358 | 14362 | if (control || command || IsFrozen()) |
---|
14359 | 14363 | timeout = true; |
---|
14360 | | - else |
---|
| 14364 | +// ?? May 2019 else |
---|
14361 | 14365 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14362 | 14366 | mouseDown = false; |
---|
14363 | 14367 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14467 | 14471 | System.out.println("keyReleased: " + e); |
---|
14468 | 14472 | } |
---|
14469 | 14473 | |
---|
14470 | | - void SetMouseMode(int modifiers) |
---|
| 14474 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14471 | 14475 | { |
---|
14472 | 14476 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14473 | 14477 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14479 | 14483 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14480 | 14484 | // return; |
---|
14481 | 14485 | //System.out.println("SetMode = " + modifiers); |
---|
14482 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14486 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14483 | 14487 | { |
---|
14484 | 14488 | mouseMode |= ZOOM; |
---|
14485 | 14489 | } |
---|
14486 | 14490 | |
---|
14487 | 14491 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14488 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14492 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14489 | 14493 | { |
---|
14490 | 14494 | mouseMode |= VR; // BACKFORTH; |
---|
14491 | 14495 | } |
---|
14492 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14496 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14493 | 14497 | { |
---|
14494 | 14498 | mouseMode |= SELECT; |
---|
14495 | 14499 | } |
---|
14496 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14500 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14497 | 14501 | { |
---|
14498 | 14502 | mouseMode |= SELECT; |
---|
14499 | 14503 | } |
---|
14500 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14504 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14501 | 14505 | { |
---|
14502 | 14506 | mouseMode &= ~VR; |
---|
14503 | 14507 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14526 | 14530 | |
---|
14527 | 14531 | if (isRenderer) // |
---|
14528 | 14532 | { |
---|
14529 | | - SetMouseMode(modifiers); |
---|
| 14533 | + SetMouseMode(0, modifiers); |
---|
14530 | 14534 | } |
---|
14531 | 14535 | |
---|
14532 | 14536 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14986 | 14990 | //mode = ROTATE; |
---|
14987 | 14991 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14988 | 14992 | { |
---|
14989 | | - SetMouseMode(modifiers); |
---|
| 14993 | + SetMouseMode(0, modifiers); |
---|
14990 | 14994 | } |
---|
14991 | 14995 | } |
---|
14992 | 14996 | |
---|
.. | .. |
---|
15122 | 15126 | { |
---|
15123 | 15127 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15124 | 15128 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15125 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15129 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15126 | 15130 | { |
---|
15127 | 15131 | mouseMoved(e); |
---|
15128 | 15132 | } else |
---|
.. | .. |
---|
15559 | 15563 | public boolean mouseDown(Event evt, int x, int y) |
---|
15560 | 15564 | { |
---|
15561 | 15565 | System.out.println("mouseDown: " + evt); |
---|
| 15566 | + System.exit(0); |
---|
15562 | 15567 | /* |
---|
15563 | 15568 | locked = true; |
---|
15564 | 15569 | drag = false; |
---|
.. | .. |
---|
15602 | 15607 | { |
---|
15603 | 15608 | keyPressed(0, modifiers); |
---|
15604 | 15609 | } |
---|
15605 | | - clickStart(x, y, modifiers); |
---|
| 15610 | + // clickStart(x, y, modifiers); |
---|
15606 | 15611 | return true; |
---|
15607 | 15612 | } |
---|
15608 | 15613 | |
---|
.. | .. |
---|
15720 | 15725 | { |
---|
15721 | 15726 | keyReleased(0, 0); |
---|
15722 | 15727 | } |
---|
15723 | | - drag(x, y, modifiers); |
---|
| 15728 | + drag(x, y, 0, modifiers); |
---|
15724 | 15729 | return true; |
---|
15725 | 15730 | } |
---|
15726 | 15731 | |
---|