aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
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/engine
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/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp38
1 files changed, 3 insertions, 35 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index c7f7e123d7..5f3d56d250 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1544,43 +1544,11 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
-#define SHAKE_DOWN 1
-#define SHAKE_RIGHT 2
-
reg_t kShakeScreen(EngineState *s, int argc, reg_t *argv) {
- int shakes = (argc > 0) ? argv[0].toSint16() : 1;
- int directions = (argc > 1) ? argv[1].toSint16() : 1;
- gfx_pixmap_t *screen = gfxop_grab_pixmap(s->gfx_state, gfx_rect(0, 0, 320, 200));
- int i;
-
- if (directions & ~3)
- debugC(2, kDebugLevelGraphics, "ShakeScreen(): Direction bits are %x (unknown)\n", directions);
-
- gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
-
- for (i = 0; i < shakes; i++) {
- int shake_down = (directions & SHAKE_DOWN) ? 10 : 0;
- int shake_right = (directions & SHAKE_RIGHT) ? 10 : 0;
-
- if (directions & SHAKE_DOWN)
- gfxop_draw_box(s->gfx_state, gfx_rect(0, 0, 320, 10), s->ega_colors[0], s->ega_colors[0], GFX_BOX_SHADE_FLAT);
+ int16 shakeCount = (argc > 0) ? argv[0].toUint16() : 1;
+ int16 directions = (argc > 1) ? argv[1].toUint16() : 1;
- if (directions & SHAKE_RIGHT)
- gfxop_draw_box(s->gfx_state, gfx_rect(0, 0, 10, 200), s->ega_colors[0], s->ega_colors[0], GFX_BOX_SHADE_FLAT);
-
- gfxop_draw_pixmap(s->gfx_state, screen, gfx_rect(0, 0, 320 - shake_right, 200 - shake_down),
- Common::Point(shake_right, shake_down));
-
- gfxop_update(s->gfx_state);
- gfxop_sleep(s->gfx_state, 50);
-
- gfxop_draw_pixmap(s->gfx_state, screen, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
- gfxop_update(s->gfx_state);
- gfxop_sleep(s->gfx_state, 50);
- }
-
- gfxop_free_pixmap(s->gfx_state, screen);
- gfxop_update(s->gfx_state);
+ s->_gui->shakeScreen(shakeCount, directions);
return s->r_acc;
}