Vereinfache den Code ein wenig

This commit is contained in:
Yamagi Burmeister 2010-10-19 08:30:02 +00:00
parent 1807604001
commit 68135136bc

View file

@ -38,7 +38,6 @@ static cvar_t *windowed_mouse;
static cvar_t *windowed_mouse_always;
static int mouse_x, mouse_y;
static int old_mouse_x, old_mouse_y;
static qboolean mouse_avail;
static int mouse_buttonstate;
static int mouse_oldbuttonstate;
@ -449,7 +448,6 @@ IN_BackendInit ( in_state_t *in_state_p )
ri.Cmd_AddCommand( "force_centerview", IN_ForceCenterView );
mouse_x = mouse_y = 0.0;
mouse_avail = true;
/* SDL stuff */
SDL_EnableUNICODE( 0 );
@ -467,23 +465,16 @@ IN_BackendInit ( in_state_t *in_state_p )
void
IN_BackendShutdown ( void )
{
if ( mouse_avail )
{
mouse_avail = false;
ri.Cmd_RemoveCommand( "+mlook" );
ri.Cmd_RemoveCommand( "-mlook" );
ri.Cmd_RemoveCommand( "force_centerview" );
}
}
void
IN_BackendMouseButtons ( void )
{
int i;
if ( mouse_avail )
{
IN_GetMouseState( &mouse_x, &mouse_y, &mouse_buttonstate );
for ( i = 0; i < 3; i++ )
@ -521,12 +512,9 @@ IN_BackendMouseButtons ( void )
mouse_oldbuttonstate = mouse_buttonstate;
}
}
void
IN_BackendMove ( usercmd_t *cmd )
{
if ( mouse_avail )
{
IN_GetMouseState( &mouse_x, &mouse_y, &mouse_buttonstate );
@ -598,5 +586,4 @@ IN_BackendMove ( usercmd_t *cmd )
IN_ClearMouseState();
}
}
}