diff options
author | Paul Gilbert | 2019-07-27 19:12:39 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-27 19:12:39 -0700 |
commit | 3457d3155e61a43ee8f2e8b1479b123439953d53 (patch) | |
tree | 99fd609db8673b4e7b80061597f9fa236c4b9efc /engines | |
parent | ed8fba2c53bdff36e1de0c70af1cf4d7ab27ee9c (diff) | |
download | scummvm-rg350-3457d3155e61a43ee8f2e8b1479b123439953d53.tar.gz scummvm-rg350-3457d3155e61a43ee8f2e8b1479b123439953d53.tar.bz2 scummvm-rg350-3457d3155e61a43ee8f2e8b1479b123439953d53.zip |
GLK: FROTZ: Add detection for Infocom game Blorb files available at if-archive
Diffstat (limited to 'engines')
-rw-r--r-- | engines/glk/blorb.cpp | 20 | ||||
-rw-r--r-- | engines/glk/blorb.h | 7 | ||||
-rw-r--r-- | engines/glk/glk.cpp | 2 | ||||
-rw-r--r-- | engines/glk/glk.h | 5 |
4 files changed, 31 insertions, 3 deletions
diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp index 88d6552ffe..849e6866e0 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 887690c251..5d72e2cf06 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 06ab742e74..455c42b46c 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 bd3594ae39..9c65fca3e6 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; } |