aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorWalter van Niftrik2009-05-25 11:14:42 +0000
committerWalter van Niftrik2009-05-25 11:14:42 +0000
commit5e68c1f4a0482a67a01d08248a0e767268c4b781 (patch)
treef71a2bc3bc1e34619827c7a152507396477d02d8 /engines/sci/engine
parentffcf4173f3d0e079f458f140fdb241b347a93af6 (diff)
downloadscummvm-rg350-5e68c1f4a0482a67a01d08248a0e767268c4b781.tar.gz
scummvm-rg350-5e68c1f4a0482a67a01d08248a0e767268c4b781.tar.bz2
scummvm-rg350-5e68c1f4a0482a67a01d08248a0e767268c4b781.zip
SCI: Force movie palettes (KQ6).
svn-id: r40883
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel.cpp2
-rw-r--r--engines/sci/engine/kgraphics.cpp10
2 files changed, 7 insertions, 5 deletions
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;
}