diff options
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 5 | ||||
-rw-r--r-- | engines/sci/graphics/gui32.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/gui32.h | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 11f03348c7..464c460621 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1070,7 +1070,10 @@ reg_t kShakeScreen(EngineState *s, int argc, reg_t *argv) { int16 shakeCount = (argc > 0) ? argv[0].toUint16() : 1; int16 directions = (argc > 1) ? argv[1].toUint16() : 1; - s->_gui->shakeScreen(shakeCount, directions); + if (s->_gui) + s->_gui->shakeScreen(shakeCount, directions); + else + s->_gui32->shakeScreen(shakeCount, directions); return s->r_acc; } diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp index 9220e83a2b..e517496ef0 100644 --- a/engines/sci/graphics/gui32.cpp +++ b/engines/sci/graphics/gui32.cpp @@ -75,6 +75,20 @@ void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *tex *textHeight = 0; } +void SciGui32::shakeScreen(uint16 shakeCount, uint16 directions) { + while (shakeCount--) { + if (directions & SCI_SHAKE_DIRECTION_VERTICAL) + _screen->setVerticalShakePos(10); + // TODO: horizontal shakes + g_system->updateScreen(); + g_system->delayMillis(50); + if (directions & SCI_SHAKE_DIRECTION_VERTICAL) + _screen->setVerticalShakePos(0); + g_system->updateScreen(); + g_system->delayMillis(50); + } +} + uint16 SciGui32::onControl(byte screenMask, Common::Rect rect) { Common::Rect adjustedRect = rect; uint16 result; diff --git a/engines/sci/graphics/gui32.h b/engines/sci/graphics/gui32.h index 6098606a35..84fe7fef74 100644 --- a/engines/sci/graphics/gui32.h +++ b/engines/sci/graphics/gui32.h @@ -46,6 +46,8 @@ public: void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight); + void shakeScreen(uint16 shakeCount, uint16 directions); + uint16 onControl(byte screenMask, Common::Rect rect); void setNowSeen(reg_t objectReference); bool canBeHere(reg_t curObject, reg_t listReference); |