diff options
34 files changed, 122 insertions, 48 deletions
diff --git a/common/system.h b/common/system.h index a8aa1198bd..53a545627c 100644 --- a/common/system.h +++ b/common/system.h @@ -680,9 +680,6 @@ public: /** @name Events and Time */ //@{ -//protected: - friend class Common::EventManager; - /** * The types of events backends may generate. * @see Event @@ -790,6 +787,9 @@ public: Common::Point mouse; }; +protected: + friend class DefaultEventManager; + /** * Get the next event in the event queue. * @param event point to an Event struct, which will be filled with the event data. diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index f13c905411..c15428e7c5 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -24,6 +24,7 @@ #include "common/stdafx.h" +#include "common/events.h" #include "common/file.h" #include "common/fs.h" #include "common/savefile.h" @@ -56,12 +57,13 @@ void AgiEngine::processEvents() { OSystem::Event event; int key = 0; - while (g_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: _gfx->deinitVideo(); _gfx->deinitMachine(); - g_system->quit(); + _system->quit(); break; case OSystem::EVENT_LBUTTONDOWN: key = BUTTON_LEFT; @@ -236,8 +238,8 @@ void AgiEngine::agiTimerLow() { processEvents(); if (_console->isAttached()) _console->onFrame(); - g_system->delayMillis(10); - g_system->updateScreen(); + _system->delayMillis(10); + _system->updateScreen(); } m = g_tickTimer; } diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index 8d0c8dc7cb..3d37972e46 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -24,6 +24,7 @@ #include "common/stdafx.h" #include "common/endian.h" +#include "common/events.h" #include "common/system.h" #include "graphics/cursorman.h" @@ -233,7 +234,8 @@ void MoviePlayer::handleNextFrame() { _frameNum++; OSystem::Event event; - while (_vm->_system->pollEvent(event)) { + Common::EventManager *eventMan = _vm->_system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.ascii == 27) { diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 8ffd6390f9..7008d9a04e 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -27,6 +27,7 @@ #include "agos/debugger.h" #include "agos/intern.h" +#include "common/events.h" #include "common/system.h" #include "gui/about.h" @@ -331,7 +332,8 @@ void AGOSEngine::delay(uint amount) { _inCallBack = false; } - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.keycode >= '0' && event.kbd.keycode <='9' diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index b3d60ca547..aeb7dede17 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -24,6 +24,7 @@ #include "common/stdafx.h" #include "common/scummsys.h" +#include "common/events.h" #include "common/system.h" #include "cine/main_loop.h" @@ -47,7 +48,8 @@ uint16 dummyU16; void manageEvents(int count) { OSystem::Event event; - while (g_system->pollEvent(event)) { + Common::EventManager *eventMan = g_system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_LBUTTONDOWN: mouseLeft = 1; diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 6dfa5b4d7c..5eec30e617 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -28,6 +28,8 @@ #include "gob/game.h" #include "gob/inter.h" +#include "common/events.h" + namespace Gob { Util::Util(GobEngine *vm) : _vm(vm) { @@ -139,7 +141,8 @@ int16 Util::getRandom(int16 max) { void Util::processInput() { OSystem::Event event; - while (g_system->pollEvent(event)) { + Common::EventManager *eventMan = g_system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_MOUSEMOVE: _mouseX = event.mouse.x; diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 8654cb2c51..0ca9fd6be2 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -29,6 +29,7 @@ #include "common/config-manager.h" #include "common/savefile.h" +#include "common/events.h" #include "common/system.h" namespace Kyra { @@ -805,7 +806,8 @@ void KyraEngine::gui_getInput() { uint32 now = _system->getMillis(); _mouseWheel = 0; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: quitGame(); @@ -1481,7 +1483,8 @@ void KyraEngine::gui_updateMainMenuAnimation() { bool KyraEngine::gui_mainMenuGetInput() { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: quitGame(); diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index fe85a439a8..887daa7d92 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -24,6 +24,7 @@ #include "common/config-manager.h" #include "common/file.h" +#include "common/events.h" #include "common/system.h" #include "common/savefile.h" @@ -608,7 +609,8 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { uint32 start = _system->getMillis(); do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' && @@ -705,7 +707,8 @@ void KyraEngine::waitForEvent() { bool finished = false; OSystem::Event event; while (!finished && !_quitFlag) { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: finished = true; diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index c243781a75..955ca3dd98 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -30,6 +30,7 @@ #include "kyra/animator.h" #include "kyra/text.h" +#include "common/events.h" #include "common/system.h" #include "common/savefile.h" @@ -1170,7 +1171,8 @@ void KyraEngine::seq_playCredits() { _screen->updateScreen(); } - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: finished = true; diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index 4433330c1a..4b2caa39d3 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -28,6 +28,7 @@ #include "kyra/animator.h" #include "kyra/sprites.h" +#include "common/events.h" #include "common/system.h" #include "common/endian.h" @@ -117,7 +118,8 @@ void KyraEngine::waitForChatToFinish(int vocFile, int16 chatDuration, const char uint32 nextTime = loopStart + _tickLength; while (_system->getMillis() < nextTime) { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.keycode == '.') diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 10f85fcfc1..ddeaa4beb1 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -29,6 +29,7 @@ // The jung2.vqa movie does work, but only thanks to a grotesque hack. #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "sound/audiostream.h" #include "sound/mixer.h" @@ -662,7 +663,8 @@ void VQAMovie::play() { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.ascii == 27) diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index 7a1ef4ea9a..3bc81583d7 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -20,6 +20,9 @@ * */ +#include "common/stdafx.h" +#include "common/events.h" + #include "graphics/cursorman.h" #include "lure/events.h" @@ -146,7 +149,7 @@ Events &Events::getReference() { bool Events::pollEvent() { - if (!g_system->pollEvent(_event)) return false; + if (!g_system->getEventManager()->pollEvent(_event)) return false; // Handle keypress switch (_event.type) { diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 732c11ba99..c91c9c96b7 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -28,6 +28,8 @@ #include "parallaction/parser.h" #include "parallaction/zone.h" +#include "common/events.h" + namespace Parallaction { #define SKIPPED_ANSWER 1000 @@ -433,7 +435,7 @@ void runDialogue(SpeakData *data) { while (e.kbd.ascii != 0xD && passwordLen < MAX_PASSWORD_LENGTH) { // FIXME: see comment for updateInput() - if (!g_system->pollEvent(e)) continue; + if (!g_system->getEventManager()->pollEvent(e)) continue; if (e.type != OSystem::EVENT_KEYDOWN) continue; if (e.type != OSystem::EVENT_QUIT) g_system->quit(); if (!isdigit(e.kbd.ascii)) continue; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 3aecef69ab..eeb29f8bc3 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -22,9 +22,10 @@ #include "common/stdafx.h" -#include "common/util.h" -#include "common/file.h" #include "common/config-manager.h" +#include "common/events.h" +#include "common/file.h" +#include "common/util.h" #include "sound/mididrv.h" #include "sound/mixer.h" @@ -326,7 +327,8 @@ uint16 Parallaction::updateInput() { _mouseButtons = kMouseNone; - while (g_system->pollEvent(e)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(e)) { switch (e.type) { case OSystem::EVENT_KEYDOWN: @@ -375,8 +377,9 @@ void waitUntilLeftClick() { OSystem::Event e; + Common::EventManager *eventMan = g_system->getEventManager(); for (;;) { - g_system->pollEvent(e); + eventMan->pollEvent(e); if (e.type == OSystem::EVENT_LBUTTONUP) break; diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index 82bcc9d8da..578aa56e03 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -21,6 +21,7 @@ */ #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "queen/input.h" @@ -91,7 +92,8 @@ void Input::delay(uint amount) { uint32 end = _system->getMillis() + amount; do { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { _idleTime = 0; switch (event.type) { case OSystem::EVENT_KEYDOWN: diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index 82a2a5e0b8..be4b3a45a1 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -21,6 +21,7 @@ */ #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "queen/journal.h" @@ -65,7 +66,8 @@ void Journal::use() { _quitMode = QM_LOOP; while (_quitMode == QM_LOOP) { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: handleKeyDown(event.kbd.ascii, event.kbd.keycode); diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp index 0abce03a31..ae14a43b9b 100644 --- a/engines/saga/input.cpp +++ b/engines/saga/input.cpp @@ -32,6 +32,7 @@ #include "saga/script.h" #include "saga/isomap.h" +#include "common/events.h" #include "common/system.h" namespace Saga { @@ -41,7 +42,8 @@ int SagaEngine::processInput() { // Point imousePt; - while (g_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.flags == OSystem::KBD_CTRL) { diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 692694851d..48b3738209 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -24,6 +24,7 @@ #include "common/stdafx.h" #include "common/config-manager.h" +#include "common/events.h" #include "common/system.h" #include "gui/message.h" @@ -56,7 +57,8 @@ enum MouseButtonStatus { void ScummEngine::parseEvents() { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 267b78d1f7..74ebd47d26 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/fs.h" #include "common/md5.h" +#include "common/events.h" #include "common/system.h" #include "gui/message.h" @@ -850,7 +851,8 @@ int ScummEngine_vCUPhe::go() { void ScummEngine_vCUPhe::parseEvents() { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: _quit = true; diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index bd51fdf9dc..651dd33c4c 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -24,6 +24,7 @@ #include "common/endian.h" #include "common/config-manager.h" #include "common/file.h" +#include "common/events.h" #include "common/system.h" #include "common/savefile.h" #include "common/util.h" @@ -1550,7 +1551,8 @@ void Control::delay(unsigned int amount) { _keyPressed = 0; //reset do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: // Make sure backspace works right (this fixes a small issue on OS X) diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index c6cd1f344b..2129a1a50a 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -23,6 +23,7 @@ #include "common/stdafx.h" #include "common/endian.h" #include "common/util.h" +#include "common/events.h" #include "common/system.h" #include "sky/disk.h" @@ -906,7 +907,8 @@ bool Intro::escDelay(uint32 msecs) { int32 nDelay = 0; do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { if (event.type == OSystem::EVENT_KEYDOWN) { if (event.kbd.keycode == 27) return false; diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index da614db04e..d655bb4e08 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -21,6 +21,7 @@ */ #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "graphics/cursorman.h" #include "sky/disk.h" @@ -173,7 +174,8 @@ void Mouse::waitMouseNotPressed(int minDelay) { uint32 now = _system->getMillis(); OSystem::Event event; while (mousePressed || _system->getMillis() < now + minDelay) { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_LBUTTONUP: mousePressed = false; diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index 3cf545b001..a4509250e9 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "common/endian.h" +#include "common/events.h" #include "common/system.h" #include "sky/disk.h" @@ -395,7 +396,8 @@ void Screen::waitForTimer(void) { OSystem::Event event; _system->delayMillis(10); - while (_system->pollEvent(event)); + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)); } } @@ -404,7 +406,8 @@ void Screen::waitForSequence(void) { OSystem::Event event; _system->delayMillis(20); - while (_system->pollEvent(event)); + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)); } } diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 056189c54e..edd5926fb2 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -27,6 +27,7 @@ #include "common/config-manager.h" #include "common/file.h" #include "common/fs.h" +#include "common/events.h" #include "common/system.h" #include "common/timer.h" @@ -519,7 +520,8 @@ void SkyEngine::delay(int32 amount) { amount = 0; do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: _keyFlags = event.kbd.flags; diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index b27bc15d0d..f8ed59a7a6 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -30,6 +30,7 @@ #include "common/config-manager.h" #include "common/endian.h" #include "common/str.h" +#include "common/events.h" #include "common/system.h" namespace Sword1 { @@ -193,13 +194,14 @@ void MoviePlayer::play(void) { } _currentFrame = 0; bool terminated = false; + Common::EventManager *eventMan = _sys->getEventManager(); while (!terminated && decodeFrame()) { processFrame(); syncFrame(); updateScreen(); _currentFrame++; OSystem::Event event; - while (_sys->pollEvent(event)) { + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_SCREEN_CHANGED: handleScreenChanged(); diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d40c76eb89..9a4b2fe46a 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -24,6 +24,7 @@ #include "common/file.h" #include "common/util.h" #include "common/savefile.h" +#include "common/events.h" #include "common/system.h" #include "gui/message.h" @@ -1042,7 +1043,8 @@ void Control::delay(uint32 msecs) { _mouseState = 0; do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: diff --git a/engines/sword1/credits.cpp b/engines/sword1/credits.cpp index a8a4446d56..06539f986f 100644 --- a/engines/sword1/credits.cpp +++ b/engines/sword1/credits.cpp @@ -32,6 +32,7 @@ #include "common/file.h" #include "common/util.h" +#include "common/events.h" #include "common/system.h" @@ -274,7 +275,8 @@ void CreditsPlayer::delay(int msecs) { OSystem::Event event; uint32 start = _system->getMillis(); do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: SwordEngine::_systemVars.engineQuit = true; diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index e830f7fd98..d9c689a769 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -28,6 +28,7 @@ #include "common/file.h" #include "common/fs.h" #include "common/timer.h" +#include "common/events.h" #include "common/system.h" #include "sword1/resman.h" @@ -705,7 +706,8 @@ void SwordEngine::delay(int32 amount) { //copied and mutilated from sky.cpp uint32 start = _system->getMillis(); do { - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: // Make sure backspace works right (this fixes a small issue on OS X) diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 1d7dd3e98e..b56d122509 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "common/config-manager.h" #include "common/file.h" +#include "common/events.h" #include "common/system.h" #include "sword2/sword2.h" @@ -408,7 +409,8 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_SCREEN_CHANGED: handleScreenChanged(); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index fb162aae62..d04cdadfa2 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/file.h" #include "common/fs.h" +#include "common/events.h" #include "common/system.h" #include "sword2/sword2.h" @@ -540,7 +541,8 @@ void Sword2Engine::parseInputEvents() { uint32 now = _system->getMillis(); - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.flags == OSystem::KBD_CTRL) { diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 960a62b840..650fc8f9f2 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "common/config-manager.h" +#include "common/events.h" #include "common/system.h" #include "sound/mididrv.h" @@ -275,7 +276,8 @@ void ToucheEngine::mainLoop() { void ToucheEngine::processEvents(bool handleKeyEvents) { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: _flagsTable[611] = 1; diff --git a/engines/touche/ui.cpp b/engines/touche/ui.cpp index 8506c1b608..2113640b4b 100644 --- a/engines/touche/ui.cpp +++ b/engines/touche/ui.cpp @@ -21,6 +21,7 @@ */ #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "common/savefile.h" @@ -377,7 +378,8 @@ void ToucheEngine::handleOptions(int forceDisplay) { } redrawMenu(&menuData); OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { const Button *button = 0; switch (event.type) { case OSystem::EVENT_QUIT: @@ -535,7 +537,8 @@ int ToucheEngine::displayQuitDialog() { bool quitLoop = false; while (!quitLoop) { OSystem::Event event; - while (_system->pollEvent(event)) { + Common::EventManager *eventMan = _system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: quitLoop = true; diff --git a/gui/newgui.cpp b/gui/newgui.cpp index cc63d39692..90a5c6d121 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -20,6 +20,7 @@ */ #include "common/stdafx.h" +#include "common/events.h" #include "common/system.h" #include "common/util.h" #include "graphics/cursorman.h" @@ -227,6 +228,8 @@ void NewGui::runLoop() { if (_useStdCursor) setupCursor(); } + + Common::EventManager *eventMan = _system->getEventManager(); while (!_dialogStack.empty() && activeDialog == getTopDialog()) { if (_needRedraw) { @@ -247,7 +250,7 @@ void NewGui::runLoop() { OSystem::Event event; uint32 time = _system->getMillis(); - while (_system->pollEvent(event)) { + while (eventMan->pollEvent(event)) { if (activeDialog != getTopDialog() && event.type != OSystem::EVENT_QUIT && event.type != OSystem::EVENT_SCREEN_CHANGED) continue; diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp index 422231828d..d332e12daf 100644 --- a/sound/softsynth/mt32.cpp +++ b/sound/softsynth/mt32.cpp @@ -29,10 +29,11 @@ #include "sound/softsynth/emumidi.h" #include "sound/mpu401.h" -#include "common/util.h" -#include "common/file.h" #include "common/config-manager.h" +#include "common/events.h" +#include "common/file.h" #include "common/system.h" +#include "common/util.h" #include "graphics/fontman.h" #include "graphics/surface.h" @@ -112,7 +113,8 @@ public: static int eatSystemEvents() { OSystem::Event event; - while (g_system->pollEvent(event)) { + Common::EventManager *eventMan = g_system->getEventManager(); + while (eventMan->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: return 1; |