diff options
author | Torbjörn Andersson | 2006-04-17 19:31:05 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-17 19:31:05 +0000 |
commit | 6e2a18e28dedee07b661341e9afdd39a942360c6 (patch) | |
tree | e9f050784d5f85ef572fa01db3cb50fd3e5a005e | |
parent | a76689ed71a91e8b638b9f073ace2f41f9e46b2b (diff) | |
download | scummvm-rg350-6e2a18e28dedee07b661341e9afdd39a942360c6.tar.gz scummvm-rg350-6e2a18e28dedee07b661341e9afdd39a942360c6.tar.bz2 scummvm-rg350-6e2a18e28dedee07b661341e9afdd39a942360c6.zip |
Rewrote the timing of the Kyra end credits so that it doesn't matter that the
variables are signed. Otherwise the credits may hang on a slow system.
svn-id: r21986
-rw-r--r-- | engines/kyra/sequences_v1.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 112944dc41..bcf33ff2ba 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -1099,9 +1099,8 @@ void KyraEngine::seq_playCredits() { OSystem::Event event; bool finished = false; int bottom = 201; - uint32 startLoop, waitTime; while (!finished) { - startLoop = _system->getMillis(); + uint32 startLoop = _system->getMillis(); if (bottom > 175) { _screen->copyRegion(8, 32, 8, 32, 312, 128, 4, 2); bottom = 0; @@ -1132,10 +1131,12 @@ void KyraEngine::seq_playCredits() { break; } } - - waitTime = startLoop + _tickLength * 5 - _system->getMillis(); - if (waitTime > 0) - _system->delayMillis(waitTime); + + uint32 now = _system->getMillis(); + uint32 nextLoop = startLoop + _tickLength * 5; + + if (nextLoop > now) + _system->delayMillis(nextLoop - now); } delete[] buffer; |