diff options
author | Ensiform <ensiform@gmail.com> | 2015-01-17 22:52:00 -0600 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2015-03-17 11:43:04 +0000 |
commit | d9580d71cd7e5edcd57eed506454c67db35db211 (patch) | |
tree | f4672aaa163605251c9b8134f993664d43b10781 /src/sdl | |
parent | ece466ed2c83d2b345790bc82418d345615a361d (diff) |
Move Event processor call down below the mouse checks.
Only send mouse events if both values are non-zero.
Hopefully this helps with the event overflow spam that can sometimes
happen on loads or laggy situations.
Diffstat (limited to 'src/sdl')
-rw-r--r-- | src/sdl/sdl_input.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c index bd59cc51..562aef12 100644 --- a/src/sdl/sdl_input.c +++ b/src/sdl/sdl_input.c @@ -851,7 +851,11 @@ static void IN_ProcessEvents( void ) case SDL_MOUSEMOTION: if( mouseActive ) + { + if( !e.motion.xrel && !e.motion.yrel ) + break; Com_QueueEvent( 0, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL ); + } break; case SDL_MOUSEBUTTONDOWN: @@ -933,7 +937,6 @@ void IN_Frame( void ) int x, y; IN_JoyMove( ); - IN_ProcessEvents( ); // If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading loading = ( clc.state != CA_DISCONNECTED && clc.state != CA_ACTIVE ); @@ -968,6 +971,8 @@ void IN_Frame( void ) IN_SetUIMousePosition( x, y ); } + IN_ProcessEvents( ); + // In case we had to delay actual restart of video system if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) ) { |