[Scummvm-git-logs] scummvm master -> 042e83d78a871235259da849412488106fc1faa2

eriktorbjorn noreply at scummvm.org
Sun Jan 5 15:47:43 UTC 2025


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:
042e83d78a SCUMM: MACGUI: Initial support for Maniac Mansion


Commit: 042e83d78a871235259da849412488106fc1faa2
    https://github.com/scummvm/scummvm/commit/042e83d78a871235259da849412488106fc1faa2
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-01-05T16:33:53+01:00

Commit Message:
SCUMM: MACGUI: Initial support for Maniac Mansion

There is currently no user friendly way to do this. You have to unpack
the Maniac Mansion files (since the game is not detected from the "Day
of the Tentacle Data" file), and then you have to put a copy of the Day
of the Tentacle Mac executable where ScummVM can find it (e.g. in the
same directory) because that's where the menus and dialogs are.

Known issues:

"About" shows the credits screen for Day of the Tentacle,
but the original behavior isn't much better: It just shows a black
screen.

The "Sound" menu should be disabled. There are some things I would like
to rearrange before looking into that, though.

Changed paths:
    engines/scumm/cursor.cpp
    engines/scumm/gfx.cpp
    engines/scumm/macgui/macgui.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index c534bad7183..6fa2eedbefd 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -887,6 +887,32 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
 			*(hotspot - _cursor.width * (3 + i)) = color;
 			*(hotspot + _cursor.width * (3 + i)) = color;
 		}
+	} else if (_game.platform == Common::kPlatformMacintosh) {
+		byte invertedMacArrow[] = {
+			0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0xFF, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0xFF,
+			0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+			0x00, 0x0F, 0x00, 0xFF, 0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF,
+			0x00, 0x00, 0xFF, 0xFF, 0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF, 0xFF,
+			0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF,
+			0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x0F, 0x00, 0xFF, 0xFF,
+			0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF
+		};
+
+		memcpy(_grabbedCursor, invertedMacArrow, sizeof(invertedMacArrow));
+
+		_cursor.width = 11;
+		_cursor.height = 16;
+		_cursor.hotspotX = 1;
+		_cursor.hotspotY = 1;
 	} else {
 		_cursor.width = 23;
 		_cursor.height = 21;
@@ -940,6 +966,9 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
 }
 
 void ScummEngine_v2::setSnailCursor() {
+	if (_game.platform == Common::kPlatformMacintosh)
+		return;
+
 	byte color;
 	if (_game.platform == Common::kPlatformC64 || _game.platform == Common::kPlatformApple2GS)
 		color = default_v0_cursor_colors[1];
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index b57759935ba..467d6249b63 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -628,7 +628,6 @@ void ScummEngine::updateDirtyScreen(VirtScreenNumber slot) {
  * specified by top/bottom coordinate in the virtual screen.
  */
 void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, int bottom) {
-
 	// Short-circuit if nothing has to be drawn
 	if (bottom <= top || top >= vs->h)
 		return;
@@ -660,7 +659,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 	if (width <= 0 || height <= 0)
 		return;
 
-	if (_macScreen && _game.version == 3) {
+	if (_macScreen && _game.version <= 3) {
 		mac_drawStripToScreen(vs, top, x, y, width, height);
 		return;
 	}
diff --git a/engines/scumm/macgui/macgui.cpp b/engines/scumm/macgui/macgui.cpp
index 839abaa8086..2096b4ebaaa 100644
--- a/engines/scumm/macgui/macgui.cpp
+++ b/engines/scumm/macgui/macgui.cpp
@@ -48,6 +48,7 @@ MacGui::MacGui(ScummEngine *vm, const Common::Path &resourceFile) {
 		break;
 
 	case GID_TENTACLE:
+	case GID_MANIAC:
 	case GID_SAMNMAX:
 	case GID_DIG:
 	case GID_FT:
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 0539b12bcd2..32cbee89560 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -527,7 +527,7 @@ void MacGuiImpl::updateWindowManager() {
 				break;
 			}
 		}
-	} else if (_vm->_game.version >= 6) {
+	} else if (_vm->_game.version >= 6 || _vm->_game.id == GID_MANIAC) {
 		// We can't use the name of the menus here, because there are
 		// non-English versions. Let's hope the menu positions are
 		// always the same, at least!
@@ -549,6 +549,7 @@ void MacGuiImpl::updateWindowManager() {
 
 		switch (_vm->_voiceMode) {
 		case 0:	// Voice Only
+
 			menu->getSubMenuItem(soundMenu, 6)->checked = true;
 			break;
 		case 1: // Voice and Text
@@ -833,7 +834,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 
 	// Default dialog sizes for dialogs without a DITL resource.
 
-	if (_vm->_game.version < 6) {
+	if (_vm->_game.version < 6 && _vm->_game.id != GID_MANIAC) {
 		bounds.top = 0;
 		bounds.left = 0;
 		bounds.bottom = 86;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 4461ac98dc5..aa6ccc2db7e 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1337,7 +1337,10 @@ Common::Error ScummEngine::init() {
 				_macGui = new MacGui(this, macResourceFile);
 			}
 
-			if (_game.id == GID_INDY3 || _game.id == GID_LOOM)
+			// Maniac Mansion doesn't use the text surface, but it's easier to
+			// pretend that it does.
+
+			if (_game.id == GID_INDY3 || _game.id == GID_LOOM || _game.id == GID_MANIAC)
 				_textSurfaceMultiplier = 2;
 		}
 
@@ -1373,7 +1376,7 @@ Common::Error ScummEngine::init() {
 		int screenWidth = _screenWidth;
 		int screenHeight = _screenHeight;
 
-		if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version >= 3 && _game.heversion == 0) {
+		if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.heversion == 0) {
 			screenWidth *= 2;
 			screenHeight *= 2;
 			screenHeight += 2 * 2 * _macScreenDrawOffset;




More information about the Scummvm-git-logs mailing list