combine all mouse events received in one frame

This commit is contained in:
Ludwig Nussel 2008-05-06 20:24:34 +00:00
parent d7bdf4b344
commit c45d5403a5
1 changed files with 8 additions and 1 deletions

View File

@ -651,6 +651,7 @@ static void IN_ProcessEvents( void )
SDL_Event e; SDL_Event e;
const char *p = NULL; const char *p = NULL;
int key = 0; int key = 0;
int mx = 0, my = 0;
if( !SDL_WasInit( SDL_INIT_VIDEO ) ) if( !SDL_WasInit( SDL_INIT_VIDEO ) )
return; return;
@ -691,7 +692,10 @@ static void IN_ProcessEvents( void )
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
if (mouseActive) if (mouseActive)
Com_QueueEvent( 0, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL ); {
mx += e.motion.xrel;
my += e.motion.yrel;
}
break; break;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
@ -722,6 +726,9 @@ static void IN_ProcessEvents( void )
break; break;
} }
} }
if(mx || my)
Com_QueueEvent( 0, SE_MOUSE, mx, my, 0, NULL );
} }
/* /*