.. | .. |
---|
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; |
---|
.. | .. |
---|
13652 | 13656 | // wasliveok = true; |
---|
13653 | 13657 | // waslive = false; |
---|
13654 | 13658 | |
---|
| 13659 | + // May 2019 Forget it: |
---|
| 13660 | + if (true) |
---|
| 13661 | + return; |
---|
| 13662 | + |
---|
13655 | 13663 | // source == timer |
---|
13656 | 13664 | if (mouseDown) |
---|
13657 | 13665 | { |
---|
.. | .. |
---|
13690 | 13698 | |
---|
13691 | 13699 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13692 | 13700 | |
---|
13693 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13701 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13694 | 13702 | { |
---|
13695 | 13703 | if (!wasliveok) |
---|
13696 | 13704 | return; |
---|
.. | .. |
---|
13707 | 13715 | // touched = true; // main DL |
---|
13708 | 13716 | if (isRenderer) |
---|
13709 | 13717 | { |
---|
13710 | | - SetMouseMode(modifiers); |
---|
| 13718 | + SetMouseMode(modifiers, modifiersex); |
---|
13711 | 13719 | } |
---|
13712 | 13720 | |
---|
13713 | 13721 | selectX = anchorX = x; |
---|
.. | .. |
---|
13720 | 13728 | clicked = true; |
---|
13721 | 13729 | hold = false; |
---|
13722 | 13730 | |
---|
13723 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13731 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13724 | 13732 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13725 | 13733 | { |
---|
13726 | 13734 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13751 | 13759 | info.camera = renderCamera; |
---|
13752 | 13760 | info.x = x; |
---|
13753 | 13761 | info.y = y; |
---|
13754 | | - info.modifiers = modifiers; |
---|
| 13762 | + info.modifiers = modifiersex; |
---|
13755 | 13763 | editObj = object.doEditClick(info, 0); |
---|
13756 | 13764 | if (!editObj) |
---|
13757 | 13765 | { |
---|
.. | .. |
---|
13780 | 13788 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13781 | 13789 | } |
---|
13782 | 13790 | else |
---|
13783 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13791 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13784 | 13792 | |
---|
13785 | 13793 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13786 | 13794 | } |
---|
.. | .. |
---|
14017 | 14025 | { |
---|
14018 | 14026 | Globals.lighttouched = true; |
---|
14019 | 14027 | } |
---|
14020 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14028 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14021 | 14029 | } |
---|
14022 | 14030 | //else |
---|
14023 | 14031 | } |
---|
.. | .. |
---|
14117 | 14125 | int X, Y; |
---|
14118 | 14126 | boolean SX, SY; |
---|
14119 | 14127 | |
---|
14120 | | - void drag(int x, int y, int modifiers) |
---|
| 14128 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14121 | 14129 | { |
---|
14122 | 14130 | if (IsFrozen()) |
---|
14123 | 14131 | { |
---|
.. | .. |
---|
14126 | 14134 | |
---|
14127 | 14135 | drag = true; // NEW |
---|
14128 | 14136 | |
---|
14129 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14137 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14130 | 14138 | |
---|
14131 | 14139 | X = x; |
---|
14132 | 14140 | Y = y; |
---|
14133 | 14141 | // floating state for animation |
---|
14134 | | - MODIFIERS = modifiers; |
---|
14135 | | - modifiers &= ~1024; |
---|
| 14142 | + MODIFIERS = modifiersex; |
---|
| 14143 | + modifiersex &= ~1024; |
---|
14136 | 14144 | if (false) // modifiers != 0) |
---|
14137 | 14145 | { |
---|
14138 | 14146 | //new Exception().printStackTrace(); |
---|
14139 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14147 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14140 | 14148 | System.out.println("SHIFT = " + SHIFT); |
---|
14141 | 14149 | System.out.println("CONTROL = " + COMMAND); |
---|
14142 | 14150 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14156 | 14164 | info.camera = renderCamera; |
---|
14157 | 14165 | info.x = x; |
---|
14158 | 14166 | info.y = y; |
---|
14159 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14167 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14160 | 14168 | } else |
---|
14161 | 14169 | { |
---|
14162 | 14170 | if (x < startX) |
---|
.. | .. |
---|
14355 | 14363 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14356 | 14364 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14357 | 14365 | |
---|
14358 | | - if (control || command || IsFrozen()) |
---|
| 14366 | +// No delay if (control || command || IsFrozen()) |
---|
14359 | 14367 | timeout = true; |
---|
14360 | | - else |
---|
| 14368 | +// ?? May 2019 else |
---|
14361 | 14369 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14362 | 14370 | mouseDown = false; |
---|
14363 | 14371 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14467 | 14475 | System.out.println("keyReleased: " + e); |
---|
14468 | 14476 | } |
---|
14469 | 14477 | |
---|
14470 | | - void SetMouseMode(int modifiers) |
---|
| 14478 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14471 | 14479 | { |
---|
14472 | 14480 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14473 | 14481 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14479 | 14487 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14480 | 14488 | // return; |
---|
14481 | 14489 | //System.out.println("SetMode = " + modifiers); |
---|
14482 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14490 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14483 | 14491 | { |
---|
14484 | 14492 | mouseMode |= ZOOM; |
---|
14485 | 14493 | } |
---|
14486 | 14494 | |
---|
14487 | 14495 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14488 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14496 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14489 | 14497 | { |
---|
14490 | 14498 | mouseMode |= VR; // BACKFORTH; |
---|
14491 | 14499 | } |
---|
14492 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14500 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14493 | 14501 | { |
---|
14494 | 14502 | mouseMode |= SELECT; |
---|
14495 | 14503 | } |
---|
14496 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14504 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14497 | 14505 | { |
---|
14498 | 14506 | mouseMode |= SELECT; |
---|
14499 | 14507 | } |
---|
14500 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14508 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14501 | 14509 | { |
---|
14502 | 14510 | mouseMode &= ~VR; |
---|
14503 | 14511 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14526 | 14534 | |
---|
14527 | 14535 | if (isRenderer) // |
---|
14528 | 14536 | { |
---|
14529 | | - SetMouseMode(modifiers); |
---|
| 14537 | + SetMouseMode(0, modifiers); |
---|
14530 | 14538 | } |
---|
14531 | 14539 | |
---|
14532 | 14540 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14986 | 14994 | //mode = ROTATE; |
---|
14987 | 14995 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14988 | 14996 | { |
---|
14989 | | - SetMouseMode(modifiers); |
---|
| 14997 | + SetMouseMode(0, modifiers); |
---|
14990 | 14998 | } |
---|
14991 | 14999 | } |
---|
14992 | 15000 | |
---|
.. | .. |
---|
15122 | 15130 | { |
---|
15123 | 15131 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15124 | 15132 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15125 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15133 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15126 | 15134 | { |
---|
15127 | 15135 | mouseMoved(e); |
---|
15128 | 15136 | } else |
---|
.. | .. |
---|
15559 | 15567 | public boolean mouseDown(Event evt, int x, int y) |
---|
15560 | 15568 | { |
---|
15561 | 15569 | System.out.println("mouseDown: " + evt); |
---|
| 15570 | + System.exit(0); |
---|
15562 | 15571 | /* |
---|
15563 | 15572 | locked = true; |
---|
15564 | 15573 | drag = false; |
---|
.. | .. |
---|
15602 | 15611 | { |
---|
15603 | 15612 | keyPressed(0, modifiers); |
---|
15604 | 15613 | } |
---|
15605 | | - clickStart(x, y, modifiers); |
---|
| 15614 | + // clickStart(x, y, modifiers); |
---|
15606 | 15615 | return true; |
---|
15607 | 15616 | } |
---|
15608 | 15617 | |
---|
.. | .. |
---|
15720 | 15729 | { |
---|
15721 | 15730 | keyReleased(0, 0); |
---|
15722 | 15731 | } |
---|
15723 | | - drag(x, y, modifiers); |
---|
| 15732 | + drag(x, y, 0, modifiers); |
---|
15724 | 15733 | return true; |
---|
15725 | 15734 | } |
---|
15726 | 15735 | |
---|