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

athrxx noreply at scummvm.org
Wed Oct 26 22:37:02 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:
b6f00bb049 SCUMM: (FM-TOWNS) - simplify  mouse cursor color endian fix a bit


Commit: b6f00bb0490152448dfa775b59445e19ea39acea
    https://github.com/scummvm/scummvm/commit/b6f00bb0490152448dfa775b59445e19ea39acea
Author: athrxx (athrxx at scummvm.org)
Date: 2022-10-27T00:36:34+02:00

Commit Message:
SCUMM: (FM-TOWNS) - simplify  mouse cursor color endian fix a bit

Changed paths:
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 20d2cd49cd6..d42dfab7deb 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1355,7 +1355,7 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 			uint16 *pos = (uint16*)_grabbedCursor;
 			for (i = 0; i < 4096; ++i)
 				s.syncAsUint16LE(*pos++, VER(20));
-		} else {
+		} else if (s.getVersion() >= VER(20)) {
 			s.syncBytes(_grabbedCursor, 8192, VER(20));
 			// Patch older savegames if they were saved on a system with a
 			// different endianness than the current system's endianness
@@ -1365,18 +1365,14 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 			// where actual cursor data would never get stored (at least not
 			// for the games concerned).
 			uint16 transCol = (_game.heversion >= 80) ? 5 : 255;
-#ifdef SCUMM_LITTLE_ENDIAN
-			if (READ_BE_UINT16(&_grabbedCursor[2046]) == transCol) {
-#else
-			if (READ_LE_UINT16(&_grabbedCursor[2046]) == transCol) {
-#endif
+			if (READ_UINT16(&_grabbedCursor[2046]) == (transCol << 8)) {
 				uint16 *pos = (uint16*)_grabbedCursor;
 				for (i = 0; i < 4096; ++i) {
 					*pos = SWAP_BYTES_16(*pos);
 					pos++;
-				}
 			}
 		}
+	}
 	} else {
 		s.syncBytes(_grabbedCursor, 8192, VER(20));
 	}




More information about the Scummvm-git-logs mailing list