aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/console.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-11-11 19:22:56 +0000
committerFilippos Karapetis2010-11-11 19:22:56 +0000
commit8b14137c07bceda262e5423aadea830c761dc2bc (patch)
treee3feefa96d9fd5a55b6ac765dadc024a17edd33d /engines/sci/console.cpp
parentc624202c39215ea4b555567ee45abe01cac92133 (diff)
downloadscummvm-rg350-8b14137c07bceda262e5423aadea830c761dc2bc.tar.gz
scummvm-rg350-8b14137c07bceda262e5423aadea830c761dc2bc.tar.bz2
scummvm-rg350-8b14137c07bceda262e5423aadea830c761dc2bc.zip
SCI: Some video related changes
- Now playVideo() is used when playing videos from the console (reducing code duplication) - Added support for 16bpp scaling in scale2x, so that the 16-bit color Duck videos are scaled correctly svn-id: r54210
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r--engines/sci/console.cpp33
1 files changed, 3 insertions, 30 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index c5b8d2ae0d..6ddc1afe0a 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -226,6 +226,8 @@ void Console::preEnter() {
_engine->pauseEngine(true);
}
+extern void playVideo(Graphics::VideoDecoder *videoDecoder);
+
void Console::postEnter() {
if (!_videoFile.empty()) {
Graphics::VideoDecoder *videoDecoder = 0;
@@ -270,36 +272,7 @@ void Console::postEnter() {
}
#endif
- uint16 x = (g_system->getWidth() - videoDecoder->getWidth()) / 2;
- 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();
- if (frame) {
- g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h);
-
- if (videoDecoder->hasDirtyPalette())
- videoDecoder->setSystemPalette();
-
- g_system->updateScreen();
- }
- }
-
- Common::Event event;
- while (g_system->getEventManager()->pollEvent(event)) {
- if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP)
- skipVideo = true;
- }
-
- g_system->delayMillis(10);
- }
-
- delete videoDecoder;
+ playVideo(videoDecoder);
#ifdef ENABLE_SCI32
// Switch back to 8bpp if we played a duck video