*/
void IN_ShowMouse (void)
{
-
if (!mouseshowtoggle)
{
- ShowCursor (TRUE);
+ ShowCursor (true);
mouseshowtoggle = 1;
}
}
*/
void IN_HideMouse (void)
{
-
if (mouseshowtoggle)
{
- ShowCursor (FALSE);
+ ShowCursor (false);
mouseshowtoggle = 0;
}
}
SetCursorPos (window_center_x, window_center_y);
SetCapture (mainwindow);
ClipCursor (&window_rect);
+
}
mouseactive = true;
}
-/*
-===========
-IN_SetQuakeMouseState
-===========
-*/
-void IN_SetQuakeMouseState (void)
-{
- if (mouseactivatetoggle)
- IN_ActivateMouse ();
-}
-
-
/*
===========
IN_DeactivateMouse
}
-/*
-===========
-IN_RestoreOriginalMouseState
-===========
-*/
-void IN_RestoreOriginalMouseState (void)
-{
- if (mouseactivatetoggle)
- {
- IN_DeactivateMouse ();
- mouseactivatetoggle = true;
- }
-
-// try to redraw the cursor so it gets reinitialized, because sometimes it
-// has garbage after the mode switch
- ShowCursor (TRUE);
- ShowCursor (FALSE);
-}
-
-
/*
===========
IN_InitDInput
*/
void IN_Shutdown (void)
{
-
+// usingmouse = false;
IN_DeactivateMouse ();
IN_ShowMouse ();
*/
void IN_MouseMove (usercmd_t *cmd)
{
- int mx, my;
- int i;
+ int i, mx, my, mouselook = (in_mlook.state & 1) || freelook.value;
DIDEVICEOBJECTDATA od;
DWORD dwElements;
HRESULT hr;
mouse_y *= sensitivity.value;
// add mouse X/Y movement to cmd
- if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
+ if ( (in_strafe.state & 1) || (lookstrafe.value && mouselook))
cmd->sidemove += m_side.value * mouse_x;
else
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
- if (in_mlook.state & 1)
+ if (mouselook)
V_StopPitchDrift ();
-
- if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
+
+ // 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] > 80)
- cl.viewangles[PITCH] = 80;
- if (cl.viewangles[PITCH] < -70)
- cl.viewangles[PITCH] = -70;
+ if (cl.viewangles[PITCH] > 90)
+ cl.viewangles[PITCH] = 90;
+ if (cl.viewangles[PITCH] < -90)
+ cl.viewangles[PITCH] = -90;
}
else
{
case JOY_AXIS_V:
return &ji.dwVpos;
}
+ return NULL; // LordHavoc: hush compiler warning
}
{
float speed, aspeed;
float fAxisValue, fTemp;
- int i;
+ int i, mouselook = (in_mlook.state & 1) || freelook.value;
// complete initialization if first time in
// this is needed as cvars are not available at initialization time
speed = cl_movespeedkey.value;
else
speed = 1;
- aspeed = speed * host_frametime;
+ aspeed = speed * host_realframetime;
// loop through the axes
for (i = 0; i < JOY_MAX_AXES; i++)
switch (dwAxisMap[i])
{
case AxisForward:
- if ((joy_advanced.value == 0.0) && (in_mlook.state & 1))
+ if ((joy_advanced.value == 0.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 && (in_mlook.state & 1)))
+ if ((in_strafe.state & 1) || (lookstrafe.value && mouselook))
{
// user wants turn control to become side control
if (fabs(fAxisValue) > joy_sidethreshold.value)
break;
case AxisLook:
- if (in_mlook.state & 1)
+ if (mouselook)
{
if (fabs(fAxisValue) > joy_pitchthreshold.value)
{