aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-29 21:51:21 +0000
committerMartin Kiewitz2010-01-29 21:51:21 +0000
commitc6e095715c8901799aa384d2076742a2bd2e00f6 (patch)
tree192f5017e6db3095cc71b108a507de44f8152181
parent1bc1ff1705dd446538fb45744d3134ee35486e04 (diff)
downloadscummvm-rg350-c6e095715c8901799aa384d2076742a2bd2e00f6.tar.gz
scummvm-rg350-c6e095715c8901799aa384d2076742a2bd2e00f6.tar.bz2
scummvm-rg350-c6e095715c8901799aa384d2076742a2bd2e00f6.zip
SCI: adding shakeScreen() for gui32 for lsl6
svn-id: r47681
-rw-r--r--engines/sci/engine/kgraphics.cpp5
-rw-r--r--engines/sci/graphics/gui32.cpp14
-rw-r--r--engines/sci/graphics/gui32.h2
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);