aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-07-23 00:01:40 -0500
committerFilippos Karapetis2018-12-05 01:02:26 +0200
commit00552e62c398acf787fe57fa2aa209ea933dac43 (patch)
tree0894d85acbf6d5c5b474d4fed490d08a418d41a0
parent098d4bce5950b129b42465e09849a23c13edf63b (diff)
downloadscummvm-rg350-00552e62c398acf787fe57fa2aa209ea933dac43.tar.gz
scummvm-rg350-00552e62c398acf787fe57fa2aa209ea933dac43.tar.bz2
scummvm-rg350-00552e62c398acf787fe57fa2aa209ea933dac43.zip
SCI: Stop sleeping if the game is trying to quit
This applies to any sleep, but is particularly noticeable in games that send SysEx messages to MT-32, which add delays by sleeping in order to avoid buffer overflows in the device firmware.
-rw-r--r--engines/sci/sci.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index c920403dcc..b2a914b9c3 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -859,6 +859,11 @@ void SciEngine::sleep(uint32 msecs) {
// let backend process events and update the screen
_eventMan->getSciEvent(kSciEventPeek);
+ // There is no point in waiting any more if we are just waiting to quit
+ if (g_engine->shouldQuit()) {
+ return;
+ }
+
#ifdef ENABLE_SCI32
// If a game is in a wait loop, kFrameOut is not called, but mouse
// movement is still occurring and the screen needs to be updated to