aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-02-25 18:59:00 +0000
committerMax Horn2009-02-25 18:59:00 +0000
commit3a000f3d84531288690a665297ec0180daab8b2d (patch)
tree5b649f64ede5d55e1d1ca8f0c847395a0b0e4d4a /engines
parent9ed544679a352d50cef9b1a9a0c12dd3dd63ea61 (diff)
downloadscummvm-rg350-3a000f3d84531288690a665297ec0180daab8b2d.tar.gz
scummvm-rg350-3a000f3d84531288690a665297ec0180daab8b2d.tar.bz2
scummvm-rg350-3a000f3d84531288690a665297ec0180daab8b2d.zip
SCI: Simplify event polling code a little bit
svn-id: r38881
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gfx/gfx_driver.cpp24
-rw-r--r--engines/sci/gfx/operations.cpp3
2 files changed, 6 insertions, 21 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index e5e1beeb5f..528904c7b5 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -38,8 +38,6 @@ struct _scummvm_driver_state {
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 @@ static int scummvm_set_pointer(gfx_driver_t *drv, gfx_pixmap_t *pointer) {
g_system->showMouse(true);
}
- // Pointer pixmap or mouse position has changed
- S->update_mouse = true;
return GFX_OK;
}
@@ -325,27 +321,13 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
// 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) |
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 4e62bfc846..04bbe2e0d6 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -1626,6 +1626,9 @@ sci_event_t gfxop_get_event(gfx_state_t *state, unsigned int mask) {
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);