diff options
author | Christopher Page | 2008-06-02 21:08:49 +0000 |
---|---|---|
committer | Christopher Page | 2008-06-02 21:08:49 +0000 |
commit | a338d5fdb2715a7b29ae789c632a0cfa05803079 (patch) | |
tree | b80b3e278050d5027dddd2723cf60b5108893f08 /engines/parallaction/dialogue.cpp | |
parent | 203f62ad7cfc3f931c98c8fc3ecdbb01924b896f (diff) | |
download | scummvm-rg350-a338d5fdb2715a7b29ae789c632a0cfa05803079.tar.gz scummvm-rg350-a338d5fdb2715a7b29ae789c632a0cfa05803079.tar.bz2 scummvm-rg350-a338d5fdb2715a7b29ae789c632a0cfa05803079.zip |
PARA: Got rid of calls to system->quit() so that the Parallaction engine can return to the launcher. Also fixed a couple of memory leaks.
svn-id: r32504
Diffstat (limited to 'engines/parallaction/dialogue.cpp')
-rw-r--r-- | engines/parallaction/dialogue.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 70db637699..b9dea60dc0 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -105,10 +105,8 @@ uint16 DialogueManager::askPassword() { if (g_system->getEventManager()->pollEvent(e)) { if (e.type == Common::EVENT_QUIT) { - // TODO: don't quit() here, just have caller routines to check - // on kEngineQuit and exit gracefully to allow the engine to shut down _engineFlags |= kEngineQuit; - g_system->quit(); + break; } if ((e.type == Common::EVENT_KEYDOWN) && isdigit(e.kbd.ascii)) { @@ -231,11 +229,19 @@ void DialogueManager::run() { answer = 0; displayQuestion(); + + if (_engineFlags & kEngineQuit) + return; + if (_q->_answers[0] == NULL) break; if (scumm_stricmp(_q->_answers[0]->_text, "NULL")) { if (!displayAnswers()) break; answer = getAnswer(); + + if (_engineFlags & kEngineQuit) + return; + cmdlist = &_q->_answers[answer]->_commands; } @@ -266,7 +272,7 @@ int16 DialogueManager::selectAnswer() { uint32 event; Common::Point p; - while (true) { + while (_engineFlags & kEngineQuit == 0) { _vm->_input->readInput(); _vm->_input->getCursorPos(p); |