aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sequences_v1.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-05-08 15:40:30 +0000
committerTorbjörn Andersson2006-05-08 15:40:30 +0000
commit575eb8b775f3d5a0a55a5e7ce41e0f0dd0988807 (patch)
tree0cc77e1a8e48cb90bff26a314fb5fb9ff21ea4cb /engines/kyra/sequences_v1.cpp
parent73f0a23beecd52888b3c692acd0ff68a83ad3828 (diff)
downloadscummvm-rg350-575eb8b775f3d5a0a55a5e7ce41e0f0dd0988807.tar.gz
scummvm-rg350-575eb8b775f3d5a0a55a5e7ce41e0f0dd0988807.tar.bz2
scummvm-rg350-575eb8b775f3d5a0a55a5e7ce41e0f0dd0988807.zip
Replaced a bunch of delay loops with a new delayUntil() function. Now all of
them will at least sleep if the remaining delay is at least 10 ms. (Personally, I don't like the idea of busy-waiting even 9 ms, but now that it's in its own function, it becomes much easier if we want to change that behaviour. There are still plenty of custom delay loops left, though.) svn-id: r22393
Diffstat (limited to 'engines/kyra/sequences_v1.cpp')
-rw-r--r--engines/kyra/sequences_v1.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index 594198582e..71378513db 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -948,10 +948,10 @@ int KyraEngine::seq_playEnd() {
_finalA->open("finald.wsa", 1, 0);
_finalA->_x = _finalA->_y = 8;
_finalA->_drawPage = 0;
- while (_system->getMillis() < nextTime) {}
+ delayUntil(nextTime);
snd_playSoundEffect(0x40);
for (int i = 0; i < 22; ++i) {
- while (_system->getMillis() < nextTime) {}
+ delayUntil(nextTime);
if (i == 4) {
snd_playSoundEffect(0x3E);
} else if (i == 20) {
@@ -1292,7 +1292,7 @@ int KyraEngine::handleMalcolmFlag() {
timer2 = _system->getMillis() + 4 * _tickLength;
_finalC->displayFrame(i);
_screen->updateScreen();
- while (_system->getMillis() < timer2) {}
+ delayUntil(timer2);
}
snd_playWanderScoreViaMap(51, 1);
delay(60 * _tickLength);
@@ -1496,14 +1496,14 @@ int KyraEngine::handleBeadState() {
nextRun = _system->getMillis() + _tickLength;
_finalB->displayFrame(i);
_screen->updateScreen();
- while (_system->getMillis() < nextRun) {}
+ delayUntil(nextRun);
}
snd_playSoundEffect(0x0D);
for (int i = 7; i >= 0; --i) {
nextRun = _system->getMillis() + _tickLength;
_finalB->displayFrame(i);
_screen->updateScreen();
- while (_system->getMillis() < nextRun) {}
+ delayUntil(nextRun);
}
initBeadState(beadState1.x, beadState1.y, 63, 60, 6, &beadState2);
} else {