[Scummvm-git-logs] scummvm master -> c4b4dcf6c4be709cbc3a114737ec2d81d5fad154
eriktorbjorn
noreply at scummvm.org
Tue Sep 5 18:35:38 UTC 2023
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:
c4b4dcf6c4 SCUMM: Fix crash when loading Mac Loom savegames
Commit: c4b4dcf6c4be709cbc3a114737ec2d81d5fad154
https://github.com/scummvm/scummvm/commit/c4b4dcf6c4be709cbc3a114737ec2d81d5fad154
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2023-09-05T20:35:00+02:00
Commit Message:
SCUMM: Fix crash when loading Mac Loom savegames
This is the same problem that has affected version 6 games and Mac Indy
3, so hopefully this fix is enough. I changed the _macScreen check to
check for platform, since that seemed more sensible to me. Some day, we
should probably get rid of the ability to play the Mac versions in low
resolution anyway.
Changed paths:
engines/scumm/cursor.cpp
engines/scumm/saveload.cpp
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 443ea4ce3b8..c2f98dc7604 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -981,6 +981,10 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {
Graphics::MacCursor macCursor;
if (macCursor.readFromStream(*curs)) {
_cursor.animate = 0;
+ _cursor.width = macCursor.getWidth();
+ _cursor.height = macCursor.getHeight();
+ _cursor.hotspotX = macCursor.getHotspotX();
+ _cursor.hotspotY = macCursor.getHotspotY();
CursorMan.replaceCursor(&macCursor);
delete curs;
return;
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index a2a6fbd1be3..02fd0e8d77a 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1441,15 +1441,22 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
// Post-load fix for broken SAMNMAX savegames which contain invalid
// cursor values; the value we're setting here should not count since
// it's being replaced by the post-load script, as long as it's not zero.
- // The same also happens for the Mac version of INDY3: the cursor was being
- // handled directly with a CursorMan.replaceCursor() without specifying any
- // values for the _cursor object (#14498). Let's fix that with the proper values.
- if ((_game.version == 6 || (_game.id == GID_INDY3 && _macScreen)) &&
- (_cursor.width == 0 || _cursor.height == 0)) {
- _cursor.width = 15;
- _cursor.height = 15;
- _cursor.hotspotX = 7;
- _cursor.hotspotY = 7;
+ // The same also happens for the Mac versions of INDY3 and Loom: the cursor
+ // was being handled directly with a CursorMan.replaceCursor() without
+ // specifying any values for the _cursor object (#14498). Let's fix that
+ // with the proper values.
+ if (_cursor.width == 0 || _cursor.height == 0) {
+ if (_game.version == 6 || (_game.id == GID_INDY3 && _game.platform == Common::kPlatformMacintosh)) {
+ _cursor.width = 15;
+ _cursor.height = 15;
+ _cursor.hotspotX = 7;
+ _cursor.hotspotY = 7;
+ } else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformMacintosh) {
+ _cursor.width = 16;
+ _cursor.height = 16;
+ _cursor.hotspotX = 3;
+ _cursor.hotspotY = 2;
+ }
}
s.syncAsByte(_cursor.animate, VER(20));
More information about the Scummvm-git-logs
mailing list