[Scummvm-git-logs] scummvm master -> 92c0c20e6af0034469712c4b15e5beb666c7b255

sev- noreply at scummvm.org
Mon Jul 11 10:53:55 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:
92c0c20e6a WAGE: Made loading patterns from Enhanced Scepters more robust


Commit: 92c0c20e6af0034469712c4b15e5beb666c7b255
    https://github.com/scummvm/scummvm/commit/92c0c20e6af0034469712c4b15e5beb666c7b255
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-07-11T12:53:21+02:00

Commit Message:
WAGE: Made loading patterns from Enhanced Scepters more robust

Changed paths:
    engines/wage/world.cpp


diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 03f96eaf628..f2e075c6c48 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -304,7 +304,33 @@ bool World::loadWorld(Common::MacResManager *resMan) {
 		/* Enchanted Scepters did not use the PAT# resource for the textures. */
 		res = resMan->getResource(MKTAG('C','O','D','E'), 1);
 		if (res != NULL) {
-			res->skip(0x55ac);
+			const char *magic = "\x92\x40\x15\x81\x20\x00\x4E\x75";
+
+			int cnt = 0;
+			bool found = false;
+
+			while (!res->eos()) {
+				byte b = res->readByte();
+
+				if (b == (byte)magic[cnt]) {
+					cnt++;
+
+					if (cnt == 8) {
+						found = true;
+						break;
+					}
+				} else {
+					cnt = 0;
+				}
+			}
+
+			if (!found)
+				error("World::loadWorld(): Could not find Enhanced Scepters' patterns");
+
+			res->skip(8); // Skip 8 more bytes
+
+			debug(3, "Loading 29 patterns for Enhanced Scepters at %ld", res->pos());
+
 			for (int i = 0; i < 29; i++) {
 				byte *pattern = (byte *)malloc(8);
 




More information about the Scummvm-git-logs mailing list