aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/frameout.cpp20
-rw-r--r--engines/sci/graphics/screen.cpp19
2 files changed, 24 insertions, 15 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index f7464d460c..6b75e2c493 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1189,27 +1189,27 @@ void GfxFrameout::throttle() {
}
void GfxFrameout::shakeScreen(int16 numShakes, const ShakeDirection direction) {
- if (direction & kShakeHorizontal) {
- // Used by QFG4 room 750
- warning("TODO: Horizontal shake not implemented");
- return;
- }
-
while (numShakes--) {
if (g_engine->shouldQuit()) {
break;
}
+ int shakeXOffset = 0;
+ if (direction & kShakeHorizontal) {
+ shakeXOffset = _isHiRes ? 8 : 4;
+ }
+
+ int shakeYOffset = 0;
if (direction & kShakeVertical) {
- g_system->setShakePos(0, _isHiRes ? 8 : 4);
+ shakeYOffset = _isHiRes ? 8 : 4;
}
+ g_system->setShakePos(shakeXOffset, shakeYOffset);
+
updateScreen();
g_sci->getEngineState()->sleep(3);
- if (direction & kShakeVertical) {
- g_system->setShakePos(0, 0);
- }
+ g_system->setShakePos(0, 0);
updateScreen();
g_sci->getEngineState()->sleep(3);
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index cd81fdf36f..4bb9f5f6f6 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -604,14 +604,23 @@ void GfxScreen::setShakePos(uint16 shakeXOffset, uint16 shakeYOffset) {
void GfxScreen::kernelShakeScreen(uint16 shakeCount, uint16 directions) {
while (shakeCount--) {
- if (directions & kShakeVertical)
- setShakePos(0, 10);
- // TODO: horizontal shakes
+
+ uint16 shakeXOffset = 0;
+ if (directions & kShakeHorizontal) {
+ shakeXOffset = 10;
+ }
+
+ uint16 shakeYOffset = 0;
+ if (directions & kShakeVertical) {
+ shakeYOffset = 10;
+ }
+
+ setShakePos(shakeXOffset, shakeYOffset);
+
g_system->updateScreen();
g_sci->getEngineState()->sleep(3);
- if (directions & kShakeVertical)
- setShakePos(0, 0);
+ setShakePos(0, 0);
g_system->updateScreen();
g_sci->getEngineState()->sleep(3);