diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/screen.cpp | 13 | ||||
-rw-r--r-- | engines/kyra/screen.h | 4 | ||||
-rw-r--r-- | engines/kyra/script_v1.cpp | 10 |
3 files changed, 25 insertions, 2 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index af55d6f300..5b34dbaea8 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -2094,4 +2094,17 @@ void Screen::copyBackgroundBlock2(int x) { copyBackgroundBlock(x, 4, 1); } +void Screen::shakeScreen(int times) { + debugC(9, kDebugLevelScreen, "Screen::shakeScreen(%d)", times); + + while (times--) { + // seems to be 1 line (320 pixels) offset in the original + // 4 looks more like dosbox though, maybe check this again + _system->setShakePos(4); + _system->updateScreen(); + _system->setShakePos(0); + _system->updateScreen(); + } +} + } // End of namespace Kyra diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 5b50e2e5b1..22586e4c01 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -130,7 +130,9 @@ public: static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor); uint8 *encodeShape(int x, int y, int w, int h, int flags); void copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest); - + + void shakeScreen(int times); + int getRectSize(int x, int y); void hideMouse(); void showMouse(); diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 920d730858..bc09ba707a 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -1371,7 +1371,15 @@ int KyraEngine::cmd_intPrint(ScriptState *script) { } int KyraEngine::cmd_shakeScreen(ScriptState *script) { - warning("STUB: cmd_shakeScreen"); + debugC(3, kDebugLevelScriptFuncs, "cmd_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); + int waitTicks = stackPos(1); + int times = stackPos(0); + + for (int i = 0; i < times; ++i) { + _screen->shakeScreen(1); + delay(waitTicks * _tickLength); + } + return 0; } |