From b9e97b38574e06cfad36ee77dea945234fc1f472 Mon Sep 17 00:00:00 2001 From: Ensiform Date: Sat, 17 Jan 2015 22:52:00 -0600 Subject: [PATCH] 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. --- code/sdl/sdl_input.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c index 46f95464..7d8a6d30 100644 --- a/code/sdl/sdl_input.c +++ b/code/sdl/sdl_input.c @@ -802,7 +802,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: @@ -883,7 +887,6 @@ void IN_Frame( void ) qboolean loading; 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 ); @@ -906,6 +909,8 @@ void IN_Frame( void ) else IN_ActivateMouse( ); + IN_ProcessEvents( ); + // In case we had to delay actual restart of video system if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) ) {