From 72a9706950675cc3fd04e39d0f842193d66a5f9e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 8 Feb 2011 19:50:45 +0000 Subject: SCI: Some work on robot videos - The size of the videos is now calculated when they are loaded (this helps remove some nasty hacks and constant memory reallocations and simplifies the code) - Some work on frame placement (e.g. in robot 1305, Phantasmagoria) svn-id: r55830 --- engines/sci/engine/kvideo.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'engines/sci/engine/kvideo.cpp') diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 1ed3a713b0..e905764d03 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -51,15 +51,12 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { uint16 screenWidth = g_system->getWidth(); uint16 screenHeight = g_system->getHeight(); bool isVMD = videoState.fileName.hasSuffix(".vmd"); - bool isRobot = videoState.fileName.hasSuffix(".rbt"); - - if (!isRobot) { - if (screenWidth == 640 && width <= 320 && height <= 240 && ((videoState.flags & kDoubled) || !isVMD)) { - width *= 2; - height *= 2; - pitch *= 2; - scaleBuffer = new byte[width * height * bytesPerPixel]; - } + + if (screenWidth == 640 && width <= 320 && height <= 240 && ((videoState.flags & kDoubled) || !isVMD)) { + width *= 2; + height *= 2; + pitch *= 2; + scaleBuffer = new byte[width * height * bytesPerPixel]; } uint16 x, y; @@ -76,13 +73,8 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { y = (screenHeight - height) / 2; } } else { - if (!isRobot) { x = (screenWidth - width) / 2; y = (screenHeight - height) / 2; - } else { - x = 0; - y = 0; - } } bool skipVideo = false; @@ -99,10 +91,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { g_sci->_gfxScreen->scale2x((byte *)frame->pixels, scaleBuffer, videoDecoder->getWidth(), videoDecoder->getHeight(), bytesPerPixel); g_system->copyRectToScreen(scaleBuffer, pitch, x, y, width, height); } else { - if (!isRobot) - g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, width, height); - else // Frames in robot videos have different dimensions - g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h); + g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, width, height); } if (videoDecoder->hasDirtyPalette()) -- cgit v1.2.3