From b0ac90ddb2342eb8833da059c016ae524ff4b69b Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 25 Jul 2010 19:39:19 +0000 Subject: [PATCH] make prydon cursor absolute, not relative git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10364 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=aac77b0462e945a3e96c3c08192f41626cdcde59 --- cl_input.c | 17 ++++++++--------- cl_screen.c | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cl_input.c b/cl_input.c index d4ab8a01..e0a0b430 100644 --- a/cl_input.c +++ b/cl_input.c @@ -622,17 +622,10 @@ void CL_Input (void) } // if not in menu, apply mouse move to viewangles/movement - if (!key_consoleactive && key_dest == key_game && !cl.csqc_wantsmousemove) + if (!key_consoleactive && key_dest == key_game && !cl.csqc_wantsmousemove && cl_prydoncursor.integer <= 0) { float modulatedsensitivity = sensitivity.value * cl.sensitivityscale; - if (cl_prydoncursor.integer > 0) - { - // mouse interacting with the scene, mostly stationary view - V_StopPitchDrift(); - cl.cmd.cursor_screen[0] += in_mouse_x * modulatedsensitivity / vid.width; - cl.cmd.cursor_screen[1] += in_mouse_y * modulatedsensitivity / vid.height; - } - else if (in_strafe.state & 1) + if (in_strafe.state & 1) { // strafing mode, all looking is movement V_StopPitchDrift(); @@ -660,7 +653,13 @@ void CL_Input (void) } } else // don't pitch drift when csqc is controlling the mouse + { + // mouse interacting with the scene, mostly stationary view V_StopPitchDrift(); + // update prydon cursor + cl.cmd.cursor_screen[0] = in_windowmouse_x * 2.0 / vid.width - 1.0; + cl.cmd.cursor_screen[1] = in_windowmouse_y * 2.0 / vid.height - 1.0; + } if(v_flipped.integer) { diff --git a/cl_screen.c b/cl_screen.c index f396ae52..0cc4a6c7 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -2261,7 +2261,7 @@ void CL_UpdateScreen(void) else if (key_dest == key_menu) VID_SetMouse(vid.fullscreen, vid_mouse.integer && !in_client_mouse, true); else - VID_SetMouse(vid.fullscreen, vid_mouse.integer && !cl.csqc_wantsmousemove && (!cls.demoplayback || cl_demo_mousegrab.integer), true); + VID_SetMouse(vid.fullscreen, vid_mouse.integer && !cl.csqc_wantsmousemove && cl_prydoncursor.integer <= 0 && (!cls.demoplayback || cl_demo_mousegrab.integer), true); VID_Finish(); } -- 2.39.2