]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
video modes in menu now also set vid_pixelheight and vid_conwidth/vid_conheight
[xonotic/darkplaces.git] / cl_input.c
index 03421328373b09d3ceac061248649b2553a4cd9f..18b4cfa99249d93cac72f3a514009f3d6a54e432 100644 (file)
@@ -56,8 +56,6 @@ kbutton_t     in_button3, in_button4, in_button5, in_button6, in_button7, in_button8
 
 int                    in_impulse;
 
-extern cvar_t sys_ticrate;
-
 
 void KeyDown (kbutton_t *b)
 {
@@ -409,18 +407,18 @@ void CL_Move (void)
                {
                        // strafing mode, all looking is movement
                        V_StopPitchDrift();
-                       cl.cmd.sidemove += m_side.value * in_mouse_x * sensitivity.value * cl.viewzoom;
+                       cl.cmd.sidemove += m_side.value * in_mouse_x * sensitivity.value;
                        if (noclip_anglehack)
-                               cl.cmd.upmove -= m_forward.value * in_mouse_y * sensitivity.value * cl.viewzoom;
+                               cl.cmd.upmove -= m_forward.value * in_mouse_y * sensitivity.value;
                        else
-                               cl.cmd.forwardmove -= m_forward.value * in_mouse_y * sensitivity.value * cl.viewzoom;
+                               cl.cmd.forwardmove -= m_forward.value * in_mouse_y * sensitivity.value;
                }
                else if ((in_mlook.state & 1) || freelook.integer)
                {
                        // mouselook, lookstrafe causes turning to become strafing
                        V_StopPitchDrift();
                        if (lookstrafe.integer)
-                               cl.cmd.sidemove += m_side.value * in_mouse_x * sensitivity.value * cl.viewzoom;
+                               cl.cmd.sidemove += m_side.value * in_mouse_x * sensitivity.value;
                        else
                                cl.viewangles[YAW] -= m_yaw.value * in_mouse_x * sensitivity.value * cl.viewzoom;
                        cl.viewangles[PITCH] += m_pitch.value * in_mouse_y * sensitivity.value * cl.viewzoom;
@@ -429,7 +427,7 @@ void CL_Move (void)
                {
                        // non-mouselook, yaw turning and forward/back movement
                        cl.viewangles[YAW] -= m_yaw.value * in_mouse_x * sensitivity.value * cl.viewzoom;
-                       cl.cmd.forwardmove -= m_forward.value * in_mouse_y * sensitivity.value * cl.viewzoom;
+                       cl.cmd.forwardmove -= m_forward.value * in_mouse_y * sensitivity.value;
                }
        }
 
@@ -473,8 +471,8 @@ void CL_UpdatePrydonCursor(void)
        cl.cmd.cursor_screen[1] = bound(-1, cl.cmd.cursor_screen[1], 1);
        cl.cmd.cursor_screen[2] = 1;
 
-       scale[0] = -tan(r_refdef.fov_x * M_PI / 360.0);
-       scale[1] = -tan(r_refdef.fov_y * M_PI / 360.0);
+       scale[0] = -r_refdef.frustum_x;
+       scale[1] = -r_refdef.frustum_y;
        scale[2] = 1;
 
        // trace distance
@@ -513,7 +511,7 @@ void CL_ClientMovement_Input(qboolean buttonjump, qboolean buttoncrouch)
                                cl.movement_queue[cl.movement_numqueue++] = cl.movement_queue[i];
        }
        // add to input queue if there is room
-       if (cl_movement.integer && cl.movement_numqueue < sizeof(cl.movement_queue)/sizeof(cl.movement_queue[0]) && cl.mtime[0] > cl.mtime[1])
+       if (cl_movement.integer && cl.movement_numqueue < (int)(sizeof(cl.movement_queue)/sizeof(cl.movement_queue[0])) && cl.mtime[0] > cl.mtime[1])
        {
                // add to input queue
                cl.movement_queue[cl.movement_numqueue].sequence = cl.movesequence;
@@ -632,6 +630,8 @@ void CL_ClientMovement_Replay(void)
                                wishspeed = VectorLength(wishvel);
                                if (wishspeed)
                                        VectorScale(wishvel, 1 / wishspeed, wishdir);
+                               else
+                                       VectorSet( wishdir, 0.0, 0.0, 0.0 );
                                wishspeed = min(wishspeed, cl_movement_maxspeed.value);
                                if (crouch)
                                        wishspeed *= 0.5;
@@ -672,6 +672,8 @@ void CL_ClientMovement_Replay(void)
                                wishspeed = VectorLength(wishvel);
                                if (wishspeed)
                                        VectorScale(wishvel, 1 / wishspeed, wishdir);
+                               else
+                                       VectorSet( wishdir, 0.0, 0.0, 0.0 );
                                wishspeed = min(wishspeed, cl_movement_maxspeed.value);
                                if (crouch)
                                        wishspeed *= 0.5;
@@ -780,7 +782,7 @@ void CL_SendMove(void)
        int i;
        int bits;
        sizebuf_t buf;
-       qbyte data[128];
+       unsigned char data[128];
 #define MOVEAVERAGING 0
 #if MOVEAVERAGING
        static float forwardmove, sidemove, upmove, total; // accumulation