1
0
Fork 0

Make sure that saved mouse position is reset when mouse is centred on

mode change.
This commit is contained in:
david 2002-03-28 16:12:26 +00:00
parent 62df2d1d53
commit 2288a530c3

View file

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