[Scummvm-cvs-logs] scummvm master -> 7b5792d6d2c605eded73118a8f73ceb2c29627e1

clone2727 clone2727 at gmail.com
Fri Feb 18 22:05:36 CET 2011


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:
7b5792d6d2 SCI: Fix window height for some Mac SCI1/1.1 games


Commit: 7b5792d6d2c605eded73118a8f73ceb2c29627e1
    https://github.com/scummvm/scummvm/commit/7b5792d6d2c605eded73118a8f73ceb2c29627e1
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-18T12:58:23-08:00

Commit Message:
SCI: Fix window height for some Mac SCI1/1.1 games

Some games have removed the menu bar from the screen. This also fixes King's Quest V's icon bar.

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



diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 87f0c3d..57c7612 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -106,7 +106,10 @@ void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *te
 		offTop = 26;
 		break;
 	default:
-		offTop = 10;
+		// For Mac games running with a height of 190, we do not have a menu bar
+		// so the top offset should be 0.
+		if (_screen->getHeight() == 190)
+			offTop = 0;
 		break;
 	}
 
@@ -575,10 +578,6 @@ void GfxPorts::priorityBandsInit(int16 bandCount, int16 top, int16 bottom) {
 	int16 y;
 	int32 bandSize;
 
-	// This code is for 320x200 games only
-	if (_screen->getHeight() != 200)
-		return;
-
 	if (bandCount != -1)
 		_priorityBandCount = bandCount;
 
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index a0f402f..b019853 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -64,7 +64,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
 		_height = 480;
 	} else {
 		_width = 320;
-		_height = 200;
+		_height = getLowResScreenHeight();
 	}
 
 	// Japanese versions of games use hi-res font on upscaled version of the game.
@@ -717,4 +717,22 @@ int16 GfxScreen::kernelPicNotValid(int16 newPicNotValid) {
 	return oldPicNotValid;
 }
 
+uint16 GfxScreen::getLowResScreenHeight() {
+	// Some Mac SCI1/1.1 games only take up 190 rows and do not
+	// have the menu bar.
+	if (g_sci->getPlatform() == Common::kPlatformMacintosh) {
+		switch (g_sci->getGameId()) {
+		case GID_FREDDYPHARKAS:
+		case GID_KQ5:
+		case GID_KQ6:
+			return 190;
+		default:
+			break;
+		}
+	}
+
+	// Everything else is 200
+	return 200;
+}
+
 } // End of namespace Sci
diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h
index 1d6b127..fc1f38e 100644
--- a/engines/sci/graphics/screen.h
+++ b/engines/sci/graphics/screen.h
@@ -181,6 +181,8 @@ private:
 	// This defines whether or not the font we're drawing is already scaled
 	// to the screen size (and we therefore should not upscale it ourselves).
 	bool _fontIsUpscaled;
+
+	uint16 getLowResScreenHeight();
 };
 
 } // End of namespace Sci






More information about the Scummvm-git-logs mailing list