diff options
author | Nicola Mettifogo | 2007-02-17 15:57:49 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-02-17 15:57:49 +0000 |
commit | e29ddfe1569fdfc65cf69bf1e4bc333db6e8c0f3 (patch) | |
tree | a60a1a189f79b591b6bf5cbb96eb418cfee93ca5 | |
parent | f33da9e4125ef4c570e15cc4c5cae38a7a238eea (diff) | |
download | scummvm-rg350-e29ddfe1569fdfc65cf69bf1e4bc333db6e8c0f3.tar.gz scummvm-rg350-e29ddfe1569fdfc65cf69bf1e4bc333db6e8c0f3.tar.bz2 scummvm-rg350-e29ddfe1569fdfc65cf69bf1e4bc333db6e8c0f3.zip |
more conventional termination handling. Event loops are going to get merged soon, so there are FIXME remainders around there.
svn-id: r25655
-rw-r--r-- | engines/parallaction/dialogue.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index e804c744f8..2644c2145a 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -457,8 +457,10 @@ 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 (e.type != OSystem::EVENT_KEYDOWN) continue; + if (e.type != OSystem::EVENT_QUIT) g_system->quit(); if (!isdigit(e.kbd.ascii)) continue; password[passwordLen] = e.kbd.ascii; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 6f72f7847e..29bd30ba93 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -316,8 +316,10 @@ void Parallaction::initGlobals() { initTable("global.tab", _globalTable); } -// -// broken input management +// FIXME: the engine has 3 event loops. The following routine hosts the main one, +// and it's called from 8 different places in the code. There exist 2 more specialised +// loops which could possibly be merged into this one with some effort in changing +// caller code, i.e. adding condition checks. // uint16 Parallaction::updateInput() { @@ -330,7 +332,6 @@ uint16 Parallaction::updateInput() { switch (e.type) { case OSystem::EVENT_KEYDOWN: - if (e.kbd.ascii == ' ') KeyDown = kEvQuitGame; if (e.kbd.ascii == 'l') KeyDown = kEvLoadGame; if (e.kbd.ascii == 's') KeyDown = kEvSaveGame; break; @@ -357,7 +358,7 @@ uint16 Parallaction::updateInput() { break; case OSystem::EVENT_QUIT: - _engineFlags |= kEngineQuit; + _system->quit(); break; default: @@ -371,21 +372,23 @@ uint16 Parallaction::updateInput() { } - +// FIXME: see comment for updateInput() void waitUntilLeftClick() { OSystem::Event e; for (;;) { g_system->pollEvent(e); - g_system->delayMillis(10); - if (e.type == OSystem::EVENT_LBUTTONUP) - break; - if (e.type == OSystem::EVENT_QUIT) { - _engineFlags |= kEngineQuit; - break; - } + if (e.type == OSystem::EVENT_LBUTTONUP) + break; + + if (e.type == OSystem::EVENT_QUIT) { + g_system->quit(); + break; + } + + g_system->delayMillis(10); } |