]> git.rm.cloudns.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)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 27 Jul 2010 19:19:08 +0000 (21:19 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10364 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=aac77b0462e945a3e96c3c08192f41626cdcde59

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 f396ae520daf819df8c42a0cf51b995f8b286e86..0cc4a6c71f80d0e33d1183f4a9e2ec85df3d8b3a 100644 (file)
@@ -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();
 }