mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-12 23:44:39 +00:00
*** empty log message ***
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1091 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
def6f6fa60
commit
92c6acd4ec
1 changed files with 74 additions and 46 deletions
|
@ -931,6 +931,9 @@ IN_Move
|
|||
*/
|
||||
void IN_MouseMove (usercmd_t *cmd, int pnum)
|
||||
{
|
||||
extern int mouseusedforgui, mousecursor_x, mousecursor_y;
|
||||
extern int mousemove_x, mousemove_y;
|
||||
|
||||
if (m_filter.value)
|
||||
{
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
|
@ -942,30 +945,55 @@ void IN_MouseMove (usercmd_t *cmd, int pnum)
|
|||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
|
||||
if (mouseusedforgui || (key_dest == key_menu && m_state == m_complex) || UI_MenuState())
|
||||
{
|
||||
mousemove_x += mouse_x;
|
||||
mousemove_y += mouse_y;
|
||||
mousecursor_x += mouse_x;
|
||||
mousecursor_y += mouse_y;
|
||||
|
||||
if (mousecursor_y<0)
|
||||
mousecursor_y=0;
|
||||
if (mousecursor_x<0)
|
||||
mousecursor_x=0;
|
||||
|
||||
if (mousecursor_x >= vid.width)
|
||||
mousecursor_x = vid.width - 1;
|
||||
|
||||
if (mousecursor_y >= vid.height)
|
||||
mousecursor_y = vid.height - 1;
|
||||
mouse_x=mouse_y=0;
|
||||
|
||||
UI_MousePosition(mousecursor_x, mousecursor_y);
|
||||
}
|
||||
|
||||
#ifdef IN_XFLIP
|
||||
if(in_xflip.value) mouse_x *= -1;
|
||||
#endif
|
||||
|
||||
if (cmd)
|
||||
{
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state[pnum] & 1) || (lookstrafe.value && (in_mlook.state[pnum] & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
else
|
||||
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
|
||||
|
||||
if (in_mlook.state[pnum] & 1)
|
||||
V_StopPitchDrift (pnum);
|
||||
|
||||
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1))
|
||||
{
|
||||
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
|
||||
CL_ClampPitch(pnum);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((in_strafe.state[pnum] & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
if ( (in_strafe.state[pnum] & 1) || (lookstrafe.value && (in_mlook.state[pnum] & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
|
||||
|
||||
if (in_mlook.state[pnum] & 1)
|
||||
V_StopPitchDrift (pnum);
|
||||
|
||||
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1))
|
||||
{
|
||||
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
|
||||
CL_ClampPitch(pnum);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((in_strafe.state[pnum] & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
}
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue