input.cxx log:

----------------------------
revision 1.82
date: 2006-02-16 01:30:28 +0000;  author: david;  state: Exp;  lines: +5 -11
The "constrained" property for a mouse mode now actually constrains
the mouse rather than wrapping it.  Wrapping around to the other side
of the screen has very bad consequences when using the mouse for
flying or viewing -- it can result in sudden jumps in the controls or
the viewpoint when the mouse jumps to another side of the screen.

Right now, the mouse is constrained to stay between 25% and 75% of the
screen on both the X and Y axis -- whenever it hits an edge, it jumps
back to the centre of the screen again (which causes no control or
view jump).
----------------------------

This change actually breaks the view mode with PU_USE_GLUT (at least
for me). It was working properly before the change; now the view jumps
whenever the mouse reaches a screen edge.

If nobody has a better idea, I suggest to commit the attached patch
(it simply restores the pre-1.82 code in the PU_USE_GLUT case).

-- 
Jean-Yves Lefort

[EMAIL PROTECTED]
http://lefort.be.eu.org/
Index: src/Input/input.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/input.cxx,v
retrieving revision 1.83
diff -u -r1.83 input.cxx
--- src/Input/input.cxx 21 Feb 2006 01:18:51 -0000      1.83
+++ src/Input/input.cxx 9 Mar 2006 20:16:54 -0000
@@ -387,6 +387,23 @@
                                 // Constrain the mouse if requested
   if (mode.constrained) {
     bool need_warp = false;
+#ifdef PU_USE_GLUT
+    if (x <= 0) {
+      x = xsize - 2;
+      need_warp = true;
+    } else if (x >= (xsize-1)) {
+      x = 1;
+      need_warp = true;
+    }
+
+    if (y <= 0) {
+      y = ysize - 2;
+      need_warp = true;
+    } else if (y >= (ysize-1)) {
+      y = 1;
+      need_warp = true;
+    }
+#else /* PU_USE_SDL */
     if (x <= (xsize * .25) || x >= (xsize * .75)) {
       x = int(xsize * .5);
       need_warp = true;
@@ -396,6 +413,7 @@
       y = int(ysize * .5);
       need_warp = true;
     }
+#endif
 
     if (need_warp)
       fgWarpMouse(x, y);

Attachment: pgpFSCS4CtggH.pgp
Description: PGP signature

Reply via email to