mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 22:40:50 +00:00
Vereinfache den Code ein wenig
This commit is contained in:
parent
1807604001
commit
68135136bc
1 changed files with 90 additions and 103 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue