From c88d30d8d3bbe02eca5b09ae9061ade3184d96ef Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Mon, 27 Feb 2017 21:59:11 +0100 Subject: ADL: Allow smaller delays --- engines/adl/adl.cpp | 8 +++++--- 1 file 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(); } } -- cgit v1.2.3