]> git.mxchange.org Git - flightgear.git/commitdiff
Make sure that saved mouse position is reset when mouse is centred on
authordavid <david>
Thu, 28 Mar 2002 16:12:26 +0000 (16:12 +0000)
committerdavid <david>
Thu, 28 Mar 2002 16:12:26 +0000 (16:12 +0000)
mode change.

src/Input/input.cxx

index bebd60217b13888afac41a424ca801f7778c8dc0..1009ccbd9b9fcbcac03590df165b698d95d681cf 100644 (file)
@@ -765,8 +765,9 @@ FGInput::_update_mouse ()
     m.current_mode = mode;
     if (mode >= 0 && mode < m.nModes) {
       glutSetCursor(m.modes[mode].cursor);
-      glutWarpPointer(fgGetInt("/sim/startup/xsize", 800) / 2,
-                     fgGetInt("/sim/startup/ysize", 600) / 2);
+      m.x = fgGetInt("/sim/startup/xsize", 800) / 2;
+      m.y = fgGetInt("/sim/startup/ysize", 600) / 2;
+      glutWarpPointer(m.x, m.y);
     } else {
       SG_LOG(SG_INPUT, SG_DEBUG, "Mouse mode " << mode << " out of range");
       glutSetCursor(GLUT_CURSOR_INHERIT);