aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/graphics/screen.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 148f2d8f37..7d8c1b1535 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3171,12 +3171,25 @@ void Screen::rectClip(int &x, int &y, int w, int h) {
void Screen::shakeScreen(int times) {
while (times--) {
+ // The original did not need an artificial delay, but we do.
+ // Or the shake will be too fast to be actually seen.
+ uint32 delayuntil = _system->getMillis() + 16;
+
// seems to be 1 line (320 pixels) offset in the original
- // 4 looks more like dosbox though, maybe check this again
- _system->setShakePos(0, 4);
+ // -4 looks more like dosbox though, maybe check this again
+ _system->setShakePos(0, -4);
_system->updateScreen();
+
+ int diff = delayuntil - _system->getMillis();
+ if (diff > 0)
+ _system->delayMillis(diff);
+ delayuntil = _system->getMillis() + 16;
_system->setShakePos(0, 0);
_system->updateScreen();
+
+ diff = delayuntil - _system->getMillis();
+ if (diff > 0)
+ _system->delayMillis(diff);
}
}