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

dreammaster paulfgilbert at gmail.com
Sun Jul 28 04:57:56 CEST 2019


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

Summary:
3457d3155e GLK: FROTZ: Add detection for Infocom game Blorb files available at if-archive
f515394e78 GLK: FROTZ: Fix reading placeholder rects from Blorb files


Commit: 3457d3155e61a43ee8f2e8b1479b123439953d53
    https://github.com/scummvm/scummvm/commit/3457d3155e61a43ee8f2e8b1479b123439953d53
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-07-27T19:12:39-07:00

Commit Message:
GLK: FROTZ: Add detection for Infocom game Blorb files available at if-archive

Changed paths:
    engines/glk/blorb.cpp
    engines/glk/blorb.h
    engines/glk/glk.cpp
    engines/glk/glk.h


diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp
index 88d6552..849e686 100644
--- a/engines/glk/blorb.cpp
+++ b/engines/glk/blorb.cpp
@@ -236,7 +236,7 @@ bool Blorb::hasBlorbExt(const Common::String &filename) {
 }
 
 void Blorb::getBlorbFilenames(const Common::String &srcFilename, Common::StringArray &filenames,
-		InterpreterType interpType) {
+		InterpreterType interpType, const Common::String &gameId) {
 	// Strip off the source filename extension
 	Common::String filename = srcFilename;
 	if (!filename.contains('.')) {
@@ -257,6 +257,7 @@ void Blorb::getBlorbFilenames(const Common::String &srcFilename, Common::StringA
 		break;
 	case INTERPRETER_FROTZ:
 		filenames.push_back(filename + "zblorb");
+		getInfocomBlorbFilenames(filenames, gameId);
 		break;
 	case INTERPRETER_GLULXE:
 		filenames.push_back(filename + "gblorb");
@@ -266,4 +267,21 @@ void Blorb::getBlorbFilenames(const Common::String &srcFilename, Common::StringA
 	}
 }
 
+void Blorb::getInfocomBlorbFilenames(Common::StringArray &filenames, const Common::String &gameId) {
+	if (gameId == "beyondzork")
+		filenames.push_back("beyondzork.blb");
+	else if (gameId == "journey")
+		filenames.push_back("journey.blb");
+	else if (gameId == "lurkinghorror")
+		filenames.push_back("lurking.blb");
+	else if (gameId == "questforexcalibur")
+		filenames.push_back("arthur.blb");
+	else if (gameId == "sherlockriddle")
+		filenames.push_back("sherlock.blb");
+	else if (gameId == "shogun")
+		filenames.push_back("shogun.blb");
+	else if (gameId == "zork0")
+		filenames.push_back("zorkzero.blb");
+}
+
 } // End of namespace Glk
diff --git a/engines/glk/blorb.h b/engines/glk/blorb.h
index 887690c..5d72e2c 100644
--- a/engines/glk/blorb.h
+++ b/engines/glk/blorb.h
@@ -89,6 +89,11 @@ private:
 	 * Parses the Blorb file index to load in a list of the chunks
 	 */
 	Common::ErrorCode load();
+
+	/**
+	 * Add possible Blorb filenames for Infocom games
+	 */
+	static void getInfocomBlorbFilenames(Common::StringArray &filenames, const Common::String &gameId);
 public:
 	/**
 	 * Constructor
@@ -151,7 +156,7 @@ public:
 	 * Return a list of possible filenames for blorb files
 	 */
 	static void getBlorbFilenames(const Common::String &srcFilename, Common::StringArray &filenames,
-		InterpreterType interpType);
+		InterpreterType interpType, const Common::String &gameId);
 };
 
 } // End of namespace Glk
diff --git a/engines/glk/glk.cpp b/engines/glk/glk.cpp
index 06ab742..455c42b 100644
--- a/engines/glk/glk.cpp
+++ b/engines/glk/glk.cpp
@@ -130,7 +130,7 @@ Common::Error GlkEngine::run() {
 	} else {
 		// Check for a secondary blorb file with the same filename
 		Common::StringArray blorbFilenames;
-		Blorb::getBlorbFilenames(filename, blorbFilenames, getInterpreterType());
+		Blorb::getBlorbFilenames(filename, blorbFilenames, getInterpreterType(), getGameID());
 
 		for (uint idx = 0; idx < blorbFilenames.size(); ++idx) {
 			if (Common::File::exists(blorbFilenames[idx])) {
diff --git a/engines/glk/glk.h b/engines/glk/glk.h
index bd3594a..9c65fca 100644
--- a/engines/glk/glk.h
+++ b/engines/glk/glk.h
@@ -149,6 +149,11 @@ public:
 	virtual InterpreterType getInterpreterType() const = 0;
 
 	/**
+	 * Returns the game's Id
+	 */
+	const Common::String &getGameID() const { return _gameDescription._gameId; }
+
+	/**
 	 * Returns the game's md5
 	 */
 	const Common::String &getGameMD5() const { return _gameDescription._md5; }


Commit: f515394e78f92093f7d8df52eba9742e657e57e1
    https://github.com/scummvm/scummvm/commit/f515394e78f92093f7d8df52eba9742e657e57e1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-07-27T19:57:37-07:00

Commit Message:
GLK: FROTZ: Fix reading placeholder rects from Blorb files

Changed paths:
    engines/glk/frotz/pics.cpp
    engines/glk/picture.cpp


diff --git a/engines/glk/frotz/pics.cpp b/engines/glk/frotz/pics.cpp
index a3df86a..84ee050 100644
--- a/engines/glk/frotz/pics.cpp
+++ b/engines/glk/frotz/pics.cpp
@@ -156,10 +156,10 @@ Common::SeekableReadStream *Pics::createReadStreamForMember(const Common::String
 				dest = decoder.decode(*src, e._flags, *_palette, kMCGA, e._width, e._height);
 				delete src;
 			} else {
-				byte *rect = (byte *)malloc(2 * sizeof(uint16));
-				WRITE_LE_UINT16(rect, e._width);
-				WRITE_LE_UINT16(rect + 2, e._height);
-				dest = new Common::MemoryReadStream(rect, 2 * sizeof(uint16), DisposeAfterUse::YES);
+				byte *rect = (byte *)malloc(2 * sizeof(uint32));
+				WRITE_BE_UINT32(rect, e._width);
+				WRITE_BE_UINT32(rect + 4, e._height);
+				dest = new Common::MemoryReadStream(rect, 2 * sizeof(uint32), DisposeAfterUse::YES);
 			}
 
 			f.close();
diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp
index 3064444..a87f7f7 100644
--- a/engines/glk/picture.cpp
+++ b/engines/glk/picture.cpp
@@ -135,8 +135,8 @@ Picture *Pictures::load(uint32 id) {
 		palCount = raw.getPaletteColorCount();
 		transColor = raw.getTransparentColor();
 	} else if (f.open(Common::String::format("pic%u.rect", id))) {
-		rectImg.w = f.readUint16LE();
-		rectImg.h = f.readUint16LE();
+		rectImg.w = f.readUint32BE();
+		rectImg.h = f.readUint32BE();
 		img = &rectImg;
 	} else {
 		// No such picture





More information about the Scummvm-git-logs mailing list