From 76ad23ddbd90fb1cb8bb3ee8a884d763e1186c69 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 18 May 2009 09:07:31 +0000 Subject: Added a workaround for LSL6, thanks to waltervn's comments svn-id: r40677 --- engines/sci/engine/kgraphics.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 5158361dc6..3e3e65836d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -2378,12 +2378,19 @@ reg_t kSetPort(EngineState *s, int funct_nr, int argc, reg_t *argv) { return s->r_acc; } - s->gfx_state->pic_port_bounds = gfx_rect(UKPV(5), UKPV(4), - UKPV(3), UKPV(2)); - - // FIXME: Should really only invalidate all loaded pic resources here; - // this is overkill - s->gfx_state->gfxResMan->freeAllResources(); + // LSL6 calls kSetPort to extend the screen to draw the GUI. If we free all resources + // here, the background picture is freed too, and this makes everything a big mess. + // FIXME/TODO: This code really needs to be rewritten to conform to the original behavior + if (s->_gameName != "LSL6") { + s->gfx_state->pic_port_bounds = gfx_rect(UKPV(5), UKPV(4), UKPV(3), UKPV(2)); + + // FIXME: Should really only invalidate all loaded pic resources here; + // this is overkill + s->gfx_state->gfxResMan->freeAllResources(); + } else { + // WORKAROUND for LSL6 + printf("SetPort case 6 called in LSL6. Origin: %d, %d - Clip rect: %d, %d, %d, %d\n", SKPV(0), SKPV(1), UKPV(2), UKPV(3), UKPV(4), UKPV(5)); + } break; } -- cgit v1.2.3