[Scummvm-git-logs] scummvm master -> a3c38658774319eae3c3ce1ef34f663d4dc6f783

sluicebox noreply at scummvm.org
Fri May 20 18:21:42 UTC 2022


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:
a3c3865877 SCI: Initialize pic window correctly for QFG1VGA Mac


Commit: a3c38658774319eae3c3ce1ef34f663d4dc6f783
    https://github.com/scummvm/scummvm/commit/a3c38658774319eae3c3ce1ef34f663d4dc6f783
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-05-20T14:20:22-04:00

Commit Message:
SCI: Initialize pic window correctly for QFG1VGA Mac

Fixes the opening background being drawn 10 pixels too low

Changed paths:
    engines/sci/graphics/ports.cpp


diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index acc8a2ee051..0db18a2ae04 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -49,8 +49,6 @@ GfxPorts::~GfxPorts() {
 }
 
 void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *text16) {
-	int16 offTop = 10;
-
 	_usesOldGfxFunctions = usesOldGfxFunctions;
 	_paint16 = paint16;
 	_text16 = text16;
@@ -85,6 +83,8 @@ void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *te
 	// Mother Goose (SCI1) uses -Nw 0 0 159 262. The game will later use
 	// SetPort so we don't need to set the other fields.
 	// This actually meant not skipping the first 10 pixellines in windowMgrPort
+	int16 offTop = 10;
+	bool useMacStatusBarSizing = false;
 	switch (g_sci->getGameId()) {
 	case GID_JONES:
 	case GID_SLATER:
@@ -103,6 +103,19 @@ void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *te
 		// also do this we will get not-fully-removed windows everywhere.
 		offTop = 26;
 		break;
+	case GID_QFG1VGA:
+		// QFG1VGA relies on the Mac interpreter initializing the state of the
+		// pic window differently in order to draw its first pic. Pic 748 is a
+		// Mac-only 320x200 version of pic 750 (320x190) that PC drew with the
+		// usual 10 pixel black bar above. Only this game depends on this subtle
+		// difference. It's a byproduct of a complex set of workarounds to
+		// implement the HasStatusBar config flag (the first byte in the `cnfg`
+		// resource in the Mac interpreter's resource fork). This flag is also
+		// set in LSL6, Brain, and Hoyle4 but they don't depend on the altered
+		// initial state. We achieve the same effect by adjusting the initial
+		// pic window size to cover the entire screen.
+		useMacStatusBarSizing = true;
+		break;
 	default:
 		// For Mac games running with a height of 190, we do not have a menu bar
 		// so the top offset should be 0.
@@ -127,7 +140,11 @@ void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *te
 	_wmgrPort->curLeft = 0;
 	_windowList.push_front(_wmgrPort);
 
-	_picWind = addWindow(Common::Rect(0, offTop, _screen->getScriptWidth(), _screen->getScriptHeight()), nullptr, nullptr, SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_NOFRAME, 0, true);
+	Common::Rect picWindowRect(0, offTop, _screen->getScriptWidth(), _screen->getScriptHeight());
+	if (useMacStatusBarSizing) {
+		picWindowRect.top = 0;
+	}
+	_picWind = addWindow(picWindowRect, nullptr, nullptr, SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_NOFRAME, 0, true);
 	// For SCI0 games till kq4 (.502 - not including) we set _picWind top to offTop instead
 	//  Because of the menu/status bar
 	if (_usesOldGfxFunctions)




More information about the Scummvm-git-logs mailing list