diff options
author | Torbjörn Andersson | 2008-04-20 16:18:50 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2008-04-20 16:18:50 +0000 |
commit | 00a8c7752734350040dc8fe5e9da0b6c5cf08006 (patch) | |
tree | e301ec7718dadb0ae27f9eb71b8ee954dea95af7 /engines/made | |
parent | aef171a55679e5f785aae28f03f076ccd5eb19a7 (diff) | |
download | scummvm-rg350-00a8c7752734350040dc8fe5e9da0b6c5cf08006.tar.gz scummvm-rg350-00a8c7752734350040dc8fe5e9da0b6c5cf08006.tar.bz2 scummvm-rg350-00a8c7752734350040dc8fe5e9da0b6c5cf08006.zip |
Catch EVENT_QUIT events, too. I realize that g_system->quit() isn't the nicest
way to quit a game, but it beats not being able to quit at all.
svn-id: r31617
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/pmvplayer.cpp | 13 | ||||
-rw-r--r-- | engines/made/scriptfuncs.cpp | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp index bd5252c601..0c31c90ae7 100644 --- a/engines/made/pmvplayer.cpp +++ b/engines/made/pmvplayer.cpp @@ -127,8 +127,17 @@ void PmvPlayer::readChunk(uint32 &chunkType, uint32 &chunkSize) { void PmvPlayer::handleEvents() { Common::Event event; while (_system->getEventManager()->pollEvent(event)) { - if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) { - _abort = true; + switch (event.type) { + case Common::EVENT_KEYDOWN: + if (event.kbd.keycode == Common::KEYCODE_ESCAPE) + _abort = true; + break; + case Common::EVENT_QUIT: + // TODO: Exit more gracefully + g_system->quit(); + break; + default: + break; } } } diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index b1d528871d..8d18b76c53 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -240,6 +240,11 @@ int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) { } break; + case Common::EVENT_QUIT: + // TODO: Exit more gracefully. + g_system->quit(); + break; + default: break; |