[Scummvm-cvs-logs] SF.net SVN: scummvm:[38881] scummvm/trunk/engines/sci/gfx

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Feb 25 19:59:00 CET 2009


Revision: 38881
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38881&view=rev
Author:   fingolfin
Date:     2009-02-25 18:59:00 +0000 (Wed, 25 Feb 2009)

Log Message:
-----------
SCI: Simplify event polling code a little bit

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-25 18:23:28 UTC (rev 38880)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-25 18:59:00 UTC (rev 38881)
@@ -38,8 +38,6 @@
 	byte *visual[2];
 	uint8 *pointer_data;
 	int xsize, ysize;
-	//int buckystate;
-	bool update_mouse;
 };
 
 #define S ((struct _scummvm_driver_state *)(drv->state))
@@ -293,8 +291,6 @@
 		g_system->showMouse(true);
 	}
 
-	// Pointer pixmap or mouse position has changed
-	S->update_mouse = true;
 	return GFX_OK;
 }
 
@@ -325,27 +321,13 @@
 
 	// Don't generate events for mouse movement
 	while (found && ev.type == Common::EVENT_MOUSEMOVE) {
+		drv->pointer_x = ev.mouse.x;
+		drv->pointer_y = ev.mouse.y;
 		found = em->pollEvent(ev);
-		p = ev.mouse;
-		drv->pointer_x = p.x;
-		drv->pointer_y = p.y;
-		S->update_mouse = true;
 	}
 
-	// Update the screen here, since it's called very often
-	if (S->update_mouse)
-		g_system->warpMouse(drv->pointer_x, drv->pointer_y);
-	if (S->update_mouse) {
-		g_system->updateScreen();
-		S->update_mouse = false;
-	}
-
 	if (found && !ev.synthetic && ev.type != Common::EVENT_MOUSEMOVE) {
-		int modifiers;
-		if (ev.type == Common::EVENT_KEYDOWN)
-			modifiers = ev.kbd.flags;
-		else
-			modifiers = em->getModifierState();
+		int modifiers = em->getModifierState();
 
 		input.buckybits =
 		    ((modifiers & Common::KBD_ALT) ? SCI_EVM_ALT : 0) |

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-25 18:23:28 UTC (rev 38880)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-25 18:59:00 UTC (rev 38881)
@@ -1626,6 +1626,9 @@
 		GFXERROR("Failed to remove pointer before processing event!\n");
 	}
 
+	// Update the screen here, since it's called very often
+	g_system->updateScreen();
+
 	// Get all queued events from graphics driver
 	do {
 		event = state->driver->get_event(state->driver);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list