.. | .. |
---|
6962 | 6962 | short residu = 0; |
---|
6963 | 6963 | |
---|
6964 | 6964 | // wraparound workarounds |
---|
6965 | | - short fuck = (short) (buffer[i] & 0xFF); |
---|
| 6965 | + short ww = (short) (buffer[i] & 0xFF); |
---|
6966 | 6966 | /* |
---|
6967 | | - residu += (fuck%2); |
---|
6968 | | - if(fuck/2 < 256-residu/2) |
---|
| 6967 | + residu += (ww%2); |
---|
| 6968 | + if(ww/2 < 256-residu/2) |
---|
6969 | 6969 | { |
---|
6970 | | - fuck = (short)((fuck/2) + residu/2); |
---|
| 6970 | + ww = (short)((ww/2) + residu/2); |
---|
6971 | 6971 | if(residu == 2) |
---|
6972 | 6972 | residu = 0; |
---|
6973 | 6973 | } |
---|
6974 | 6974 | else |
---|
6975 | 6975 | { |
---|
6976 | 6976 | residu = 0; |
---|
6977 | | - fuck /= 2; |
---|
| 6977 | + ww /= 2; |
---|
6978 | 6978 | } |
---|
6979 | 6979 | */ |
---|
6980 | | - if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254) |
---|
| 6980 | + if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254) |
---|
6981 | 6981 | { |
---|
6982 | | - fuck /= 2; |
---|
| 6982 | + ww /= 2; |
---|
6983 | 6983 | } else |
---|
6984 | 6984 | { |
---|
6985 | | - fuck = (short) ((fuck / 2) + fuck % 2); |
---|
| 6985 | + ww = (short) ((ww / 2) + ww % 2); |
---|
6986 | 6986 | } |
---|
6987 | 6987 | |
---|
6988 | | - buffer[i] = (byte) fuck; |
---|
| 6988 | + buffer[i] = (byte) ww; |
---|
6989 | 6989 | } |
---|
6990 | 6990 | //System.out.print(bytes[i] + " "); |
---|
6991 | 6991 | //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps; |
---|
.. | .. |
---|
14341 | 14341 | public void mouseClicked(MouseEvent e) |
---|
14342 | 14342 | { |
---|
14343 | 14343 | System.out.println("mouseClicked: " + e); |
---|
| 14344 | + System.exit(0); |
---|
14344 | 14345 | } |
---|
14345 | 14346 | |
---|
14346 | 14347 | public void mousePressed(MouseEvent e) |
---|
14347 | 14348 | { |
---|
| 14349 | + RigidBody.justclicked = true; |
---|
| 14350 | + System.out.println("justclicked: " + e); |
---|
14348 | 14351 | //System.out.println("mousePressed: " + e); |
---|
14349 | 14352 | clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
14350 | 14353 | } |
---|
.. | .. |
---|
14668 | 14671 | // only one thread!? synchronized |
---|
14669 | 14672 | void StepToTarget(boolean jump) |
---|
14670 | 14673 | { |
---|
14671 | | - RigidBody.pos.x = (float)manipCamera.lookAt.x; |
---|
14672 | | - RigidBody.pos.y = (float)manipCamera.lookAt.y; |
---|
14673 | | - RigidBody.pos.z = (float)manipCamera.lookAt.z; |
---|
14674 | | -// RigidBody.wind.x = (float)manipCamera.right.x; |
---|
14675 | | -// RigidBody.wind.y = (float)manipCamera.right.y; |
---|
14676 | | -// RigidBody.wind.z = (float)manipCamera.right.z; |
---|
14677 | | - //RigidBody.wind.normalize(); |
---|
| 14674 | + RigidBody.pos.x = 0; |
---|
| 14675 | + RigidBody.pos.y = 0; |
---|
| 14676 | + RigidBody.pos.z = 0; |
---|
| 14677 | + if (RigidBody.justclicked) |
---|
| 14678 | + { |
---|
| 14679 | + RigidBody.pos.x = (float)manipCamera.lookAt.x; |
---|
| 14680 | + RigidBody.pos.y = (float)manipCamera.lookAt.y; |
---|
| 14681 | + RigidBody.pos.z = (float)manipCamera.lookAt.z; |
---|
| 14682 | + RigidBody.wind.set(RigidBody.pos); |
---|
| 14683 | + RigidBody.wind.x -= (float)manipCamera.location.x; |
---|
| 14684 | + RigidBody.wind.y -= (float)manipCamera.location.y; |
---|
| 14685 | + RigidBody.wind.z -= (float)manipCamera.location.z; |
---|
| 14686 | + RigidBody.wind.normalize(); |
---|
| 14687 | + } |
---|
14678 | 14688 | |
---|
14679 | 14689 | if (mute) |
---|
14680 | 14690 | return; |
---|
.. | .. |
---|
15022 | 15032 | |
---|
15023 | 15033 | void GoUp(int mod) |
---|
15024 | 15034 | { |
---|
| 15035 | + RigidBody.justclicked = true; |
---|
| 15036 | + |
---|
15025 | 15037 | MODIFIERS |= COMMAND; |
---|
15026 | 15038 | /**/ |
---|
15027 | 15039 | boolean isVR = (mouseMode&VR)!=0; |
---|
.. | .. |
---|
16752 | 16764 | |
---|
16753 | 16765 | public boolean mouseDrag(Event evt, int x, int y) |
---|
16754 | 16766 | { |
---|
16755 | | - //System.out.println("mouseDrag: " + evt); |
---|
| 16767 | + System.out.println("mouseDrag: " + evt); |
---|
| 16768 | + System.exit(0); |
---|
16756 | 16769 | /* |
---|
16757 | 16770 | drag = true; |
---|
16758 | 16771 | //System.out.println("Mouse DRAG"); |
---|
.. | .. |
---|
16871 | 16884 | public boolean mouseUp(Event evt, int x, int y) |
---|
16872 | 16885 | { |
---|
16873 | 16886 | System.out.println("mouseUp: " + evt); |
---|
| 16887 | + System.exit(0); |
---|
16874 | 16888 | /* |
---|
16875 | 16889 | locked = false; |
---|
16876 | 16890 | if (isRenderer) |
---|