From 96e079a9f78d20344ff5699182194a5b35691e5e Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 8 Aug 2010 01:08:48 +0000 Subject: SCI: Directly use the new Graphics::VMDDecoder class svn-id: r51922 --- engines/sci/console.cpp | 7 +++++-- engines/sci/engine/kvideo.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 2432d84faa..fac819167b 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -51,7 +51,7 @@ #include "graphics/video/avi_decoder.h" #include "sci/video/seq_decoder.h" #ifdef ENABLE_SCI32 -#include "sci/video/vmd_decoder.h" +#include "graphics/video/coktel_decoder.h" #endif #include "common/file.h" @@ -234,7 +234,7 @@ void Console::postEnter() { videoDecoder = seqDecoder; #ifdef ENABLE_SCI32 } else if (_videoFile.hasSuffix(".vmd")) { - videoDecoder = new VMDDecoder(g_system->getMixer()); + videoDecoder = new Graphics::VMDDecoder(g_system->getMixer()); #endif } else if (_videoFile.hasSuffix(".avi")) { videoDecoder = new Graphics::AviDecoder(g_system->getMixer()); @@ -245,6 +245,9 @@ void Console::postEnter() { uint16 y = (g_system->getHeight() - videoDecoder->getHeight()) / 2; bool skipVideo = false; + if (videoDecoder->hasDirtyPalette()) + videoDecoder->setSystemPalette(); + while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) { if (videoDecoder->needsUpdate()) { Graphics::Surface *frame = videoDecoder->decodeNextFrame(); diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 3ad2d95f58..ac6cfb6835 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -34,7 +34,7 @@ #include "graphics/video/qt_decoder.h" #include "sci/video/seq_decoder.h" #ifdef ENABLE_SCI32 -#include "sci/video/vmd_decoder.h" +#include "graphics/video/coktel_decoder.h" #endif namespace Sci { @@ -60,6 +60,9 @@ void playVideo(Graphics::VideoDecoder *videoDecoder) { uint16 y = (screenHeight - height) / 2; bool skipVideo = false; + if (videoDecoder->hasDirtyPalette()) + videoDecoder->setSystemPalette(); + while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) { if (videoDecoder->needsUpdate()) { Graphics::Surface *frame = videoDecoder->decodeNextFrame(); @@ -203,7 +206,7 @@ reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv) { if (argv[2] != NULL_REG) warning("kPlayVMD: third parameter isn't 0 (it's %04x:%04x - %s)", PRINT_REG(argv[2]), s->_segMan->getObjectName(argv[2])); - videoDecoder = new VMDDecoder(g_system->getMixer()); + videoDecoder = new Graphics::VMDDecoder(g_system->getMixer()); if (!videoDecoder->loadFile(fileName)) { warning("Could not open VMD %s", fileName.c_str()); -- cgit v1.2.3