1
0
Fork 0
forked from fte/fteqw

some input cleanup, restarts should work a bit better

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2271 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-05-10 22:12:20 +00:00
parent 0d6d61e31c
commit 640524e990
8 changed files with 95 additions and 75 deletions

View file

@ -331,7 +331,7 @@ void IN_Impulse (void)
void IN_Restart (void)
{
IN_Shutdown();
IN_Init();
IN_ReInit();
}
/*

View file

@ -68,15 +68,12 @@ void IN_Shutdown(void)
inputport = 0;
}
}
void IN_Init()
void IN_ReInit()
{
/* Cvar_Register (&m_filter, "input controls");*/
Cvar_Register (&in_xflip, "input controls");
inputport = CreatePort(0, 0);
if (inputport == 0)
{
@ -106,7 +103,12 @@ void IN_Init()
inputreq->io_Data = (void *)&InputHandler;
inputreq->io_Command = IND_ADDHANDLER;
DoIO((struct IORequest *)inputreq);
}
void IN_Init(void)
{
Cvar_Register (&in_xflip, "input controls");
IN_ReInit();
}
static void ExpireRingBuffer()

View file

@ -284,11 +284,18 @@ void Sys_SendKeyEvents(void)
void IN_Shutdown (void)
{
}
void IN_ReInit (void)
{
IN_ActivateMouse();
}
void IN_Init (void)
{
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input Controls");
#endif
IN_ReInit();
}
void IN_Move (usercmd_t *cmd, int pnum) //add mouse movement to cmd
{

View file

@ -1199,86 +1199,84 @@ void IN_StartupMouse (void)
IN_Init
===========
*/
void IN_ReInit (void)
{
IN_StartupMouse ();
IN_StartupJoystick ();
IN_ActivateMouse();
}
void IN_Init (void)
{
static qboolean firstinit = true;
if (firstinit)
//keyboard variables
Cvar_Register (&cl_keypad, "Input Controls");
// mouse variables
Cvar_Register (&m_filter, "Input Controls");
Cvar_Register (&m_accel, "Input Controls");
Cvar_Register (&m_forcewheel, "Input Controls");
Cvar_Register (&in_mwhook, "Input Controls");
Cvar_Register (&in_dinput, "Input Controls");
Cvar_Register (&m_accel_noforce, "Input Controls");
Cvar_Register (&m_threshold_noforce, "Input Controls");
// this looks strange but quake cmdline definitions
// and MS documentation don't agree with each other
if (COM_CheckParm ("-noforcemspd"))
Cvar_Set(&m_accel_noforce, "1");
if (COM_CheckParm ("-noforcemaccel"))
Cvar_Set(&m_threshold_noforce, "1");
if (COM_CheckParm ("-noforcemparms"))
{
//keyboard variables
Cvar_Register (&cl_keypad, "Input Controls");
Cvar_Set(&m_accel_noforce, "1");
Cvar_Set(&m_threshold_noforce, "1");
}
// mouse variables
Cvar_Register (&m_filter, "Input Controls");
Cvar_Register (&m_accel, "Input Controls");
Cvar_Register (&m_forcewheel, "Input Controls");
Cvar_Register (&in_mwhook, "Input Controls");
Cvar_Register (&in_dinput, "Input Controls");
Cvar_Register (&m_accel_noforce, "Input Controls");
Cvar_Register (&m_threshold_noforce, "Input Controls");
// this looks strange but quake cmdline definitions
// and MS documentation don't agree with each other
if (COM_CheckParm ("-noforcemspd"))
Cvar_Set(&m_accel_noforce, "1");
if (COM_CheckParm ("-noforcemaccel"))
Cvar_Set(&m_threshold_noforce, "1");
if (COM_CheckParm ("-noforcemparms"))
{
Cvar_Set(&m_accel_noforce, "1");
Cvar_Set(&m_threshold_noforce, "1");
}
if (COM_CheckParm ("-dinput"))
Cvar_Set(&in_dinput, "1");
if (COM_CheckParm ("-dinput"))
Cvar_Set(&in_dinput, "1");
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input stuff");
Cvar_Register (&in_xflip, "Input stuff");
#endif
// joystick variables
Cvar_Register (&in_joystick, "Joystick variables");
// joystick variables
Cvar_Register (&in_joystick, "Joystick variables");
Cvar_Register (&joy_name, "Joystick variables");
Cvar_Register (&joy_advanced, "Joystick variables");
Cvar_Register (&joy_advaxisx, "Joystick variables");
Cvar_Register (&joy_advaxisy, "Joystick variables");
Cvar_Register (&joy_advaxisz, "Joystick variables");
Cvar_Register (&joy_advaxisr, "Joystick variables");
Cvar_Register (&joy_advaxisu, "Joystick variables");
Cvar_Register (&joy_advaxisv, "Joystick variables");
Cvar_Register (&joy_forwardthreshold, "Joystick variables");
Cvar_Register (&joy_sidethreshold, "Joystick variables");
Cvar_Register (&joy_pitchthreshold, "Joystick variables");
Cvar_Register (&joy_yawthreshold, "Joystick variables");
Cvar_Register (&joy_forwardsensitivity, "Joystick variables");
Cvar_Register (&joy_sidesensitivity, "Joystick variables");
Cvar_Register (&joy_pitchsensitivity, "Joystick variables");
Cvar_Register (&joy_yawsensitivity, "Joystick variables");
Cvar_Register (&joy_wwhack1, "Joystick variables");
Cvar_Register (&joy_wwhack2, "Joystick variables");
Cvar_Register (&joy_name, "Joystick variables");
Cvar_Register (&joy_advanced, "Joystick variables");
Cvar_Register (&joy_advaxisx, "Joystick variables");
Cvar_Register (&joy_advaxisy, "Joystick variables");
Cvar_Register (&joy_advaxisz, "Joystick variables");
Cvar_Register (&joy_advaxisr, "Joystick variables");
Cvar_Register (&joy_advaxisu, "Joystick variables");
Cvar_Register (&joy_advaxisv, "Joystick variables");
Cvar_Register (&joy_forwardthreshold, "Joystick variables");
Cvar_Register (&joy_sidethreshold, "Joystick variables");
Cvar_Register (&joy_pitchthreshold, "Joystick variables");
Cvar_Register (&joy_yawthreshold, "Joystick variables");
Cvar_Register (&joy_forwardsensitivity, "Joystick variables");
Cvar_Register (&joy_sidesensitivity, "Joystick variables");
Cvar_Register (&joy_pitchsensitivity, "Joystick variables");
Cvar_Register (&joy_yawsensitivity, "Joystick variables");
Cvar_Register (&joy_wwhack1, "Joystick variables");
Cvar_Register (&joy_wwhack2, "Joystick variables");
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f);
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f);
uiWheelMessage = RegisterWindowMessage ( "MSWHEEL_ROLLMSG" );
uiWheelMessage = RegisterWindowMessage ( "MSWHEEL_ROLLMSG" );
#ifdef USINGRAWINPUT
Cvar_Register (&in_rawinput, "Input Controls");
Cvar_Register (&in_rawinput_combine, "Input Controls");
Cvar_Register (&in_rawinput_rdp, "Input Controls");
Cvar_Register (&in_rawinput, "Input Controls");
Cvar_Register (&in_rawinput_combine, "Input Controls");
Cvar_Register (&in_rawinput_rdp, "Input Controls");
#endif
}
else
{
IN_StartupMouse ();
IN_StartupJoystick ();
}
firstinit = false;
IN_ReInit();
}
/*

View file

@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// input.h -- external (non-keyboard) input devices
void IN_ReInit (void);
void IN_Init (void);
void IN_Shutdown (void);

View file

@ -1615,7 +1615,7 @@ TRACE(("dbg: R_ApplyRenderer: renderer inited\n"));
TRACE(("dbg: R_ApplyRenderer: screen inited\n"));
Sbar_Flush();
IN_Init();
IN_ReInit();
}
else
{

View file

@ -950,12 +950,17 @@ void Force_CenterView_f (void)
cl.viewangles[0][PITCH] = 0;
}
void IN_ReInit(void)
{
}
#ifndef SWQUAKE
void IN_Init(void)
{
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input variables");
#endif
IN_ReInit();
}
void IN_Shutdown(void)

View file

@ -1263,6 +1263,14 @@ void SWD_EndDirectRect (int x, int y, int width, int height)
// direct drawing of the "accessing disk" icon isn't supported under Linux
}
void IN_ReInit(void)
{
if ( COM_CheckParm ("-nomouse") )
return;
mouse_x = mouse_y = 0.0;
mouseactive = mouse_avail = 1;
}
void IN_Init (void)
{
Cvar_Register (&_windowed_mouse, "Input Controls");
@ -1271,10 +1279,8 @@ void IN_Init (void)
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input Controls");
#endif
if ( COM_CheckParm ("-nomouse") )
return;
mouse_x = mouse_y = 0.0;
mouseactive = mouse_avail = 1;
IN_ReInit();
}
void IN_Shutdown (void)