mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-11-23 16:10:09 +00:00
input: mlook/lookspring fix
Call V_StartPitchDrift only if lookspring has been turned on, then make sure to call V_StopPitchDrift if mlook is on and the mouse is moved. From Jacques Krige's tutorial, see http://www.quake-1.com/docs/quakesrc.org/1.html Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
4a4ea5367c
commit
0dc82b6d60
@ -208,9 +208,10 @@ V_DriftPitch(void)
|
||||
else
|
||||
cl.driftmove += host_frametime;
|
||||
|
||||
if (cl.driftmove > v_centermove.value) {
|
||||
V_StartPitchDrift();
|
||||
}
|
||||
if (cl.driftmove > v_centermove.value)
|
||||
if (lookspring.value)
|
||||
V_StartPitchDrift();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -211,9 +211,10 @@ V_DriftPitch(void)
|
||||
else
|
||||
cl.driftmove += host_frametime;
|
||||
|
||||
if (cl.driftmove > v_centermove.value) {
|
||||
V_StartPitchDrift();
|
||||
}
|
||||
if (cl.driftmove > v_centermove.value)
|
||||
if (lookspring.value)
|
||||
V_StartPitchDrift();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -643,7 +643,8 @@ IN_MouseMove(usercmd_t *cmd)
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift();
|
||||
if (mouse_x || mouse_y)
|
||||
V_StopPitchDrift();
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
|
@ -680,7 +680,8 @@ IN_MouseMove(usercmd_t *cmd)
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift();
|
||||
if (mouse_x || mouse_y)
|
||||
V_StopPitchDrift();
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
@ -1081,13 +1082,6 @@ IN_JoyMove(usercmd_t *cmd)
|
||||
aspeed * cl_pitchspeed.value;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
} else {
|
||||
// no pitch movement
|
||||
// disable pitch return-to-center unless requested by user
|
||||
// *** this code can be removed when the lookspring bug is fixed
|
||||
// *** the bug always has the lookspring feature on
|
||||
if (lookspring.value == 0.0)
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
} else {
|
||||
// user wants forward control to be forward control
|
||||
@ -1147,13 +1141,6 @@ IN_JoyMove(usercmd_t *cmd)
|
||||
speed * 180.0;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
} else {
|
||||
// no pitch movement
|
||||
// disable pitch return-to-center unless requested by user
|
||||
// *** this code can be removed when the lookspring bug is fixed
|
||||
// *** the bug always has the lookspring feature on
|
||||
if (lookspring.value == 0.0)
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -298,7 +298,8 @@ IN_MouseMove(usercmd_t *cmd)
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
if (mouse_x || mouse_y)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
|
Loading…
Reference in New Issue
Block a user