[Scummvm-cvs-logs] scummvm master -> 5594feff2a7a209d62b5ecfba02262680fd27d97

m-kiewitz m_kiewitz at users.sourceforge.net
Sun Nov 9 17:33:08 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5594feff2a SCI: Phantasmagoria actually outputs 630x450 now


Commit: 5594feff2a7a209d62b5ecfba02262680fd27d97
    https://github.com/scummvm/scummvm/commit/5594feff2a7a209d62b5ecfba02262680fd27d97
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2014-11-09T17:33:17+01:00

Commit Message:
SCI: Phantasmagoria actually outputs 630x450 now

clipping of video output was required

Changed paths:
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/screen.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index fafc734..ccc362d 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 594c4b3..8b0e763 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;






More information about the Scummvm-git-logs mailing list