diff options
author | Walter van Niftrik | 2017-02-27 21:59:11 +0100 |
---|---|---|
committer | Walter van Niftrik | 2017-03-05 21:16:58 +0100 |
commit | c88d30d8d3bbe02eca5b09ae9061ade3184d96ef (patch) | |
tree | f961395fd2098d6c17861cf2f12e26d2f398ee65 | |
parent | 6bd7ca75f9ed6510b1a6efa82157e02364c65e50 (diff) | |
download | scummvm-rg350-c88d30d8d3bbe02eca5b09ae9061ade3184d96ef.tar.gz scummvm-rg350-c88d30d8d3bbe02eca5b09ae9061ade3184d96ef.tar.bz2 scummvm-rg350-c88d30d8d3bbe02eca5b09ae9061ade3184d96ef.zip |
ADL: Allow smaller delays
-rw-r--r-- | engines/adl/adl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 3887fa92d9..2d2bee5ec1 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -139,12 +139,14 @@ Common::String AdlEngine::getItemDescription(const Item &item) const { } void AdlEngine::delay(uint32 ms) const { - uint32 start = g_system->getMillis(); + uint32 now = g_system->getMillis(); + const uint32 end = now + ms; - while (!shouldQuit() && g_system->getMillis() - start < ms) { + while (!shouldQuit() && now < end) { Common::Event event; pollEvent(event); - g_system->delayMillis(16); + g_system->delayMillis(end - now < 16 ? end - now : 16); + now = g_system->getMillis(); } } |