diff options
Diffstat (limited to 'engines/kyra/kyra_v1.cpp')
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index a5e6503d7c..f3ba67a265 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -476,9 +476,15 @@ int KyraEngine_v1::resetGameFlag(int flag) { } void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) { - while (_system->getMillis() < timestamp && !shouldQuit()) { - if (timestamp - _system->getMillis() >= 10) - delay(10, update, isMainLoop); + const uint32 curTime = _system->getMillis(); + if (curTime > timestamp) + return; + + uint32 del = timestamp - curTime; + while (del && !shouldQuit()) { + uint32 step = MIN<uint32>(del, _tickLength); + delay(step, update, isMainLoop); + del -= step; } } |