diff options
author | Gregory Montoir | 2007-04-01 17:36:13 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-04-01 17:36:13 +0000 |
commit | 5aca9dce8c6cce89df3147a6f942620155010c8d (patch) | |
tree | 28dbee0d5addb8e49c839e5eba11733b0fe26fa5 /engines/kyra | |
parent | 852971cfe62b59ff1f2e7451402a34fa6f8db958 (diff) | |
download | scummvm-rg350-5aca9dce8c6cce89df3147a6f942620155010c8d.tar.gz scummvm-rg350-5aca9dce8c6cce89df3147a6f942620155010c8d.tar.bz2 scummvm-rg350-5aca9dce8c6cce89df3147a6f942620155010c8d.zip |
added the instance of EventManager returned by OSystem::getEventManager as a member of the Engine base class. This allows to simply the code a bit and should more efficient too (ie. less virtual function chain calls, obj->getA()->getB()). Also updated several engines to make use of it.
svn-id: r26357
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/gui.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/kyra.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/sequences_v1.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/text.cpp | 3 |
4 files changed, 7 insertions, 13 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 3573157277..c9b8b045c2 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -811,8 +811,7 @@ void KyraEngine::gui_getInput() { uint32 now = _system->getMillis(); _mouseWheel = 0; - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: quitGame(); @@ -1487,8 +1486,7 @@ void KyraEngine::gui_updateMainMenuAnimation() { bool KyraEngine::gui_mainMenuGetInput() { Common::Event event; - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: quitGame(); diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 6b3a2dc3a1..aba461a231 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -608,8 +608,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { uint32 start = _system->getMillis(); do { - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' && @@ -690,7 +689,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { } Common::Point KyraEngine::getMousePos() const { - Common::Point mouse = g_system->getEventManager()->getMousePos(); + Common::Point mouse = _eventMan->getMousePos(); if (_flags.useHiResOverlay) { mouse.x >>= 1; mouse.y >>= 1; @@ -702,8 +701,7 @@ void KyraEngine::waitForEvent() { bool finished = false; Common::Event event; while (!finished && !_quitFlag) { - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: finished = true; diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 7503462dd2..771949b852 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -1171,8 +1171,7 @@ void KyraEngine::seq_playCredits() { _screen->updateScreen(); } - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: finished = true; diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index 4bc9bfc629..dd536a87ae 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -118,8 +118,7 @@ void KyraEngine::waitForChatToFinish(int vocFile, int16 chatDuration, const char uint32 nextTime = loopStart + _tickLength; while (_system->getMillis() < nextTime) { - Common::EventManager *eventMan = _system->getEventManager(); - while (eventMan->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode == '.') |