Re: [Flightgear-devel] fix mouse view regression

2006-03-10 Thread Jean-Yves Lefort
On Fri, 10 Mar 2006 08:14:17 +0100
Mathias Fröhlich [EMAIL PROTECTED] wrote:

 On Thursday 09 March 2006 21:19, Jean-Yves Lefort wrote:
  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.
 Checked in a fix which at least fixed that form me.
 Please give it a try.

It works, thanks.

-- 
Jean-Yves Lefort

[EMAIL PROTECTED]
http://lefort.be.eu.org/


pgprveOmEOJtr.pgp
Description: PGP signature


[Flightgear-devel] fix mouse view regression

2006-03-09 Thread Jean-Yves Lefort
input.cxx log:


revision 1.82
date: 2006-02-16 01:30:28 +;  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 -  1.83
+++ src/Input/input.cxx 9 Mar 2006 20:16:54 -
@@ -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);


pgpFSCS4CtggH.pgp
Description: PGP signature


Re: [Flightgear-devel] fix mouse view regression

2006-03-09 Thread Mathias Fröhlich
On Thursday 09 March 2006 21:19, Jean-Yves Lefort wrote:
 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.
Checked in a fix which at least fixed that form me.
Please give it a try.

Greetings

   Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel