]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
make prydon cursor absolute, not relative
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 Jul 2010 19:39:19 +0000 (19:39 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 Jul 2010 19:39:19 +0000 (19:39 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10364 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
cl_screen.c

index d4ab8a01d5bf556a4b7ac01a73a0aa5bd7967753..e0a0b4305759176b2b387c6bd433d6a964685bc0 100644 (file)
@@ -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)
        {
index affe395a49cdd9cedc7389a224fb2d496f8586d0..9319ca858196aae70394e5a6e15a55704c4f097c 100644 (file)
@@ -2256,7 +2256,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();
 }