Skip to content

Commit

Permalink
combine all mouse events received in one frame
Browse files Browse the repository at this point in the history
  • Loading branch information
lnussel committed May 6, 2008
1 parent d7bdf4b commit c45d540
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion code/sdl/sdl_input.c
Expand Up @@ -651,6 +651,7 @@ static void IN_ProcessEvents( void )
SDL_Event e;
const char *p = NULL;
int key = 0;
int mx = 0, my = 0;

if( !SDL_WasInit( SDL_INIT_VIDEO ) )
return;
Expand Down Expand Up @@ -691,7 +692,10 @@ static void IN_ProcessEvents( void )

case SDL_MOUSEMOTION:
if (mouseActive)
Com_QueueEvent( 0, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL );
{
mx += e.motion.xrel;
my += e.motion.yrel;
}
break;

case SDL_MOUSEBUTTONDOWN:
Expand Down Expand Up @@ -722,6 +726,9 @@ static void IN_ProcessEvents( void )
break;
}
}

if(mx || my)
Com_QueueEvent( 0, SE_MOUSE, mx, my, 0, NULL );
}

/*
Expand Down

0 comments on commit c45d540

Please sign in to comment.