[Scummvm-git-logs] scummvm master -> 4938ac9ea1b207f100a73e2ecbf617b7569fb4b0

dreammaster paulfgilbert at gmail.com
Tue Jan 1 07:32:28 CET 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:
fa51ea2138 GLK: FROTZ: Fix Mysterious Adventures detection entries
4938ac9ea1 GLK: Implement passing detection options to the engines


Commit: fa51ea2138831f4f87f0d66a7f32f32c2942b8e6
    https://github.com/scummvm/scummvm/commit/fa51ea2138831f4f87f0d66a7f32f32c2942b8e6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-31T22:31:16-08:00

Commit Message:
GLK: FROTZ: Fix Mysterious Adventures detection entries

Changed paths:
    engines/glk/frotz/detection_tables.h


diff --git a/engines/glk/frotz/detection_tables.h b/engines/glk/frotz/detection_tables.h
index e676f7d..8a18b33 100644
--- a/engines/glk/frotz/detection_tables.h
+++ b/engines/glk/frotz/detection_tables.h
@@ -1850,39 +1850,39 @@ const FrotzGameDescription FROTZ_GAMES[] = {
 	ENTRY0("voodoocastle", "980329", "bff285e6c9291fc6ba77c9743b610c2d", 24064),
 
 	// Mysterious Adventures by Brian Howarth
-	ENTRY0("goldenbaton", "980406", "408b31a15c429f7ca83b2ac80764ffa8", 20992),
-	ENTRY0("timemachine", "980406", "e0a0335705aab9642b7625f26c00eca2", 22016),
-	ENTRY0("arrowofdeath1", "980406", "a3827232bf54c339a5ec5ab906fd1857", 22016),
-	ENTRY0("arrowofdeath2", "980406", "5a437f2cbc4f99d8cd741e83e2abe4cd", 24064),
-	ENTRY0("pulsar7", "980406", "d93cc91cda58c75259b2c872921a17a8", 26112),
-	ENTRY0("circus", "980406", "be7a07e042f5d1b0cde3d3b1cd85dee3", 22528),
-	ENTRY0("feasibility", "980406", "e0c46523e043bc75f8e04714396e17ff", 22528),
-	ENTRY0("akyrz", "980406", "61c29077bee55dce614a729705099282", 24064),
-	ENTRY0("perseus", "980406", "c1ab2f87658691f773599d9973bf72a1", 23040),
-	ENTRY0("10indians", "980406", "b3e4b8376f7c553064ceff8f25936385", 22528),
-	ENTRY0("waxworks", "980406", "98e52d813cb28f899916ef7129c85a0e", 24064),
-	ENTRY0("goldenbaton", "041209", "817ca85193d842b9716d4b688d6fe9d1", 27644),
-	ENTRY0("timemachine", "041209", "460ad097aeb7b800f237692aaec8fda2", 28156),
-	ENTRY0("arrowofdeath1", "041209", "616f481469279a1184d1d8fcad84ed4e", 28156),
-	ENTRY0("arrowofdeath2", "041209", "058dbdf618b22e9dd47f42f7e98e6fdd", 30716),
-	ENTRY0("pulsar7", "041209", "41a2b9048af4600f43c829e2348b5fc6", 32764),
-	ENTRY0("circus", "041209", "0c5a65e665b773fc39bdcbe194ad99cc", 29180),
-	ENTRY0("feasibility", "041209", "2159059c9b506af4f10c7cf9133fdd00", 28672),
-	ENTRY0("akyrz", "041209", "cfbef40e735057b6fbbde3991f6ee4c9", 31232),
-	ENTRY0("perseus", "041209", "1c0fef44034daa16ada548caac232337", 29696),
-	ENTRY0("10indians", "041209", "63b01fa007b977be144bcd3a6f6e8dcf", 29180),
-	ENTRY0("waxworks", "041209", "859a006a14bd69b22135688248756ba0", 30720),
-	ENTRY0("goldenbaton", "110126", "9de3f1a8624e20409c92325b30a3b490", 156156),
-	ENTRY0("timemachine", "110126", "684e96c6adaccfd5f4138dce069d3fc3", 137728),
-	ENTRY0("arrowofdeath1", "110126", "3deca9c9fce4fb995e0681ecdfb39cf2", 173056),
-	ENTRY0("arrowofdeath2", "110126", "4a0c494ff4564e659a29fbd3d67696f6", 172540),
-	ENTRY0("pulsar7", "110126", "5d6897ee80078c0286a52589ae305633", 135168),
-	ENTRY0("circus", "110126", "72721053ed49e1d701146332215f63e9", 118780),
-	ENTRY0("feasibility", "110126", "8f2f18c6fd76be74e612ee9b271055b1", 172540),
-	ENTRY0("akyrz", "110126", "92c5abee1a097f1e8e61f744ba9ddb3f", 119296),
-	ENTRY0("perseus", "110126", "39be8e28753aa0ac87c49b6dedb712a2", 132096),
-	ENTRY0("10indians", "110126", "0c5d25323a3b649ea432025001edb638", 170492),
-	ENTRY0("waxworks", "110126", "c51e911d1228d8adfc07ed138bc90079", 116220),
+	ENTRY0("goldenbatoni5", "980406", "408b31a15c429f7ca83b2ac80764ffa8", 20992),
+	ENTRY0("timemachinei5", "980406", "e0a0335705aab9642b7625f26c00eca2", 22016),
+	ENTRY0("arrowofdeath1i5", "980406", "a3827232bf54c339a5ec5ab906fd1857", 22016),
+	ENTRY0("arrowofdeath2i5", "980406", "5a437f2cbc4f99d8cd741e83e2abe4cd", 24064),
+	ENTRY0("pulsar7i5", "980406", "d93cc91cda58c75259b2c872921a17a8", 26112),
+	ENTRY0("circusi5", "980406", "be7a07e042f5d1b0cde3d3b1cd85dee3", 22528),
+	ENTRY0("feasibilityi5", "980406", "e0c46523e043bc75f8e04714396e17ff", 22528),
+	ENTRY0("akyrzi5", "980406", "61c29077bee55dce614a729705099282", 24064),
+	ENTRY0("perseusi5", "980406", "c1ab2f87658691f773599d9973bf72a1", 23040),
+	ENTRY0("10indiansi5", "980406", "b3e4b8376f7c553064ceff8f25936385", 22528),
+	ENTRY0("waxworksi5", "980406", "98e52d813cb28f899916ef7129c85a0e", 24064),
+	ENTRY0("goldenbatoni5", "041209", "817ca85193d842b9716d4b688d6fe9d1", 27644),
+	ENTRY0("timemachinei5", "041209", "460ad097aeb7b800f237692aaec8fda2", 28156),
+	ENTRY0("arrowofdeath1i5", "041209", "616f481469279a1184d1d8fcad84ed4e", 28156),
+	ENTRY0("arrowofdeath2i5", "041209", "058dbdf618b22e9dd47f42f7e98e6fdd", 30716),
+	ENTRY0("pulsar7i5", "041209", "41a2b9048af4600f43c829e2348b5fc6", 32764),
+	ENTRY0("circusi5", "041209", "0c5a65e665b773fc39bdcbe194ad99cc", 29180),
+	ENTRY0("feasibilityi5", "041209", "2159059c9b506af4f10c7cf9133fdd00", 28672),
+	ENTRY0("akyrzi5", "041209", "cfbef40e735057b6fbbde3991f6ee4c9", 31232),
+	ENTRY0("perseusi5", "041209", "1c0fef44034daa16ada548caac232337", 29696),
+	ENTRY0("10indiansi5", "041209", "63b01fa007b977be144bcd3a6f6e8dcf", 29180),
+	ENTRY0("waxworksi5", "041209", "859a006a14bd69b22135688248756ba0", 30720),
+	ENTRY0("goldenbatoni5", "110126", "9de3f1a8624e20409c92325b30a3b490", 156156),
+	ENTRY0("timemachinei5", "110126", "684e96c6adaccfd5f4138dce069d3fc3", 137728),
+	ENTRY0("arrowofdeath1i5", "110126", "3deca9c9fce4fb995e0681ecdfb39cf2", 173056),
+	ENTRY0("arrowofdeath2i5", "110126", "4a0c494ff4564e659a29fbd3d67696f6", 172540),
+	ENTRY0("pulsar7i5", "110126", "5d6897ee80078c0286a52589ae305633", 135168),
+	ENTRY0("circusi5", "110126", "72721053ed49e1d701146332215f63e9", 118780),
+	ENTRY0("feasibilityi5", "110126", "8f2f18c6fd76be74e612ee9b271055b1", 172540),
+	ENTRY0("akyrzi5", "110126", "92c5abee1a097f1e8e61f744ba9ddb3f", 119296),
+	ENTRY0("perseusi5", "110126", "39be8e28753aa0ac87c49b6dedb712a2", 132096),
+	ENTRY0("10indiansi5", "110126", "0c5d25323a3b649ea432025001edb638", 170492),
+	ENTRY0("waxworksi5", "110126", "c51e911d1228d8adfc07ed138bc90079", 116220),
 
 	// 1992 album Apollo 18, by They Might be Giants
 	ENTRY0("apollo1", "120315", "1aec299147675a5c6e10d548a4eeba05", 251100),


Commit: 4938ac9ea1b207f100a73e2ecbf617b7569fb4b0
    https://github.com/scummvm/scummvm/commit/4938ac9ea1b207f100a73e2ecbf617b7569fb4b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-31T22:32:07-08:00

Commit Message:
GLK: Implement passing detection options to the engines

Changed paths:
    engines/glk/detection.cpp
    engines/glk/frotz/config.cpp
    engines/glk/frotz/config.h
    engines/glk/frotz/detection.cpp
    engines/glk/frotz/detection.h
    engines/glk/frotz/frotz.cpp
    engines/glk/glk.h


diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index a1786d0..4c0932a 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -63,6 +63,18 @@ bool Glk::GlkEngine::hasFeature(EngineFeature f) const {
 	    (f == kSupportsSavingDuringRuntime);
 }
 
+template<class META, class ENG>Engine *create(OSystem *syst, Glk::GlkGameDescription &gameDesc) {
+	Glk::GameDescriptor gd = META::findGame(gameDesc._gameId.c_str());
+	if (gd._description) {
+		gameDesc._options = gd._options;
+		return new ENG(syst, gameDesc);
+	} else {
+		return nullptr;
+	}
+}
+
+#define CREATE(META, ENG) if (!(*engine = create<META, ENG>(syst, gameDesc)))
+
 Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
 	Glk::GameDescriptor td = Glk::GameDescriptor::empty();
 	assert(engine);
@@ -96,15 +108,11 @@ Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
 	f.close();
 
 	// Create the correct engine
-	if (Glk::Alan2::Alan2MetaEngine::findGame(gameDesc._gameId.c_str())._description) {
-		*engine = new Glk::Alan2::Alan2(syst, gameDesc);
-	} else if (Glk::Frotz::FrotzMetaEngine::findGame(gameDesc._gameId.c_str())._description) {
-		*engine = new Glk::Frotz::Frotz(syst, gameDesc);
-	} else if (Glk::Glulxe::GlulxeMetaEngine::findGame(gameDesc._gameId.c_str())._description) {
-		*engine = new Glk::Glulxe::Glulxe(syst, gameDesc);
-	} else if (Glk::Scott::ScottMetaEngine::findGame(gameDesc._gameId.c_str())._description) {
-		*engine = new Glk::Scott::Scott(syst, gameDesc);
-	} else if ((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description) {
+	CREATE(Glk::Alan2::Alan2MetaEngine, Glk::Alan2::Alan2)
+	CREATE(Glk::Frotz::FrotzMetaEngine, Glk::Frotz::Frotz)
+	CREATE(Glk::Glulxe::GlulxeMetaEngine, Glk::Glulxe::Glulxe)
+	CREATE(Glk::Scott::ScottMetaEngine, Glk::Scott::Scott)
+	if (!((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description)) {
 		if (td._options & Glk::TADS::OPTION_TADS3)
 			*engine = new Glk::TADS::TADS3::TADS3(syst, gameDesc);
 		else
@@ -116,6 +124,8 @@ Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
 	return Common::kNoError;
 }
 
+#undef CREATE
+
 Common::String GlkMetaEngine::findFileByGameId(const Common::String &gameId) const {
 	// Get the list of files in the folder and return detection against them
 	Common::FSNode folder = Common::FSNode(ConfMan.get("path"));
diff --git a/engines/glk/frotz/config.cpp b/engines/glk/frotz/config.cpp
index 1d0264b..aff4679 100644
--- a/engines/glk/frotz/config.cpp
+++ b/engines/glk/frotz/config.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "glk/frotz/config.h"
+#include "glk/frotz/detection.h"
+#include "glk/glk.h"
 #include "common/config-manager.h"
 #include "common/textconsole.h"
 
@@ -162,5 +164,9 @@ UserOptions::UserOptions() : _undo_slots(MAX_UNDO_SLOTS), _sound(true), _quetzal
 	_defaultBackground = getConfigInt("background", 0x000080, 0xffffff);
 }
 
+bool UserOptions::isInfocom() const {
+	return g_vm->getOptions() & OPTION_INFOCOM;
+}
+
 } // End of namespace Scott
 } // End of namespace Glk
diff --git a/engines/glk/frotz/config.h b/engines/glk/frotz/config.h
index 17e787d..1086d7e 100644
--- a/engines/glk/frotz/config.h
+++ b/engines/glk/frotz/config.h
@@ -155,6 +155,11 @@ struct UserOptions {
 	 * Constructor
 	 */
 	UserOptions();
+
+	/**
+	 * Returns true if the game being played is one of the original Infocom releases
+	 */
+	bool isInfocom() const;
 };
 
 /**
diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp
index 57e2961..273ca37 100644
--- a/engines/glk/frotz/detection.cpp
+++ b/engines/glk/frotz/detection.cpp
@@ -41,8 +41,11 @@ void FrotzMetaEngine::getSupportedGames(PlainGameList &games) {
 
 GameDescriptor FrotzMetaEngine::findGame(const char *gameId) {
 	for (const PlainGameDescriptor *pd = INFOCOM_GAME_LIST; pd->gameId; ++pd) {
-		if (!strcmp(gameId, pd->gameId))
-			return *pd;
+		if (!strcmp(gameId, pd->gameId)) {
+			GameDescriptor gd(*pd);
+			gd._options |= OPTION_INFOCOM;
+			return gd;
+		}
 	}
 	for (const PlainGameDescriptor *pd = ZCODE_GAME_LIST; pd->gameId; ++pd) {
 		if (!strcmp(gameId, pd->gameId))
diff --git a/engines/glk/frotz/detection.h b/engines/glk/frotz/detection.h
index e0163bc..7943385 100644
--- a/engines/glk/frotz/detection.h
+++ b/engines/glk/frotz/detection.h
@@ -32,6 +32,13 @@
 namespace Glk {
 namespace Frotz {
 
+/**
+ * Game descriptor detection options
+ */
+enum DetectionOption {
+	OPTION_INFOCOM = 1
+};
+
 class FrotzMetaEngine {
 public:
 	/**
diff --git a/engines/glk/frotz/frotz.cpp b/engines/glk/frotz/frotz.cpp
index c2341d4..3d6bf6c 100644
--- a/engines/glk/frotz/frotz.cpp
+++ b/engines/glk/frotz/frotz.cpp
@@ -48,6 +48,8 @@ void Frotz::runGame(Common::SeekableReadStream *gameFile) {
 	story_fp = gameFile;
 	initialize();
 
+	debug("Game %s an Infocom original", isInfocom() ? "is" : "isn't");
+
 	// If save was selected from the launcher, handle loading it
 	int saveSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
 	if (saveSlot != -1) {
diff --git a/engines/glk/glk.h b/engines/glk/glk.h
index 55066e2..91a6371 100644
--- a/engines/glk/glk.h
+++ b/engines/glk/glk.h
@@ -60,6 +60,7 @@ struct GlkGameDescription {
 	Common::Platform _platform;
 	Common::String _filename;
 	Common::String _md5;
+	uint _options;
 };
 
 /**
@@ -164,6 +165,11 @@ public:
 	const Common::String &getFilename() const { return _gameDescription._filename; }
 
 	/**
+	 * Returns any options returned with the game's detection entry
+	 */
+	const uint getOptions() const { return _gameDescription._options; }
+
+	/**
 	 * Return the game engine's target name
 	 */
 	const Common::String &getTargetName() const {





More information about the Scummvm-git-logs mailing list