diff options
author | Martin Kiewitz | 2014-11-09 17:33:17 +0100 |
---|---|---|
committer | Martin Kiewitz | 2014-11-09 17:33:17 +0100 |
commit | 5594feff2a7a209d62b5ecfba02262680fd27d97 (patch) | |
tree | e5befdb6e5e33f3c9ec91402eacf71742ea978c9 | |
parent | 72e6a9eeab1082892e5d77fabc4f0b50f839615a (diff) | |
download | scummvm-rg350-5594feff2a7a209d62b5ecfba02262680fd27d97.tar.gz scummvm-rg350-5594feff2a7a209d62b5ecfba02262680fd27d97.tar.bz2 scummvm-rg350-5594feff2a7a209d62b5ecfba02262680fd27d97.zip |
SCI: Phantasmagoria actually outputs 630x450 now
clipping of video output was required
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 25 |
2 files changed, 24 insertions, 11 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index fafc734895..ccc362dc37 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -524,6 +524,10 @@ void GfxFrameout::showVideo() { RobotDecoder *videoDecoder = g_sci->_robotDecoder; uint16 x = videoDecoder->getPos().x; uint16 y = videoDecoder->getPos().y; + uint16 screenWidth = _screen->getWidth(); + uint16 screenHeight = _screen->getHeight(); + uint16 outputWidth; + uint16 outputHeight; if (videoDecoder->hasDirtyPalette()) g_system->getPaletteManager()->setPalette(videoDecoder->getPalette(), 0, 256); @@ -532,7 +536,11 @@ void GfxFrameout::showVideo() { if (videoDecoder->needsUpdate()) { const Graphics::Surface *frame = videoDecoder->decodeNextFrame(); if (frame) { - g_system->copyRectToScreen(frame->getPixels(), frame->pitch, x, y, frame->w, frame->h); + // We need to clip here + // At least Phantasmagoria shows a 640x390 video on a 630x450 screen during the intro + outputWidth = frame->w > screenWidth ? screenWidth : frame->w; + outputHeight = frame->h > screenHeight ? screenHeight : frame->h; + g_system->copyRectToScreen(frame->getPixels(), frame->pitch, x, y, outputWidth, outputHeight); if (videoDecoder->hasDirtyPalette()) g_system->getPaletteManager()->setPalette(videoDecoder->getPalette(), 0, 256); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 594c4b3442..8b0e76332f 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -43,6 +43,8 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _scriptHeight = 200; _width = 0; _height = 0; + _displayWidth = 0; + _displayHeight = 0; // King's Quest 6 and Gabriel Knight 1 have hires content, gk1/cd was able // to provide that under DOS as well, but as gk1/floppy does support @@ -93,19 +95,20 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { } #endif -#ifdef ENABLE_SCI32 - // Phantasmagoria 1 sets a window area of 630x450 - //if (g_sci->getGameId() == GID_PHANTASMAGORIA) { - // _width = 630; - // _height = 450; - //} -#endif - if (_resMan->detectHires()) { _scriptWidth = 640; _scriptHeight = 480; } +#ifdef ENABLE_SCI32 + // Phantasmagoria 1 effectively outputs 630x450 + // Coordinate translation has to use this resolution as well + if (g_sci->getGameId() == GID_PHANTASMAGORIA) { + _width = 630; + _height = 450; + } +#endif + // if not yet set, set those to script-width/height if (!_width) _width = _scriptWidth; @@ -152,8 +155,10 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _upscaledWidthMapping[i] = i * 2; break; default: - _displayWidth = _width; - _displayHeight = _height; + if (!_displayWidth) + _displayWidth = _width; + if (!_displayHeight) + _displayHeight = _height; memset(&_upscaledHeightMapping, 0, sizeof(_upscaledHeightMapping) ); memset(&_upscaledWidthMapping, 0, sizeof(_upscaledWidthMapping) ); break; |