aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/scott
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-14 18:01:42 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit67275924b5255d7503fe8bd15c853cfec197c569 (patch)
tree8157208a17d4cb9ca87f666a396db1345cb97664 /engines/glk/scott
parent454f92cc74e1357b96ce06e8c77ed6c32cb30ba9 (diff)
downloadscummvm-rg350-67275924b5255d7503fe8bd15c853cfec197c569.tar.gz
scummvm-rg350-67275924b5255d7503fe8bd15c853cfec197c569.tar.bz2
scummvm-rg350-67275924b5255d7503fe8bd15c853cfec197c569.zip
GLK: Derive detection from MetaEngine rather than AdvancedMetaEngine
Diffstat (limited to 'engines/glk/scott')
-rw-r--r--engines/glk/scott/detection.cpp18
-rw-r--r--engines/glk/scott/detection.h10
-rw-r--r--engines/glk/scott/detection_tables.cpp85
-rw-r--r--engines/glk/scott/detection_tables.h80
-rw-r--r--engines/glk/scott/scott.cpp2
-rw-r--r--engines/glk/scott/scott.h2
6 files changed, 89 insertions, 108 deletions
diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp
index 523b02de52..a02e3c56ad 100644
--- a/engines/glk/scott/detection.cpp
+++ b/engines/glk/scott/detection.cpp
@@ -24,10 +24,25 @@
#include "glk/scott/detection_tables.h"
#include "common/file.h"
#include "common/md5.h"
+#include "engines/game.h"
namespace Glk {
namespace Scott {
+void ScottMetaEngine::getSupportedGames(PlainGameList &games) {
+ for (const PlainGameDescriptor *pd = SCOTT_GAME_LIST; pd->gameId; ++pd)
+ games.push_back(*pd);
+}
+
+PlainGameDescriptor ScottMetaEngine::findGame(const char *gameId) {
+ for (const PlainGameDescriptor *pd = SCOTT_GAME_LIST; pd->gameId; ++pd) {
+ if (!strcmp(gameId, pd->gameId))
+ return *pd;
+ }
+
+ return PlainGameDescriptor();;
+}
+
bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) {
Common::File gameFile;
Common::String md5;
@@ -48,7 +63,8 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
if (p->_filesize) {
// Found a match
- DetectedGame gd(p->_gameId, p->_desc, Common::EN_ANY, Common::kPlatformUnknown);
+ PlainGameDescriptor gameDesc = findGame(p->_gameId);
+ DetectedGame gd(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown);
gd.addExtraEntry("filename", file->getName());
gameList.push_back(gd);
diff --git a/engines/glk/scott/detection.h b/engines/glk/scott/detection.h
index 2c187cdc4a..384197c467 100644
--- a/engines/glk/scott/detection.h
+++ b/engines/glk/scott/detection.h
@@ -32,6 +32,16 @@ namespace Scott {
class ScottMetaEngine {
public:
/**
+ * Get a list of supported games
+ */
+ static void getSupportedGames(PlainGameList &games);
+
+ /**
+ * Returns a game description for the given game Id, if it's supported
+ */
+ static PlainGameDescriptor findGame(const char *gameId);
+
+ /**
* Detect supported games
*/
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList);
diff --git a/engines/glk/scott/detection_tables.cpp b/engines/glk/scott/detection_tables.cpp
deleted file mode 100644
index f9a2a6c03a..0000000000
--- a/engines/glk/scott/detection_tables.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "glk/scott/detection_tables.h"
-
-namespace Glk {
-namespace Scott {
-
-const char *const ADVENTURELAND_DESC = "Adventureland";
-const char *const PIRATE_ADVENTURE_DESC = "Pirate Adventure";
-const char *const MISSION_IMPOSSIBLE_DESC = "Mission Impossible";
-const char *const VOODOO_CASTLE_DESC = "Voodoo Castle";
-const char *const THE_COUNT_DESC = "The Count";
-const char *const STRANGE_ODYSSEY_DESC = "Strange Odyssey";
-const char *const MYSTERY_FUN_HOUSE_DESC = "Mystery Fun House";
-const char *const PYRAMID_OF_DOOM_DESC = "Pyramid Of Doom";
-const char *const GHOST_TOWN_DESC = "Ghost Town";
-const char *const SAVAGE_ISLAND1_DESC = "Savage Island, Part 1";
-const char *const SAVAGE_ISLAND2_DESC = "Savage Island, Part 2";
-const char *const THE_GOLDEN_VOYAGE_DESC = "The Golden Voyage";
-const char *const ADVENTURE13_DESC = "Adventure 13";
-const char *const ADVENTURE14_DESC = "Adventure 14";
-const char *const BUCKAROO_BANZAI_DESC = "Buckaroo Banzai";
-const char *const MARVEL_ADVENTURE_DESC = "Marvel Adventure #1";
-const char *const MINI_SAMPLER_DESC = "Adventure International's Mini-Adventure Sampler";
-
-const ScottGame SCOTT_GAMES[] = {
- // PC game versions
- { "7c6f495d757a54e73d259efc718d8024", "adventureland", 15896, ADVENTURELAND_DESC },
- { "ea535fa7684508410151b4561de1f323", "pirateadventure", 16325, PIRATE_ADVENTURE_DESC },
- { "379c77a9a483886366b3b5c425e56410", "missionimpossible", 15275, MISSION_IMPOSSIBLE_DESC },
- { "a530a6857d1092eaa177eee575c94c71", "voodoocastle", 15852, VOODOO_CASTLE_DESC },
- { "5ebb4ade985670bb2eac54f8fa202214", "thecount", 17476, THE_COUNT_DESC },
- { "c57bb6df04dc77a2b232bc5bcab6e417", "strangeodyssey", 17489, STRANGE_ODYSSEY_DESC },
- { "ce2931ac3d5cbc270a5cb7be9e614f6e", "mysteryfunhouse", 17165, MYSTERY_FUN_HOUSE_DESC },
- { "4e6127fad6b5d75eccd3f3b101f8c9c8", "pyramidofdoom", 17673, PYRAMID_OF_DOOM_DESC },
- { "2c08327ab06d5490bd9e367ddaeca627", "ghosttown", 17831, GHOST_TOWN_DESC },
- { "8feb77f11d32e9567ce2fc7d435eaf44", "savageisland1", 19533, SAVAGE_ISLAND1_DESC },
- { "20c40a349f7a214ac515fb1d63c30a87", "savageisland2", 18367, SAVAGE_ISLAND2_DESC },
- { "e2a8f956ab215012d1495550c4c11ee8", "goldenvoyage", 18513, THE_GOLDEN_VOYAGE_DESC },
- { "f986d7e1ee074f65b6c1d00461c9b3c3", "adventure13", 19232, ADVENTURE13_DESC },
- { "6d98f422cc986d959a3c74351785aea3", "adventure14", 19013, ADVENTURE14_DESC },
- { "aadcc04e6b37eb9d30a58b5bc775842e", "marveladventure", 18876, MARVEL_ADVENTURE_DESC },
- { "d569a769f304dc02b3062d97458ddd01", "scottsampler", 13854, MINI_SAMPLER_DESC },
-
- // PDA game versions
- { "ae541fc1085da2f7d561b72ed20a6bc1", "adventureland", 18003, ADVENTURELAND_DESC },
- { "cbd47ab4fcfe00231ffd71d52378d410", "pirateadventure", 18482, PIRATE_ADVENTURE_DESC },
- { "9251ab2c64e63559d8a6e9e6246760a5", "missionimpossible", 17227, MISSION_IMPOSSIBLE_DESC },
- { "be849c5747c7fc3b201984afb4403b8e", "voodoocastle", 18140, VOODOO_CASTLE_DESC },
- { "85b75b6079b5ee572b5259b29a0e5d21", "thecount", 19999, THE_COUNT_DESC },
- { "c423cae841ac1927b5b2e503607b21bc", "strangeodyssey", 20115, STRANGE_ODYSSEY_DESC },
- { "326b98b991d401605074e64d474ce566", "mysteryfunhouse", 19700, MYSTERY_FUN_HOUSE_DESC },
- { "8ef9010399f055da9adb15ce7745a11c", "pyramidofdoom", 20320, PYRAMID_OF_DOOM_DESC },
- { "fcdcca8b2acf76ba2d0006cefa3630a1", "ghosttown", 20687, GHOST_TOWN_DESC },
- { "c8aaa80f07c40fa8e4b17432644919dc", "savageisland1", 22669, SAVAGE_ISLAND1_DESC },
- { "2add0f28d9b236c866890cdf8d86ee60", "savageisland2", 21169, SAVAGE_ISLAND2_DESC },
- { "675126bd0477e8ed9230ad3db5afc45f", "goldenvoyage", 21401, THE_GOLDEN_VOYAGE_DESC },
- { "0ef0def798d895ed766041fa99dd28a0", "adventure13", 22346, ADVENTURE13_DESC },
- { "0bf1bcc649422798332a38c88588fdff", "adventure14", 22087, ADVENTURE14_DESC },
- { "a0a5423967287dae9cbeb9abe8324479", "buckaroobanzai", 21038, BUCKAROO_BANZAI_DESC },
- { nullptr, nullptr, 0, nullptr }
-};
-
-} // End of namespace Frotz
-} // End of namespace Glk
diff --git a/engines/glk/scott/detection_tables.h b/engines/glk/scott/detection_tables.h
index 6365bde638..37a016393a 100644
--- a/engines/glk/scott/detection_tables.h
+++ b/engines/glk/scott/detection_tables.h
@@ -20,7 +20,8 @@
*
*/
-#include "engines/advancedDetector.h"
+#include "engines/game.h"
+#include "common/gui_options.h"
#include "common/language.h"
namespace Glk {
@@ -33,27 +34,66 @@ struct ScottGame {
const char *_md5;
const char *_gameId;
int32 _filesize;
- const char *_desc;
};
-extern const ScottGame SCOTT_GAMES[];
-extern const char *const ADVENTURELAND_DESC;
-extern const char *const PIRATE_ADVENTURE_DESC;
-extern const char *const MISSION_IMPOSSIBLE_DESC;
-extern const char *const VOODOO_CASTLE_DESC;
-extern const char *const THE_COUNT_DESC;
-extern const char *const STRANGE_ODYSSEY_DESC;
-extern const char *const MYSTERY_FUN_HOUSE_DESC;
-extern const char *const PYRAMID_OF_DOOM_DESC;
-extern const char *const GHOST_TOWN_DESC;
-extern const char *const SAVAGE_ISLAND1_DESC;
-extern const char *const SAVAGE_ISLAND2_DESC;
-extern const char *const THE_GOLDEN_VOYAGE_DESC;
-extern const char *const ADVENTURE13_DESC;
-extern const char *const ADVENTURE14_DESC;
-extern const char *const BUCKAROO_BANZAI_DESC;
-extern const char *const MARVEL_ADVENTURE_DESC;
-extern const char *const MINI_SAMPLER_DESC;
+const PlainGameDescriptor SCOTT_GAME_LIST[] = {
+ { "adventureland", "Adventureland" },
+ { "pirateadventure", "Pirate Adventure" },
+ { "missionimpossible", "Mission Impossible" },
+ { "voodoocastle", "Voodoo Castle" },
+ { "thecount", "The Count" },
+ { "strangeodyssey", "Strange Odyssey" },
+ { "mysteryfunhouse", "Mystery Fun House" },
+ { "pyramidofdoom", "Pyramid Of Doom" },
+ { "ghosttown", "Ghost Town" },
+ { "savageisland1", "Savage Island, Part 1" },
+ { "savageisland2", "Savage Island, Part 2" },
+ { "goldenvoyage", "The Golden Voyage" },
+ { "adventure13", "Adventure 13" },
+ { "adventure14", "Adventure 14" },
+ { "buckaroobanzai", "Buckaroo Banzai" },
+ { "marveladventure", "Marvel Adventure #1" },
+ { "scottsampler", "Adventure International's Mini-Adventure Sampler" },
+ { nullptr, nullptr }
+};
+
+const ScottGame SCOTT_GAMES[] = {
+ // PC game versions
+ { "7c6f495d757a54e73d259efc718d8024", "adventureland", 15896 },
+ { "ea535fa7684508410151b4561de1f323", "pirateadventure", 16325 },
+ { "379c77a9a483886366b3b5c425e56410", "missionimpossible", 15275 },
+ { "a530a6857d1092eaa177eee575c94c71", "voodoocastle", 15852 },
+ { "5ebb4ade985670bb2eac54f8fa202214", "thecount", 17476 },
+ { "c57bb6df04dc77a2b232bc5bcab6e417", "strangeodyssey", 17489 },
+ { "ce2931ac3d5cbc270a5cb7be9e614f6e", "mysteryfunhouse", 17165 },
+ { "4e6127fad6b5d75eccd3f3b101f8c9c8", "pyramidofdoom", 17673 },
+ { "2c08327ab06d5490bd9e367ddaeca627", "ghosttown", 17831 },
+ { "8feb77f11d32e9567ce2fc7d435eaf44", "savageisland1", 19533 },
+ { "20c40a349f7a214ac515fb1d63c30a87", "savageisland2", 18367 },
+ { "e2a8f956ab215012d1495550c4c11ee8", "goldenvoyage", 18513 },
+ { "f986d7e1ee074f65b6c1d00461c9b3c3", "adventure13", 19232 },
+ { "6d98f422cc986d959a3c74351785aea3", "adventure14", 19013 },
+ { "aadcc04e6b37eb9d30a58b5bc775842e", "marveladventure", 18876 },
+ { "d569a769f304dc02b3062d97458ddd01", "scottsampler", 13854 },
+
+ // PDA game versions
+ { "ae541fc1085da2f7d561b72ed20a6bc1", "adventureland", 18003 },
+ { "cbd47ab4fcfe00231ffd71d52378d410", "pirateadventure", 18482 },
+ { "9251ab2c64e63559d8a6e9e6246760a5", "missionimpossible", 17227 },
+ { "be849c5747c7fc3b201984afb4403b8e", "voodoocastle", 18140 },
+ { "85b75b6079b5ee572b5259b29a0e5d21", "thecount", 19999 },
+ { "c423cae841ac1927b5b2e503607b21bc", "strangeodyssey", 20115 },
+ { "326b98b991d401605074e64d474ce566", "mysteryfunhouse", 19700 },
+ { "8ef9010399f055da9adb15ce7745a11c", "pyramidofdoom", 20320 },
+ { "fcdcca8b2acf76ba2d0006cefa3630a1", "ghosttown", 20687 },
+ { "c8aaa80f07c40fa8e4b17432644919dc", "savageisland1", 22669 },
+ { "2add0f28d9b236c866890cdf8d86ee60", "savageisland2", 21169 },
+ { "675126bd0477e8ed9230ad3db5afc45f", "goldenvoyage", 21401 },
+ { "0ef0def798d895ed766041fa99dd28a0", "adventure13", 22346 },
+ { "0bf1bcc649422798332a38c88588fdff", "adventure14", 22087 },
+ { "a0a5423967287dae9cbeb9abe8324479", "buckaroobanzai", 21038 },
+ { nullptr, nullptr, 0 }
+};
} // End of namespace Frotz
} // End of namespace Glk
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index 2def1a2a74..6fedab1644 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -26,7 +26,7 @@
namespace Glk {
namespace Scott {
-Scott::Scott(OSystem *syst, const GlkGameDescription *gameDesc) : GlkAPI(syst, gameDesc),
+Scott::Scott(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc),
Items(nullptr), Rooms(nullptr), Verbs(nullptr), Nouns(nullptr), Messages(nullptr),
Actions(nullptr), CurrentCounter(0), SavedRoom(0), Options(0), Width(0), TopHeight(0),
split_screen(true), Bottom(0), Top(0), BitFlags(0), _saveSlot(-1) {
diff --git a/engines/glk/scott/scott.h b/engines/glk/scott/scott.h
index 68994855fb..cf5f7bd644 100644
--- a/engines/glk/scott/scott.h
+++ b/engines/glk/scott/scott.h
@@ -167,7 +167,7 @@ public:
/**
* Constructor
*/
- Scott(OSystem *syst, const GlkGameDescription *gameDesc);
+ Scott(OSystem *syst, const GlkGameDescription &gameDesc);
/**
* Execute the game