aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-11 08:52:23 +0000
committerMartin Kiewitz2009-10-11 08:52:23 +0000
commit0b1a8dea2deaa996b7229f637c0c9795443d4301 (patch)
tree5f0d5c8b21ab7505cf382982e8b96f6ba1096284 /engines/sci/gui
parent67c7d49729da0aecc8d308d731e8323110afd1c5 (diff)
downloadscummvm-rg350-0b1a8dea2deaa996b7229f637c0c9795443d4301.tar.gz
scummvm-rg350-0b1a8dea2deaa996b7229f637c0c9795443d4301.tar.bz2
scummvm-rg350-0b1a8dea2deaa996b7229f637c0c9795443d4301.zip
SCI/newgui: kShakeScreen partially implemented
svn-id: r44897
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp14
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_helpers.h3
-rw-r--r--engines/sci/gui/gui_screen.cpp4
-rw-r--r--engines/sci/gui/gui_screen.h2
5 files changed, 25 insertions, 0 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 5cd5ee5119..914ee9ddcc 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -397,6 +397,20 @@ void SciGui::paletteAnimate(int fromColor, int toColor, int speed) {
_palette->animate(fromColor, toColor, speed);
}
+void SciGui::shakeScreen(uint16 shakeCount, uint16 directions) {
+ while (shakeCount--) {
+ if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
+ _screen->setVerticalShakePos(10);
+ // TODO: horizontal shakes
+ g_system->updateScreen();
+ wait(3);
+ if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
+ _screen->setVerticalShakePos(0);
+ g_system->updateScreen();
+ wait(3);
+ }
+}
+
uint16 SciGui::onControl(byte screenMask, Common::Rect rect) {
GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
uint16 result;
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 246bb1d167..5f44184855 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -85,6 +85,8 @@ public:
virtual void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);
virtual void paletteAnimate(int fromColor, int toColor, int speed);
+ virtual void shakeScreen(uint16 shakeCount, uint16 directions);
+
virtual uint16 onControl(byte screenMask, Common::Rect rect);
virtual void animate(reg_t listReference, bool cycle, int argc, reg_t *argv);
virtual void addToPicList(reg_t listReference, int argc, reg_t *argv);
diff --git a/engines/sci/gui/gui_helpers.h b/engines/sci/gui/gui_helpers.h
index 294b0ebcc2..cc4ac961e6 100644
--- a/engines/sci/gui/gui_helpers.h
+++ b/engines/sci/gui/gui_helpers.h
@@ -32,6 +32,9 @@
namespace Sci {
+#define SCI_SHAKE_DIRECTION_VERTICAL 1
+#define SCI_SHAKE_DIRECTION_HORIZONTAL 2
+
typedef int GuiResourceId; // is a resource-number and -1 means no parameter given
typedef reg_t GuiMemoryHandle;
typedef int16 GuiViewLoopNo;
diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp
index 0e0a1ed170..606ad2ef09 100644
--- a/engines/sci/gui/gui_screen.cpp
+++ b/engines/sci/gui/gui_screen.cpp
@@ -215,6 +215,10 @@ void SciGuiScreen::setPalette(GuiPalette*pal) {
g_system->setPalette(bpal, 0, 256);
}
+void SciGuiScreen::setVerticalShakePos(uint16 shakePos) {
+ g_system->setShakePos(shakePos);
+}
+
// Currently not really done, its supposed to be possible to only dither _visualScreen
void SciGuiScreen::dither(bool addToFlag) {
int y, x;
diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h
index 5d46fd0f6e..daafdc31ff 100644
--- a/engines/sci/gui/gui_screen.h
+++ b/engines/sci/gui/gui_screen.h
@@ -60,6 +60,8 @@ public:
void setPalette(GuiPalette*pal);
+ void setVerticalShakePos(uint16 shakePos);
+
void dither(bool addToFlag);
void unditherSetState(bool flag);
int16 *unditherGetMemorial();