[Scummvm-git-logs] scummvm master -> 3326dab396354478318b5ed7f990713e9663d79d

sev- noreply at scummvm.org
Fri Mar 13 18:39:21 UTC 2026


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
7fc6c04597 COMMON: Add original filename extraction to MacResManager
3326dab396 WAGE: Use original Mac filename for Apple menu


Commit: 7fc6c04597d98ec4a222d264d488fa9efd129045
    https://github.com/scummvm/scummvm/commit/7fc6c04597d98ec4a222d264d488fa9efd129045
Author: SHANKHARAJ DATTA (shankharajdatta2004 at gmail.com)
Date: 2026-03-13T19:39:15+01:00

Commit Message:
COMMON: Add original filename extraction to MacResManager

Changed paths:
    common/macresman.cpp
    common/macresman.h


diff --git a/common/macresman.cpp b/common/macresman.cpp
index b05928e7cce..43cd05d7764 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -133,6 +133,7 @@ void MacResManager::close() {
 	delete[] _resTypes; _resTypes = nullptr;
 	delete _stream; _stream = nullptr;
 	_resMap.numTypes = 0;
+	_originalFileName.clear();
 }
 
 bool MacResManager::hasResFork() const {
@@ -626,10 +627,19 @@ bool MacResManager::loadFromAppleDouble(SeekableReadStream *stream) {
 			_resForkOffset = offset;
 			_mode = kResForkAppleDouble;
 			_resForkSize = length;
-			return load(stream);
+		} else if (id == 3 && length > 0) {
+			// Found the real name!
+			uint32 oldPos = stream->pos();
+			stream->seek(offset);
+			_originalFileName = stream->readString(0, length);
+			debug(1, "MacResManager: Extracted original filename '%s' from AppleDouble", _originalFileName.c_str());
+			stream->seek(oldPos);
 		}
 	}
 
+	if (_mode == kResForkAppleDouble)
+		return load(stream);
+
 	return false;
 }
 
@@ -789,6 +799,12 @@ bool MacResManager::loadFromMacBinary(SeekableReadStream *stream) {
 		if (_resForkOffset < 0)
 			return false;
 
+		byte nameLen = infoHeader[MBI_NAMELEN];
+		if (nameLen > 0) {
+			_originalFileName = Common::String((const char *)(infoHeader + MBI_NAMELEN + 1), nameLen);
+			debug(1, "MacResManager: Extracted original filename '%s' from MacBinary", _originalFileName.c_str());
+		}
+
 		_mode = kResForkMacBinary;
 		return load(stream);
 	}
diff --git a/common/macresman.h b/common/macresman.h
index 8f65eedac77..98bd4d15af8 100644
--- a/common/macresman.h
+++ b/common/macresman.h
@@ -297,6 +297,12 @@ public:
 
 	void setBaseFileName(Common::Path str) { _baseFileName = str; }
 
+	/**
+	 * Get the original Macintosh file name extracted from headers.
+	 * @return The original file name if available, otherwise an empty string.
+	 */
+	String getOriginalFileName() const { return _originalFileName; }
+
 	/**
 	 * Return list of resource IDs with specified type ID
 	 */
@@ -347,6 +353,7 @@ public:
 private:
 	SeekableReadStream *_stream;
 	Path _baseFileName;
+	String _originalFileName;
 
 	bool load(SeekableReadStream *stream);
 


Commit: 3326dab396354478318b5ed7f990713e9663d79d
    https://github.com/scummvm/scummvm/commit/3326dab396354478318b5ed7f990713e9663d79d
Author: SHANKHARAJ DATTA (shankharajdatta2004 at gmail.com)
Date: 2026-03-13T19:39:15+01:00

Commit Message:
WAGE: Use original Mac filename for Apple menu

Changed paths:
    engines/wage/world.cpp


diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 5ce289bec65..a00febd472c 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -140,7 +140,12 @@ bool World::loadWorld(Common::MacResManager *resMan) {
 	if ((resArray = resMan->getResIDArray(MKTAG('V','E','R','S'))).size() == 0)
 		return false;
 
-	_name = resMan->getBaseFileName().toString();
+	Common::String origName = resMan->getOriginalFileName();
+	if (!origName.empty()) {
+		_name = origName;
+	} else {
+		_name = resMan->getBaseFileName().toString();
+	}
 
 	if (resArray.size() > 1)
 		warning("Too many VERS resources");
@@ -357,6 +362,8 @@ bool World::loadWorld(Common::MacResManager *resMan) {
 		for (uint i = 0; i < string.size() && string[i] != ';'; i++) // Read token
 			_aboutMenuItemName += string[i];
 
+		_aboutMenuItemName.trim();
+
 		debugC(1, kDebugLoading, "MENU: About: %s", toPrintable(_aboutMenuItemName).c_str());
 
 		delete menu;




More information about the Scummvm-git-logs mailing list