r1341 - trunk/code/sdl

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue May 6 16:24:35 EDT 2008


Author: ludwig
Date: 2008-05-06 16:24:34 -0400 (Tue, 06 May 2008)
New Revision: 1341

Modified:
   trunk/code/sdl/sdl_input.c
Log:
combine all mouse events received in one frame


Modified: trunk/code/sdl/sdl_input.c
===================================================================
--- trunk/code/sdl/sdl_input.c	2008-05-06 20:24:32 UTC (rev 1340)
+++ trunk/code/sdl/sdl_input.c	2008-05-06 20:24:34 UTC (rev 1341)
@@ -651,6 +651,7 @@
 	SDL_Event e;
 	const char *p = NULL;
 	int key = 0;
+	int mx = 0, my = 0;
 
 	if( !SDL_WasInit( SDL_INIT_VIDEO ) )
 			return;
@@ -691,7 +692,10 @@
 
 			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:
@@ -722,6 +726,9 @@
 				break;
 		}
 	}
+
+	if(mx || my)
+		Com_QueueEvent( 0, SE_MOUSE, mx, my, 0, NULL );
 }
 
 /*




More information about the quake3-commits mailing list