[Scummvm-git-logs] scummvm master -> 898ea4cf6eaa173385db84a808e9e75e8652c3f6
eriktorbjorn
noreply at scummvm.org
Wed Jan 8 20:46:22 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:
898ea4cf6e SCUMM: MACGUI: Allow playing Maniac Mansion without the Mac GUI
Commit: 898ea4cf6eaa173385db84a808e9e75e8652c3f6
https://github.com/scummvm/scummvm/commit/898ea4cf6eaa173385db84a808e9e75e8652c3f6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-01-08T21:45:57+01:00
Commit Message:
SCUMM: MACGUI: Allow playing Maniac Mansion without the Mac GUI
Changed paths:
engines/scumm/cursor.cpp
engines/scumm/macgui/macgui_v6.cpp
engines/scumm/macgui/macgui_v6.h
engines/scumm/scumm.cpp
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 6fa2eedbefd..26ce381d2dd 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -887,32 +887,15 @@ 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
- };
+ } else if (_macGui) {
+ int width, height, hotspotX, hotspotY, animate;
- memcpy(_grabbedCursor, invertedMacArrow, sizeof(invertedMacArrow));
+ _macGui->setupCursor(width, height, hotspotX, hotspotY, animate);
- _cursor.width = 11;
- _cursor.height = 16;
- _cursor.hotspotX = 1;
- _cursor.hotspotY = 1;
+ _cursor.width = width;
+ _cursor.height = height;
+ _cursor.hotspotX = hotspotX;
+ _cursor.hotspotY = hotspotY;
} else {
_cursor.width = 23;
_cursor.height = 21;
@@ -966,7 +949,9 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
}
void ScummEngine_v2::setSnailCursor() {
- if (_game.platform == Common::kPlatformMacintosh)
+ // When running Maniac Mansion as a Macintosh game, there is no snail
+ // cursor. Only the regular arrow cursor.
+ if (_macGui)
return;
byte color;
diff --git a/engines/scumm/macgui/macgui_v6.cpp b/engines/scumm/macgui/macgui_v6.cpp
index f66153ef4a7..225c779a97b 100644
--- a/engines/scumm/macgui/macgui_v6.cpp
+++ b/engines/scumm/macgui/macgui_v6.cpp
@@ -125,6 +125,37 @@ bool MacV6Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) cons
return false;
}
+void MacV6Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
+ if (_vm->_game.id != GID_MANIAC)
+ return;
+
+ 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(_vm->_grabbedCursor, invertedMacArrow, sizeof(invertedMacArrow));
+
+ width = 11;
+ height = 16;
+ hotspotX = 1;
+ hotspotY = 1;
+}
+
bool MacV6Gui::handleMenu(int id, Common::String &name) {
// Don't call the original method. The menus are too different.
// TODO: Separate the common code into its own method?
diff --git a/engines/scumm/macgui/macgui_v6.h b/engines/scumm/macgui/macgui_v6.h
index 45035929c37..0956130b66f 100644
--- a/engines/scumm/macgui/macgui_v6.h
+++ b/engines/scumm/macgui/macgui_v6.h
@@ -57,7 +57,7 @@ public:
const Graphics::Font *getFontByScummId(int32 id) override;
- void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override {};
+ void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
void resetAfterLoad() override;
void update(int delta) override {}
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index f1b1eb8a236..dd755f241fe 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1341,7 +1341,7 @@ Common::Error ScummEngine::init() {
// 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)
+ if (_game.id == GID_INDY3 || _game.id == GID_LOOM || (_game.id == GID_MANIAC && _macGui))
_textSurfaceMultiplier = 2;
}
More information about the Scummvm-git-logs
mailing list