Skip to content

Commit

Permalink
ADL: Allow smaller delays
Browse files Browse the repository at this point in the history
  • Loading branch information
waltervn committed Mar 5, 2017
1 parent 6bd7ca7 commit c88d30d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engines/adl/adl.cpp
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit c88d30d

Please sign in to comment.