else if (key_dest == key_menu)
grabmouse = in_client_mouse;
else if (key_dest == key_game)
- grabmouse = (vid.fullscreen || vid_mouse.integer) && !cls.demoplayback && !cl.csqc_wantsmousemove;
+ grabmouse = vid_mouse.integer && !cls.demoplayback && !cl.csqc_wantsmousemove;
else
grabmouse = false;
+ vid.mouseaim = grabmouse;
+ if (vid.fullscreen)
+ grabmouse = true;
if (!vid_activewindow)
grabmouse = false;
VM_SAFEPARMCOUNT(0,VM_getmousepos);
// FIXME: somehow this should involve in_client_mouse if this is menu progs
- if (cl.csqc_wantsmousemove)
+ if (!vid.mouseaim)
VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_windowmouse_x * vid_conwidth.integer / vid.width, in_windowmouse_y * vid_conheight.integer / vid.height, 0);
else
VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_mouse_x * vid_conwidth.integer / vid.width, in_mouse_y * vid_conheight.integer / vid.height, 0);
qboolean userefreshrate;
int stereobuffer;
int samples;
+
+ // these are used for state tracking
+ qboolean mouseaim;
} viddef_t;
// global video state
GetEventParameter(theEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(deltaPos), NULL, &deltaPos);
GetEventParameter(theEvent, kEventParamWindowMouseLocation, typeHIPoint, NULL, sizeof(windowPos), NULL, &windowPos);
- if (vid_usingmouse)
+ if (vid.mouseaim)
{
in_mouse_x += deltaPos.x;
in_mouse_y += deltaPos.y;
case MotionNotify:
// mouse moved
- if (vid_usingmouse)
+ if (vid.mouseaim)
{
#if !defined(__APPLE__) && !defined(SUNOS)
if (vid_dgamouse.integer == 1 && vid_x11_dgasupported)
static int old_x = 0, old_y = 0;
static int stuck = 0;
int x, y;
- if( vid_usingmouse )
+ if (vid.mouseaim)
{
if(vid_stick_mouse.integer)
{
void VID_Finish (void)
{
- qboolean vid_usemouse;
-
vid_usevsync = vid_vsync.integer && !cls.timedemo && gl_videosyncavailable;
if (vid_usingvsync != vid_usevsync && gl_videosyncavailable)
{
in_windowmouse_x = current_pos.x - window_x;
in_windowmouse_y = current_pos.y - window_y;
- if (!vid_usingmouse)
+ if (!vid.mouseaim)
return;
#ifdef SUPPORTDIRECTX