*** 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:
Spoike 2005-06-15 04:36:20 +00:00
parent def6f6fa60
commit 92c6acd4ec
1 changed files with 74 additions and 46 deletions

View File

@ -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,10 +945,34 @@ 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;
@ -967,6 +994,7 @@ void IN_MouseMove (usercmd_t *cmd, int pnum)
else
cmd->forwardmove -= m_forward.value * mouse_y;
}
}
mouse_x = mouse_y = 0.0;
}