*/
void IN_MouseMove (usercmd_t *cmd)
{
- int i, mx, my, mouselook = (in_mlook.state & 1) || freelook.value;
+ int i, mx, my, mouselook = (in_mlook.state & 1) || freelook.integer;
DIDEVICEOBJECTDATA od;
DWORD dwElements;
HRESULT hr;
//if (mx || my)
// Con_DPrintf("mx=%d, my=%d\n", mx, my);
- if (m_filter.value)
+ if (m_filter.integer)
{
mouse_x = (mx + old_mouse_x) * 0.5;
mouse_y = (my + old_mouse_y) * 0.5;
old_mouse_x = mx;
old_mouse_y = my;
- mouse_x *= sensitivity.value;
- mouse_y *= sensitivity.value;
+ // LordHavoc: viewzoom affects mouse sensitivity for sniping
+ mouse_x *= sensitivity.value * cl.viewzoom;
+ mouse_y *= sensitivity.value * cl.viewzoom;
// add mouse X/Y movement to cmd
- if ( (in_strafe.state & 1) || (lookstrafe.value && mouselook))
+ if ( (in_strafe.state & 1) || (lookstrafe.integer && mouselook))
cmd->sidemove += m_side.value * mouse_x;
else
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
// LordHavoc: changed limits on pitch from -70 to 80, to -90 to 90
if (mouselook && !(in_strafe.state & 1))
- {
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
- if (cl.viewangles[PITCH] > 90)
- cl.viewangles[PITCH] = 90;
- if (cl.viewangles[PITCH] < -90)
- cl.viewangles[PITCH] = -90;
- }
else
{
if ((in_strafe.state & 1) && noclip_anglehack)
*/
void IN_Move (usercmd_t *cmd)
{
-
if (ActiveApp && !Minimized)
{
IN_MouseMove (cmd);
IN_JoyMove (cmd);
}
+
+ cl.viewangles[PITCH] = bound (in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value);
}
pdwRawValue[i] = RawValuePointer(i);
}
- if( joy_advanced.value == 0.0)
+ if( joy_advanced.integer == 0)
{
// default joystick initialization
// 2 axes only with joystick control
// this is a hack -- there is a bug in the Logitech WingMan Warrior DirectInput Driver
// rather than having 32768 be the zero point, they have the zero point at 32668
// go figure -- anyway, now we get the full resolution out of the device
- if (joy_wwhack1.value != 0.0)
+ if (joy_wwhack1.integer != 0.0)
{
ji.dwUpos += 100;
}
{
float speed, aspeed;
float fAxisValue, fTemp;
- int i, mouselook = (in_mlook.state & 1) || freelook.value;
+ int i, mouselook = (in_mlook.state & 1) || freelook.integer;
// complete initialization if first time in
// this is needed as cvars are not available at initialization time
}
// verify joystick is available and that the user wants to use it
- if (!joy_avail || !in_joystick.value)
+ if (!joy_avail || !in_joystick.integer)
{
return;
}
-
+
// collect the joystick data, if possible
if (IN_ReadJoystick () != true)
{
speed = cl_movespeedkey.value;
else
speed = 1;
- aspeed = speed * host_realframetime;
+ // LordHavoc: viewzoom affects sensitivity for sniping
+ aspeed = speed * host_realframetime * cl.viewzoom;
// loop through the axes
for (i = 0; i < JOY_MAX_AXES; i++)
// move centerpoint to zero
fAxisValue -= 32768.0;
- if (joy_wwhack2.value != 0.0)
+ if (joy_wwhack2.integer != 0.0)
{
if (dwAxisMap[i] == AxisTurn)
{
switch (dwAxisMap[i])
{
case AxisForward:
- if ((joy_advanced.value == 0.0) && mouselook)
+ if ((joy_advanced.integer == 0) && mouselook)
{
// user wants forward control to become look control
if (fabs(fAxisValue) > joy_pitchthreshold.value)
break;
case AxisTurn:
- if ((in_strafe.state & 1) || (lookstrafe.value && mouselook))
+ if ((in_strafe.state & 1) || (lookstrafe.integer && mouselook))
{
// user wants turn control to become side control
if (fabs(fAxisValue) > joy_sidethreshold.value)
// 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)
+ if(lookspring.integer == 0)
V_StopPitchDrift();
}
}