diff options
author | Johannes Schickel | 2009-06-01 23:38:56 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-01 23:38:56 +0000 |
commit | 9a0fff429f51832aafd1ad17fad94c206b68ffb5 (patch) | |
tree | 9249036044b7e4f45dbee6dbd1fe06e971fbe1c0 | |
parent | fb93062def9f8f3a67c9a8aa5715094bc67f8e8b (diff) | |
download | scummvm-rg350-9a0fff429f51832aafd1ad17fad94c206b68ffb5.tar.gz scummvm-rg350-9a0fff429f51832aafd1ad17fad94c206b68ffb5.tar.bz2 scummvm-rg350-9a0fff429f51832aafd1ad17fad94c206b68ffb5.zip |
- Remove LoLEngine::delayUntil it was identical to KyraEngine_v1 in its functionallity anyway
- Change KyraEngine_v1::delayUntil to a somewhat more LoLEngine::delayUntil like implementation
svn-id: r41117
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 15 | ||||
-rw-r--r-- | engines/kyra/lol.h | 1 |
3 files changed, 9 insertions, 19 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; } } diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 147cebdf9b..600252c164 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1792,21 +1792,6 @@ void LoLEngine::delay(uint32 millis, bool doUpdate, bool) { } } -void LoLEngine::delayUntil(uint32 timeStamp) { - const uint32 curTime = _system->getMillis(); - if (curTime < timeStamp) - return; - - uint32 del = timeStamp - curTime; - while (del && !shouldQuit()) { - updateInput(); - - uint32 step = MIN<uint32>(del, _tickLength); - _system->delayMillis(step); - del -= step; - } -} - uint8 LoLEngine::getRandomNumberSpecial() { uint8 a = _rndSpecial & 0xff; uint8 b = (_rndSpecial >> 8) & 0xff; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index ac0f9516d8..ca5510c1f8 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -1292,7 +1292,6 @@ private: // misc void delay(uint32 millis, bool doUpdate = false, bool isMainLoop = false); - void delayUntil(uint32 timeStamp); uint8 getRandomNumberSpecial(); uint8 _compassBroken; |