From 3b6f6bfbd84dbdd6f3a134ecce470835bc6ba446 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 5 Feb 2010 04:16:12 +0000 Subject: SCI2 Windows games are scaled from 320x200 to 640x480, not 640x400. Aspect ratio correction will eventually have to be applied. This fixes a possible segfault when playing the credits video in GK1 (which is 640x480). svn-id: r47895 --- engines/sci/graphics/screen.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 04184cee09..207c459687 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -37,15 +37,22 @@ GfxScreen::GfxScreen(ResourceManager *resMan, int16 width, int16 height, bool up _resMan(resMan), _width(width), _height(height), _upscaledHires(upscaledHires) { _pixels = _width * _height; - _displayWidth = _width; _displayHeight = _height; + if (_upscaledHires) { _displayWidth *= 2; _displayHeight *= 2; + +#ifdef ENABLE_SCI32 + // SCI32 also corrects the aspect ratio when upscaling the resolution. + // This is especially needed in GK1, as the credits video is 640x480. + if (getSciVersion() >= SCI_VERSION_2) + _displayHeight = _displayHeight * 6 / 5; +#endif } - _displayPixels = _displayWidth * _displayHeight; + _displayPixels = _displayWidth * _displayHeight; _visualScreen = (byte *)calloc(_pixels, 1); _priorityScreen = (byte *)calloc(_pixels, 1); _controlScreen = (byte *)calloc(_pixels, 1); -- cgit v1.2.3