|
From: Elias N. <eli...@us...> - 2005-04-28 11:58:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18520/src/java/org/lwjgl/input Modified Files: Mouse.java Log Message: Removed cached width and height from Mouse Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- Mouse.java 28 Apr 2005 10:52:03 -0000 1.82 +++ Mouse.java 28 Apr 2005 11:57:38 -0000 1.83 @@ -59,9 +59,6 @@ * @version $Revision$ */ public class Mouse { - /** Mouse constraint */ - private static int width, height; - /** Has the mouse been created? */ private static boolean created; @@ -299,8 +296,8 @@ x = poll_coord1; y = poll_coord2; } - x = Math.min(width - 1, Math.max(0, x)); - y = Math.min(height - 1, Math.max(0, y)); + x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, x)); + y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, y)); dwheel += poll_dwheel; read(); } @@ -373,8 +370,8 @@ event_x = readBuffer.get(); event_y = readBuffer.get(); } - event_x = Math.min(width - 1, Math.max(0, event_x)); - event_y = Math.min(height - 1, Math.max(0, event_y)); + event_x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, event_x)); + event_y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, event_y)); event_dwheel = readBuffer.get(); return true; } else |