aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorWalter van Niftrik2009-05-17 13:37:54 +0000
committerWalter van Niftrik2009-05-17 13:37:54 +0000
commit7c5fbf83f5c72d797aaf490366252314173d4036 (patch)
treeef208c80e91e8623e0ad70bfb3f7bf356286cda1 /engines/sci/engine
parent0ceb92871b404ff598fdb10a0612c9524387fe08 (diff)
downloadscummvm-rg350-7c5fbf83f5c72d797aaf490366252314173d4036.tar.gz
scummvm-rg350-7c5fbf83f5c72d797aaf490366252314173d4036.tar.bz2
scummvm-rg350-7c5fbf83f5c72d797aaf490366252314173d4036.zip
SCI: LSL6 invalid selector workaround is now always active, not just at
startup. Added support for mirrored pic drawing. svn-id: r40648
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp12
-rw-r--r--engines/sci/engine/vm.cpp4
2 files changed, 11 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 59c9eba0c3..602a5e8bbf 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -972,16 +972,22 @@ void _k_view_list_free_backgrounds(EngineState *s, ViewObject *list, int list_nr
int sci01_priority_table_flags = 0;
+#define K_DRAWPIC_FLAG_MIRRORED (1 << 14)
+
reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
drawn_pic_t dp;
int add_to_pic = 1;
gfx_color_t transparent = s->wm_port->_bgcolor;
+ int picFlags = DRAWPIC01_FLAG_FILL_NORMALLY;
CHECK_THIS_KERNEL_FUNCTION;
dp.nr = SKPV(0);
dp.palette = SKPV_OR_ALT(3, 0);
+ if ((argc > 1) && (UKPV(1) & K_DRAWPIC_FLAG_MIRRORED))
+ picFlags |= DRAWPIC1_FLAG_MIRRORED;
+
if (s->flags & GF_SCI0_OLDGFXFUNCS) {
if (!SKPV_OR_ALT(2, 0))
add_to_pic = 0;
@@ -1002,11 +1008,11 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (add_to_pic) {
s->_pics.push_back(dp);
- GFX_ASSERT(gfxop_add_to_pic(s->gfx_state, dp.nr, 1, dp.palette));
+ GFX_ASSERT(gfxop_add_to_pic(s->gfx_state, dp.nr, picFlags, dp.palette));
} else {
s->_pics.clear();
s->_pics.push_back(dp);
- GFX_ASSERT(gfxop_new_pic(s->gfx_state, dp.nr, 1, dp.palette));
+ GFX_ASSERT(gfxop_new_pic(s->gfx_state, dp.nr, picFlags, dp.palette));
}
delete s->wm_port;
@@ -1040,7 +1046,7 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->pic_priority_table = NULL;
if (argc > 1)
- s->pic_animate = SKPV(1); // The animation used during kAnimate() later on
+ s->pic_animate = SKPV(1) & 0xff; // The animation used during kAnimate() later on
s->dyn_views = NULL;
s->drop_views = NULL;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 75e31261b1..409f7527e4 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -371,8 +371,8 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
// WORKAROUND: LSL6 tries to access the invalid 'keep' selector of the game object.
// FIXME: Find out if this is a game bug.
- if ((s->_gameName == "LSL6") && (s->currentRoomNumber() == 100)) {
- debug("LSL6 room 100 detected, continuing...");
+ if ((s->_gameName == "LSL6") && (selector == 0x18c)) {
+ debug("LSL6 detected, continuing...");
break;
}