From 5e68c1f4a0482a67a01d08248a0e767268c4b781 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Mon, 25 May 2009 11:14:42 +0000 Subject: SCI: Force movie palettes (KQ6). svn-id: r40883 --- engines/sci/engine/kernel.cpp | 2 +- engines/sci/engine/kgraphics.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 98392803a4..751ea7e6f5 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -211,7 +211,7 @@ SciKernelFunction kfunct_mappers[] = { DEFUN("ResCheck", kResCheck, "iii*"), DEFUN("SetQuitStr", kSetQuitStr, "r"), DEFUN("ShowMovie", kShowMovie, "ri"), - DEFUN("SetVideoMode", kSetVideoMode, ".*"), + DEFUN("SetVideoMode", kSetVideoMode, "i"), // Special and NOP stuff {KF_NEW, NULL, k_Unknown, NULL}, diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 5c2fe7b642..45164db13d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -3336,6 +3336,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) { const char *filename = kernel_dereference_char_pointer(s, argv[0], 0); int framerate = UKPV(1); // FIXME: verify + int frameNr = 0; SeqDecoder seq; if (!seq.loadFile(filename)) { @@ -3346,6 +3347,10 @@ reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) { bool play = true; while (play) { gfx_pixmap_t *pixmap = seq.getFrame(play); + + if (frameNr++ == 0) + pixmap->palette->forceInto(s->gfx_state->driver->mode->palette); + gfx_xlate_pixmap(pixmap, s->gfx_state->driver->mode, GFX_XLATE_FILTER_NONE); GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, pixmap, gfx_rect(0, 0, 320, 200), Common::Point(pixmap->xoffset, pixmap->yoffset))); gfxop_update_box(s->gfx_state, gfx_rect(0, 0, 320, 200)); @@ -3383,11 +3388,8 @@ reg_t kSetVideoMode(EngineState *s, int funct_nr, int argc, reg_t *argv) { // (320x240 resolution, although the intro in KQ6 is 320x200). // Refer to http://en.wikipedia.org/wiki/Mode_X - //warning("STUB: SetVideoMode %d", UKPV(0)); + warning("STUB: SetVideoMode %d", UKPV(0)); - // We (ab)use this kernel function to free tagged resources when the - // intro of KQ6 starts. This fixes some palette issues in the intro. - s->gfx_state->gfxResMan->freeTaggedResources(); return s->r_acc; } -- cgit v1.2.3