[Scummvm-git-logs] scummvm master -> 6919e71608b7ff0db99c57fbb3abd7e0220f0fd0
bgK
bastien.bouclet at gmail.com
Sun Nov 3 11:43:11 CET 2019
This automated email contains information about 12 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4b42112721 ENGINES: Add an engine ID to all the engines
9c8bd056d6 ENGINES: Stop using 'single id'
bb813719b5 ENGINES: Change targets to have an 'engine ID'
ae9f764c7a ENGINES: Automatically upgrade the targets on launch to add an engine ID
3d34c3e5c0 MOHAWK: Stop relying on the target to detect the current game
47a2b2a9a2 BASE: Add a command line option to list the engines
c142838122 BASE: Change the command line interface to use engine-qualified game names
780db83e13 DC: Update for the engineId changes
d5bab0cd2a CRYO: Revert copyright string change
8ba2d22407 ENGINES: Remove useless TODO
3c0abc0800 BASE: Remove the engines/games alphabetical sort
6919e71608 DOC: Update the documentation for engineId
Commit: 4b42112721a3a12ee10652f2c1dfcd227ab140b3
https://github.com/scummvm/scummvm/commit/4b42112721a3a12ee10652f2c1dfcd227ab140b3
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
ENGINES: Add an engine ID to all the engines
Changed paths:
engines/access/detection.cpp
engines/adl/detection.cpp
engines/agi/detection.cpp
engines/agos/detection.cpp
engines/avalanche/detection.cpp
engines/bbvs/detection.cpp
engines/bladerunner/detection.cpp
engines/cge/detection.cpp
engines/cge2/detection.cpp
engines/chewy/detection.cpp
engines/cine/detection.cpp
engines/composer/detection.cpp
engines/cruise/detection.cpp
engines/cryo/detection.cpp
engines/cryomni3d/detection.cpp
engines/director/detection.cpp
engines/dm/detection.cpp
engines/draci/detection.cpp
engines/drascula/detection.cpp
engines/dreamweb/detection.cpp
engines/fullpipe/detection.cpp
engines/glk/detection.h
engines/gnap/detection.cpp
engines/gob/detection/detection.cpp
engines/groovie/detection.cpp
engines/hdb/detection.cpp
engines/hopkins/detection.cpp
engines/hugo/detection.cpp
engines/illusions/detection.cpp
engines/kyra/detection.cpp
engines/lab/detection.cpp
engines/lastexpress/detection.cpp
engines/lilliput/detection.cpp
engines/lure/detection.cpp
engines/macventure/detection.cpp
engines/made/detection.cpp
engines/mads/detection.cpp
engines/mohawk/detection.cpp
engines/mortevielle/detection.cpp
engines/mutationofjb/detection.cpp
engines/neverhood/detection.cpp
engines/parallaction/detection.cpp
engines/pegasus/detection.cpp
engines/pink/detection.cpp
engines/plumbers/detection.cpp
engines/prince/detection.cpp
engines/queen/detection.cpp
engines/saga/detection.cpp
engines/sci/detection.cpp
engines/scumm/detection.cpp
engines/sherlock/detection.cpp
engines/sky/detection.cpp
engines/sludge/detection.cpp
engines/startrek/detection.cpp
engines/supernova/detection.cpp
engines/sword1/detection.cpp
engines/sword2/sword2.cpp
engines/sword25/detection.cpp
engines/teenagent/detection.cpp
engines/testbed/detection.cpp
engines/tinsel/detection.cpp
engines/titanic/detection.cpp
engines/toltecs/detection.cpp
engines/tony/detection.cpp
engines/toon/detection.cpp
engines/touche/detection.cpp
engines/tsage/detection.cpp
engines/tucker/detection.cpp
engines/voyeur/detection.cpp
engines/wage/detection.cpp
engines/wintermute/detection.cpp
engines/xeen/detection.cpp
engines/zvision/detection.cpp
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp
index 4e5ef84..bf944b7 100644
--- a/engines/access/detection.cpp
+++ b/engines/access/detection.cpp
@@ -89,6 +89,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "access";
+ }
+
virtual const char *getName() const {
return "Access";
}
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index d0a6a65..6496290 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -368,6 +368,10 @@ public:
return "ADL";
}
+ const char *getEngineId() const {
+ return "adl";
+ }
+
const char *getOriginalCopyright() const override {
return "Copyright (C) Sierra On-Line";
}
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index b442660..eda6c18 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -206,9 +206,14 @@ public:
_guiOptions = GUIO1(GUIO_NOSPEECH);
}
+ const char *getEngineId() const {
+ return "agi";
+ }
+
virtual const char *getName() const {
return "AGI preAGI + v2 + v3";
}
+
virtual const char *getOriginalCopyright() const {
return "Sierra AGI Engine (C) Sierra On-Line Software";
}
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 1847434..568e207 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -103,6 +103,10 @@ public:
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
+ const char *getEngineId() const {
+ return "agos";
+ }
+
virtual const char *getName() const {
return "AGOS";
}
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index d6f59a6..4eefe57 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -78,6 +78,10 @@ public:
AvalancheMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(AvalancheGameDescription), avalancheGames) {
}
+ const char *getEngineId() const {
+ return "avalanche";
+ }
+
const char *getName() const {
return "Avalanche";
}
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index 9b072c0..6966719 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -74,6 +74,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ const char *getEngineId() const {
+ return "bbvs";
+ }
+
virtual const char *getName() const {
return "MTV's Beavis and Butt-head in Virtual Stupidity";
}
diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp
index 26772e2..4576ae6 100644
--- a/engines/bladerunner/detection.cpp
+++ b/engines/bladerunner/detection.cpp
@@ -78,6 +78,7 @@ class BladeRunnerMetaEngine : public AdvancedMetaEngine {
public:
BladeRunnerMetaEngine();
+ const char *getEngineId() const;
const char *getName() const override;
const char *getOriginalCopyright() const override;
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
@@ -95,6 +96,9 @@ BladeRunnerMetaEngine::BladeRunnerMetaEngine()
BladeRunner::bladeRunnerGames,
BladeRunner::optionsList) {}
+const char *BladeRunnerMetaEngine::getEngineId() const {
+ return "bladerunner";
+}
const char *BladeRunnerMetaEngine::getName() const {
return "Blade Runner";
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index f6399d4..8277b09 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -118,6 +118,10 @@ public:
_singleId = "soltys";
}
+ const char *getEngineId() const {
+ return "cge";
+ }
+
virtual const char *getName() const {
return "CGE";
}
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index ec6925a..cc4fd71 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -124,6 +124,10 @@ public:
_singleId = "sfinx";
}
+ const char *getEngineId() const {
+ return "cge2";
+ }
+
virtual const char *getName() const {
return "CGE2";
}
diff --git a/engines/chewy/detection.cpp b/engines/chewy/detection.cpp
index 75176c9..1374799 100644
--- a/engines/chewy/detection.cpp
+++ b/engines/chewy/detection.cpp
@@ -118,6 +118,10 @@ public:
_singleId = "chewy";
}
+ const char *getEngineId() const {
+ return "chewy";
+ }
+
virtual const char *getName() const {
return "Chewy: Esc from F5";
}
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index a41bc47..441ec0d 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -88,6 +88,10 @@ public:
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
+ const char *getEngineId() const {
+ return "cine";
+ }
+
virtual const char *getName() const {
return "Cinematique evo 1";
}
diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp
index 4ab08251..8f4bab1 100644
--- a/engines/composer/detection.cpp
+++ b/engines/composer/detection.cpp
@@ -485,6 +485,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ const char *getEngineId() const {
+ return "composer";
+ }
+
virtual const char *getName() const {
return "Magic Composer";
}
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index 4f63fd2..f75df97 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -200,6 +200,10 @@ public:
_guiOptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI);
}
+ const char *getEngineId() const {
+ return "cruise";
+ }
+
virtual const char *getName() const {
return "Cinematique evo 2";
}
diff --git a/engines/cryo/detection.cpp b/engines/cryo/detection.cpp
index 4c189b9..b269d06 100644
--- a/engines/cryo/detection.cpp
+++ b/engines/cryo/detection.cpp
@@ -136,6 +136,10 @@ public:
_singleId = "losteden";
}
+ const char *getEngineId() const {
+ return "cryo";
+ }
+
virtual const char *getName() const {
return "Cryo";
}
diff --git a/engines/cryomni3d/detection.cpp b/engines/cryomni3d/detection.cpp
index 6095185..9cb5a67 100644
--- a/engines/cryomni3d/detection.cpp
+++ b/engines/cryomni3d/detection.cpp
@@ -129,6 +129,10 @@ public:
return detectGameFilebased(allFiles, fslist, CryOmni3D::fileBased);
}
+ const char *getEngineId() const {
+ return "cryomni3d";
+ }
+
virtual const char *getName() const {
return "Cryo Omni3D";
}
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index 9d29384..6634fc4 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -104,6 +104,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ virtual const char *getEngineId() const {
+ return "director";
+ }
+
virtual const char *getName() const {
return "Macromedia Director";
}
diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp
index 8f7c439..8b745bb 100644
--- a/engines/dm/detection.cpp
+++ b/engines/dm/detection.cpp
@@ -101,6 +101,10 @@ public:
_singleId = "dm";
}
+ virtual const char *getEngineId() const {
+ return "dm";
+ }
+
virtual const char *getName() const {
return "Dungeon Master";
}
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 63cd8a2..8fd62cc 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -87,6 +87,10 @@ public:
_singleId = "draci";
}
+ const char *getEngineId() const {
+ return "draci";
+ }
+
virtual const char *getName() const {
return "Draci Historie";
}
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 56e1b35..3c67147 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -343,6 +343,10 @@ public:
_guiOptions = GUIO1(GUIO_NOMIDI);
}
+ const char *getEngineId() const {
+ return "drascula";
+ }
+
virtual const char *getName() const {
return "Drascula: The Vampire Strikes Back";
}
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index ddaccc7..bbb7077 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -75,6 +75,10 @@ public:
_guiOptions = GUIO1(GUIO_NOMIDI);
}
+ const char *getEngineId() const {
+ return "dreamweb";
+ }
+
virtual const char *getName() const {
return "DreamWeb";
}
diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp
index 358d3c6..a76b473 100644
--- a/engines/fullpipe/detection.cpp
+++ b/engines/fullpipe/detection.cpp
@@ -133,6 +133,10 @@ public:
_singleId = "fullpipe";
}
+ const char *getEngineId() const {
+ return "fullpipe";
+ }
+
virtual const char *getName() const {
return "Full Pipe";
}
diff --git a/engines/glk/detection.h b/engines/glk/detection.h
index 2a63c59..2e1a8c5 100644
--- a/engines/glk/detection.h
+++ b/engines/glk/detection.h
@@ -41,6 +41,10 @@ public:
return "Glk";
}
+ const char *getEngineId() const {
+ return "glk";
+ }
+
virtual const char *getOriginalCopyright() const {
return "Infocom games (C) Infocom\nScott Adams games (C) Scott Adams";
}
diff --git a/engines/gnap/detection.cpp b/engines/gnap/detection.cpp
index 97c9128..f792fe5 100644
--- a/engines/gnap/detection.cpp
+++ b/engines/gnap/detection.cpp
@@ -82,6 +82,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "gnap";
+ }
+
virtual const char *getName() const {
return "Gnap";
}
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index 70fea40..2a51961 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -35,6 +35,10 @@ public:
PlainGameDescriptor findGame(const char *gameId) const override;
+ const char *getEngineId() const {
+ return "gob";
+ }
+
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;
virtual const char *getName() const;
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 17e0569..0aa06de 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -351,6 +351,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ const char *getEngineId() const {
+ return "groovie";
+ }
+
const char *getName() const {
return "Groovie";
}
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index 60b0db0..4cb7b03 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -170,6 +170,10 @@ public:
_singleId = "hdb";
}
+ const char *getEngineId() const {
+ return "hdb";
+ }
+
virtual const char *getName() const {
return "Hyperspace Delivery Boy!";
}
diff --git a/engines/hopkins/detection.cpp b/engines/hopkins/detection.cpp
index d9e11f9..4f6039b 100644
--- a/engines/hopkins/detection.cpp
+++ b/engines/hopkins/detection.cpp
@@ -106,6 +106,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ virtual const char *getEngineId() const {
+ return "hopkins";
+ }
+
virtual const char *getName() const {
return "Hopkins FBI";
}
diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index 6d2fec5..88911cd 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -136,6 +136,10 @@ public:
HugoMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(HugoGameDescription), hugoGames) {
}
+ const char *getEngineId() const {
+ return "hugo";
+ }
+
const char *getName() const {
return "Hugo";
}
diff --git a/engines/illusions/detection.cpp b/engines/illusions/detection.cpp
index 024dea2..18c5018 100644
--- a/engines/illusions/detection.cpp
+++ b/engines/illusions/detection.cpp
@@ -120,6 +120,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ const char *getEngineId() const {
+ return "illusions";
+ }
+
virtual const char *getName() const {
return "Illusions";
}
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 75d608d..8f37d29 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -156,6 +156,11 @@ public:
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
+
+ const char *getEngineId() const {
+ return "kyra";
+ }
+
const char *getName() const {
return "Kyra";
}
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index 6e4c902..009bd5c 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -122,6 +122,10 @@ public:
_flags = kADFlagUseExtraAsHint;
}
+ const char *getEngineId() const {
+ return "lab";
+ }
+
virtual const char *getName() const {
return "Labyrinth of Time";
}
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 608fe9b..3e6aa3a 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -231,6 +231,10 @@ public:
_guiOptions = GUIO2(GUIO_NOSUBTITLES, GUIO_NOSFX);
}
+ const char *getEngineId() const {
+ return "lastexpress";
+ }
+
const char *getName() const {
return "The Last Express";
}
diff --git a/engines/lilliput/detection.cpp b/engines/lilliput/detection.cpp
index eef513e..6ecb8f9 100644
--- a/engines/lilliput/detection.cpp
+++ b/engines/lilliput/detection.cpp
@@ -126,6 +126,10 @@ public:
LilliputMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(LilliputGameDescription), lilliputGames) {
}
+ const char *getEngineId() const {
+ return "lilliput";
+ }
+
const char *getName() const {
return "Lilliput";
}
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index ae9e2b0..b9473b2 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -215,6 +215,10 @@ public:
_guiOptions = GUIO1(GUIO_NOSPEECH);
}
+ const char *getEngineId() const {
+ return "lure";
+ }
+
virtual const char *getName() const {
return "Lure of the Temptress";
}
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index 007c599..5c419e8 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -66,7 +66,16 @@ public:
const char *getName() const {
return "MacVenture";
}
- const char *getOriginalCopyright() const {
+
+ const char *getEngineId() const override {
+ return "macventure";
+ }
+
+ const char *getName() const override {
+ return "MacVenture";
+ }
+
+ const char *getOriginalCopyright() const override {
return "(C) ICOM Simulations";
}
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index 26a9484..71e2de6 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -60,6 +60,10 @@ public:
_singleId = "made";
}
+ const char *getEngineId() const {
+ return "made";
+ }
+
virtual const char *getName() const {
return "MADE";
}
diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp
index b729bdf..77df3a0 100644
--- a/engines/mads/detection.cpp
+++ b/engines/mads/detection.cpp
@@ -144,6 +144,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "mads";
+ }
+
virtual const char *getName() const {
return "MADS";
}
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 075e7d2..278cce2 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -205,6 +205,10 @@ public:
return detectGameFilebased(allFiles, fslist, Mohawk::fileBased);
}
+ const char *getEngineId() const {
+ return "mohawk";
+ }
+
const char *getName() const override {
return "Mohawk";
}
diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index c4a4841..fc1acff 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -60,6 +60,11 @@ public:
// (i.e. use or not of the game data file).
_flags = kADFlagUseExtraAsHint;
}
+
+ const char *getEngineId() const {
+ return "mortevielle";
+ }
+
virtual const char *getName() const {
return "Mortville Manor";
}
diff --git a/engines/mutationofjb/detection.cpp b/engines/mutationofjb/detection.cpp
index c528c72..7dd523b 100644
--- a/engines/mutationofjb/detection.cpp
+++ b/engines/mutationofjb/detection.cpp
@@ -92,6 +92,10 @@ public:
_directoryGlobs = mutationofjbDirectoryGlobs;
}
+ const char *getEngineId() const {
+ return "mutationofjb";
+ }
+
virtual const char *getName() const override {
return "Mutation of J.B.";
}
diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp
index 0054301..dcaf653 100644
--- a/engines/neverhood/detection.cpp
+++ b/engines/neverhood/detection.cpp
@@ -202,6 +202,10 @@ public:
_guiOptions = GUIO2(GUIO_NOSUBTITLES, GUIO_NOMIDI);
}
+ const char *getEngineId() const {
+ return "neverhood";
+ }
+
virtual const char *getName() const {
return "The Neverhood Chronicles";
}
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index 4c52990..f4dcc16 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -223,6 +223,10 @@ public:
_guiOptions = GUIO1(GUIO_NOLAUNCHLOAD);
}
+ virtual const char *getEngineId() const {
+ return "parallaction";
+ }
+
virtual const char *getName() const {
return "Parallaction";
}
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index 64240af..fbacf09 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -138,6 +138,10 @@ public:
_singleId = "pegasus";
}
+ virtual const char *getEngineId() const {
+ return "pegasus";
+ }
+
virtual const char *getName() const {
return "The Journeyman Project: Pegasus Prime";
}
diff --git a/engines/pink/detection.cpp b/engines/pink/detection.cpp
index a25fd26..c57c81b 100644
--- a/engines/pink/detection.cpp
+++ b/engines/pink/detection.cpp
@@ -56,6 +56,10 @@ public:
_directoryGlobs = directoryGlobs;
}
+ virtual const char *getEngineId() const {
+ return "pink";
+ }
+
virtual const char *getName() const {
return "Pink Panther";
}
diff --git a/engines/plumbers/detection.cpp b/engines/plumbers/detection.cpp
index 7f8e350..6a5e81f 100644
--- a/engines/plumbers/detection.cpp
+++ b/engines/plumbers/detection.cpp
@@ -76,6 +76,10 @@ public:
_singleId = "plumbers";
}
+ const char *getEngineId() const {
+ return "plumbers";
+ }
+
virtual const char *getName() const {
return "Plumbers Don't Wear Ties";
}
diff --git a/engines/prince/detection.cpp b/engines/prince/detection.cpp
index 2d1cc30..400c2da 100644
--- a/engines/prince/detection.cpp
+++ b/engines/prince/detection.cpp
@@ -153,10 +153,14 @@ public:
_directoryGlobs = directoryGlobs;
}
- virtual const char *getName() const {
- return "The Prince and the Coward";
+ const char *getEngineId() const {
+ return "prince";
}
+ virtual const char *getName() const {
+ return "The Prince and the Coward";
+ }
+
virtual const char *getOriginalCopyright() const {
return "The Prince and the Coward (C) 1996-97 Metropolis";
}
diff --git a/engines/queen/detection.cpp b/engines/queen/detection.cpp
index 447dfd9..ed8f3dd 100644
--- a/engines/queen/detection.cpp
+++ b/engines/queen/detection.cpp
@@ -485,6 +485,10 @@ public:
_singleId = "queen";
}
+ const char *getEngineId() const {
+ return "queen";
+ }
+
virtual const char *getName() const {
return "Flight of the Amazon Queen";
}
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 8b5893c..7137565 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -109,6 +109,10 @@ public:
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
+ const char *getEngineId() const {
+ return "saga";
+ }
+
virtual const char *getName() const {
return "SAGA ["
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 5d11d10..8e766c8 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -564,6 +564,10 @@ public:
_matchFullPaths = true;
}
+ const char *getEngineId() const {
+ return "sci";
+ }
+
virtual const char *getName() const {
return "SCI ["
#ifdef ENABLE_SCI32
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index a5bba29..adfc7a3 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -964,6 +964,10 @@ using namespace Scumm;
class ScummMetaEngine : public MetaEngine {
public:
+ virtual const char *getEngineId() const {
+ return "scumm";
+ }
+
virtual const char *getName() const;
virtual const char *getOriginalCopyright() const;
diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp
index ff253a1..e886bfc 100644
--- a/engines/sherlock/detection.cpp
+++ b/engines/sherlock/detection.cpp
@@ -136,6 +136,10 @@ public:
SherlockMetaEngine() : AdvancedMetaEngine(Sherlock::gameDescriptions, sizeof(Sherlock::SherlockGameDescription),
sherlockGames, optionsList) {}
+ virtual const char *getEngineId() const {
+ return "sherlock";
+ }
+
virtual const char *getName() const {
return "Sherlock";
}
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 0febe9e..1934d84 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -75,6 +75,10 @@ public:
virtual const char *getName() const;
virtual const char *getOriginalCopyright() const;
+ const char *getEngineId() const {
+ return "sky";
+ }
+
virtual bool hasFeature(MetaEngineFeature f) const;
PlainGameList getSupportedGames() const override;
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
diff --git a/engines/sludge/detection.cpp b/engines/sludge/detection.cpp
index 876614e..1f005ea 100644
--- a/engines/sludge/detection.cpp
+++ b/engines/sludge/detection.cpp
@@ -83,6 +83,10 @@ public:
_maxScanDepth = 1;
}
+ const char *getEngineId() const {
+ return "sludge";
+ }
+
virtual const char *getName() const {
return "Sludge";
}
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 2994e60..7d47d5e 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -324,6 +324,10 @@ public:
_singleId = "startrek";
}
+ const char *getEngineId() const {
+ return "startrek";
+ }
+
virtual const char *getName() const {
return "Star Trek";
}
diff --git a/engines/supernova/detection.cpp b/engines/supernova/detection.cpp
index 4041543..f225601 100644
--- a/engines/supernova/detection.cpp
+++ b/engines/supernova/detection.cpp
@@ -103,6 +103,10 @@ public:
// _singleId = "supernova";
}
+ const char *getEngineId() const {
+ return "supernova";
+ }
+
virtual const char *getName() const {
return "Mission Supernova";
}
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 2e52588..a02b02b 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -79,6 +79,10 @@ static const char *const g_filesToCheck[NUM_FILES_TO_CHECK] = { // these files h
class SwordMetaEngine : public MetaEngine {
public:
+ virtual const char *getEngineId() const {
+ return "sword1";
+ }
+
virtual const char *getName() const {
return "Broken Sword: The Shadow of the Templars";
}
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 453efb4..4e67f0d 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -84,6 +84,10 @@ static const ExtraGuiOption sword2ExtraGuiOption = {
class Sword2MetaEngine : public MetaEngine {
public:
+ virtual const char *getEngineId() const {
+ return "sword2";
+ }
+
virtual const char *getName() const {
return "Broken Sword II: The Smoking Mirror";
}
diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp
index 2c91961..44e3f34 100644
--- a/engines/sword25/detection.cpp
+++ b/engines/sword25/detection.cpp
@@ -56,6 +56,11 @@ public:
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
+
+ const char *getEngineId() const {
+ return "sword25";
+ }
+
virtual const char *getName() const {
return "Broken Sword 2.5";
}
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index d73068e..5601f48 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -91,6 +91,10 @@ public:
_singleId = "teenagent";
}
+ const char *getEngineId() const {
+ return "teenagent";
+ }
+
virtual const char *getName() const {
return "TeenAgent";
}
diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index 7aff7a1..86199ae 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -52,6 +52,10 @@ public:
_singleId = "testbed";
}
+ const char *getEngineId() const {
+ return "testbed";
+ }
+
virtual const char *getName() const {
return "TestBed: The Backend Testing Framework";
}
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index a68ce0b..408247b 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -88,6 +88,10 @@ public:
_singleId = "tinsel";
}
+ const char *getEngineId() const {
+ return "tinsel";
+ }
+
virtual const char *getName() const {
return "Tinsel";
}
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index ecb90c9..e4e8f5a 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -62,6 +62,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "titanic";
+ }
+
virtual const char *getName() const {
return "Starship Titanic";
}
diff --git a/engines/toltecs/detection.cpp b/engines/toltecs/detection.cpp
index a2a28e8..d372c30 100644
--- a/engines/toltecs/detection.cpp
+++ b/engines/toltecs/detection.cpp
@@ -223,6 +223,10 @@ public:
_singleId = "toltecs";
}
+ const char *getEngineId() const {
+ return "toltecs";
+ }
+
virtual const char *getName() const {
return "3 Skulls of the Toltecs";
}
diff --git a/engines/tony/detection.cpp b/engines/tony/detection.cpp
index 5cc592a..62e6a17 100644
--- a/engines/tony/detection.cpp
+++ b/engines/tony/detection.cpp
@@ -71,6 +71,10 @@ public:
TonyMetaEngine() : AdvancedMetaEngine(Tony::gameDescriptions, sizeof(Tony::TonyGameDescription), tonyGames) {
}
+ virtual const char *getEngineId() const {
+ return "tony";
+ }
+
virtual const char *getName() const {
return "Tony Tough and the Night of Roasted Moths";
}
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index da414ae..ece06df 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -146,6 +146,10 @@ public:
return detectGameFilebased(allFiles, fslist, Toon::fileBasedFallback);
}
+ const char *getEngineId() const {
+ return "toon";
+ }
+
virtual const char *getName() const {
return "Toonstruck";
}
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index c9c596e..1d96259 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -137,6 +137,10 @@ public:
return detectGameFilebased(allFiles, fslist, Touche::fileBasedFallback);
}
+ const char *getEngineId() const {
+ return "touche";
+ }
+
virtual const char *getName() const {
return "Touche: The Adventures of the Fifth Musketeer";
}
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index 5d31cca..f10b932 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -78,6 +78,10 @@ public:
_singleId = "tsage";
}
+ const char *getEngineId() const {
+ return "tsage";
+ }
+
virtual const char *getName() const {
return "TsAGE";
}
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index 36574b8..39ecf15 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -128,6 +128,10 @@ public:
_singleId = "tucker";
}
+ const char *getEngineId() const {
+ return "tucker";
+ }
+
virtual const char *getName() const {
return "Bud Tucker in Double Trouble";
}
diff --git a/engines/voyeur/detection.cpp b/engines/voyeur/detection.cpp
index 4a51b554..287dbfe 100644
--- a/engines/voyeur/detection.cpp
+++ b/engines/voyeur/detection.cpp
@@ -70,6 +70,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "voyeur";
+ }
+
virtual const char *getName() const {
return "Voyeur";
}
diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp
index 6f09fc7..75bfa96 100644
--- a/engines/wage/detection.cpp
+++ b/engines/wage/detection.cpp
@@ -59,6 +59,11 @@ public:
_guiOptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI);
}
+ virtual const char *getEngineId() const {
+ return "wage";
+ }
+
+
virtual const char *getName() const {
return "World Adventure Game Engine";
}
diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp
index 0709b9a..6f3be39 100644
--- a/engines/wintermute/detection.cpp
+++ b/engines/wintermute/detection.cpp
@@ -93,6 +93,11 @@ public:
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
+
+ const char *getEngineId() const {
+ return "wintermute";
+ }
+
virtual const char *getName() const {
return "Wintermute";
}
diff --git a/engines/xeen/detection.cpp b/engines/xeen/detection.cpp
index 315b169..3a19172 100644
--- a/engines/xeen/detection.cpp
+++ b/engines/xeen/detection.cpp
@@ -121,6 +121,10 @@ public:
_maxScanDepth = 3;
}
+ virtual const char *getEngineId() const {
+ return "xeen";
+ }
+
virtual const char *getName() const {
return "Xeen";
}
diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp
index f14263f..50e5f9a 100644
--- a/engines/zvision/detection.cpp
+++ b/engines/zvision/detection.cpp
@@ -64,6 +64,10 @@ public:
_singleId = "zvision";
}
+ const char *getEngineId() const {
+ return "zvision";
+ }
+
virtual const char *getName() const {
return "Z-Vision";
}
Commit: 9c8bd056d6d597a10f7f653b559dc34cd2bd2be9
https://github.com/scummvm/scummvm/commit/9c8bd056d6d597a10f7f653b559dc34cd2bd2be9
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
ENGINES: Stop using 'single id'
Changed paths:
engines/access/detection.cpp
engines/agi/detection.cpp
engines/bbvs/detection.cpp
engines/cge/detection.cpp
engines/cge2/detection.cpp
engines/chewy/detection.cpp
engines/cine/detection.cpp
engines/composer/detection.cpp
engines/cruise/detection.cpp
engines/cryo/detection.cpp
engines/cryomni3d/detection.cpp
engines/director/detection.cpp
engines/dm/detection.cpp
engines/draci/detection.cpp
engines/drascula/detection.cpp
engines/dreamweb/detection.cpp
engines/fullpipe/detection.cpp
engines/gnap/detection.cpp
engines/gob/detection/detection.cpp
engines/gob/detection/tables.h
engines/groovie/detection.cpp
engines/hdb/detection.cpp
engines/illusions/detection.cpp
engines/lab/detection.cpp
engines/lastexpress/detection.cpp
engines/lure/detection.cpp
engines/made/detection.cpp
engines/mads/detection.cpp
engines/mohawk/detection.cpp
engines/mortevielle/detection.cpp
engines/neverhood/detection.cpp
engines/parallaction/detection.cpp
engines/pegasus/detection.cpp
engines/plumbers/detection.cpp
engines/prince/detection.cpp
engines/queen/detection.cpp
engines/saga/detection.cpp
engines/sci/detection.cpp
engines/sludge/detection.cpp
engines/startrek/detection.cpp
engines/supernova/detection.cpp
engines/teenagent/detection.cpp
engines/testbed/detection.cpp
engines/tinsel/detection.cpp
engines/toltecs/detection.cpp
engines/toon/detection.cpp
engines/touche/detection.cpp
engines/tsage/detection.cpp
engines/tucker/detection.cpp
engines/wage/detection.cpp
engines/wintermute/detection.cpp
engines/xeen/detection.cpp
engines/zvision/detection.cpp
engines/zvision/detection_tables.h
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp
index bf944b7..b452d25 100644
--- a/engines/access/detection.cpp
+++ b/engines/access/detection.cpp
@@ -75,7 +75,6 @@ Common::Platform AccessEngine::getPlatform() const {
} // End of namespace Access
static const PlainGameDescriptor AccessGames[] = {
- {"Access", "Access"},
{"amazon", "Amazon: Guardians of Eden"},
{"martian", "Martian Memorandum"},
{0, 0}
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index eda6c18..faf1215 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -202,7 +202,6 @@ class AgiMetaEngine : public AdvancedMetaEngine {
public:
AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames, optionsList) {
- _singleId = "agi";
_guiOptions = GUIO1(GUIO_NOSPEECH);
}
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index 6966719..19d1b62 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -69,7 +69,6 @@ static const char * const directoryGlobs[] = {
class BbvsMetaEngine : public AdvancedMetaEngine {
public:
BbvsMetaEngine() : AdvancedMetaEngine(Bbvs::gameDescriptions, sizeof(ADGameDescription), bbvsGames) {
- _singleId = "bbvs";
_maxScanDepth = 3;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index 8277b09..8a468dc 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -115,7 +115,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class CGEMetaEngine : public AdvancedMetaEngine {
public:
CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(ADGameDescription), CGEGames, optionsList) {
- _singleId = "soltys";
}
const char *getEngineId() const {
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index cc4fd71..5432a3b 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -121,7 +121,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class CGE2MetaEngine : public AdvancedMetaEngine {
public:
CGE2MetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), CGE2Games, optionsList) {
- _singleId = "sfinx";
}
const char *getEngineId() const {
diff --git a/engines/chewy/detection.cpp b/engines/chewy/detection.cpp
index 1374799..2206202 100644
--- a/engines/chewy/detection.cpp
+++ b/engines/chewy/detection.cpp
@@ -115,7 +115,6 @@ public:
ChewyMetaEngine() : AdvancedMetaEngine(Chewy::gameDescriptions, sizeof(Chewy::ChewyGameDescription), chewyGames) {
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
- _singleId = "chewy";
}
const char *getEngineId() const {
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 441ec0d..55e76c6 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -23,7 +23,6 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
-#include "engines/obsolete.h"
#include "common/system.h"
#include "common/textconsole.h"
@@ -49,18 +48,11 @@ Common::Platform CineEngine::getPlatform() const { return _gameDescription->desc
} // End of namespace Cine
static const PlainGameDescriptor cineGames[] = {
- {"cine", "Cinematique evo.1 engine game"},
{"fw", "Future Wars"},
{"os", "Operation Stealth"},
{0, 0}
};
-static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
- {"fw", "cine", Common::kPlatformUnknown},
- {"os", "cine", Common::kPlatformUnknown},
- {0, 0, Common::kPlatformUnknown}
-};
-
#include "cine/detection_tables.h"
static const ADExtraGuiOptionsMap optionsList[] = {
@@ -80,14 +72,9 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class CineMetaEngine : public AdvancedMetaEngine {
public:
CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames, optionsList) {
- _singleId = "cine";
_guiOptions = GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD);
}
- PlainGameDescriptor findGame(const char *gameId) const override {
- return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
- }
-
const char *getEngineId() const {
return "cine";
}
@@ -101,7 +88,6 @@ public:
}
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const {
- Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
return AdvancedMetaEngine::createInstance(syst, engine);
}
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp
index 8f4bab1..93a3a40 100644
--- a/engines/composer/detection.cpp
+++ b/engines/composer/detection.cpp
@@ -55,7 +55,6 @@ Common::Language ComposerEngine::getLanguage() const {
}
static const PlainGameDescriptor composerGames[] = {
- {"composer", "Composer Game"},
{"babayaga", "Magic Tales: Baba Yaga and the Magic Geese"},
{"darby", "Darby the Dragon"},
{"gregory", "Gregory and the Hot Air Balloon"},
@@ -480,7 +479,6 @@ static const char *directoryGlobs[] = {
class ComposerMetaEngine : public AdvancedMetaEngine {
public:
ComposerMetaEngine() : AdvancedMetaEngine(Composer::gameDescriptions, sizeof(Composer::ComposerGameDescription), composerGames) {
- _singleId = "composer";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index f75df97..e657318 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -48,7 +48,6 @@ Common::Platform CruiseEngine::getPlatform() const {
}
static const PlainGameDescriptor cruiseGames[] = {
- {"cruise", "Cinematique evo.2 engine game"},
{"cruise", "Cruise for a Corpse"},
{0, 0}
};
@@ -196,7 +195,6 @@ static const CRUISEGameDescription gameDescriptions[] = {
class CruiseMetaEngine : public AdvancedMetaEngine {
public:
CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) {
- _singleId = "cruise";
_guiOptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI);
}
diff --git a/engines/cryo/detection.cpp b/engines/cryo/detection.cpp
index b269d06..bb5be81 100644
--- a/engines/cryo/detection.cpp
+++ b/engines/cryo/detection.cpp
@@ -133,7 +133,6 @@ static const ADGameDescription gameDescriptions[] = {
class CryoMetaEngine : public AdvancedMetaEngine {
public:
CryoMetaEngine() : AdvancedMetaEngine(Cryo::gameDescriptions, sizeof(ADGameDescription), cryoGames) {
- _singleId = "losteden";
}
const char *getEngineId() const {
diff --git a/engines/cryomni3d/detection.cpp b/engines/cryomni3d/detection.cpp
index 9cb5a67..11c78ba 100644
--- a/engines/cryomni3d/detection.cpp
+++ b/engines/cryomni3d/detection.cpp
@@ -104,7 +104,6 @@ class CryOmni3DMetaEngine : public AdvancedMetaEngine {
public:
CryOmni3DMetaEngine() : AdvancedMetaEngine(CryOmni3D::gameDescriptions,
sizeof(CryOmni3DGameDescription), cryomni3DGames, optionsList) {
- //_singleId = "cryomni3d";
_maxScanDepth = 1;
}
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index 6634fc4..bf3f95b 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -99,7 +99,6 @@ static const char *directoryGlobs[] = {
class DirectorMetaEngine : public AdvancedMetaEngine {
public:
DirectorMetaEngine() : AdvancedMetaEngine(Director::gameDescriptions, sizeof(Director::DirectorGameDescription), directorGames) {
- _singleId = "director";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp
index 8b745bb..e6e25ea 100644
--- a/engines/dm/detection.cpp
+++ b/engines/dm/detection.cpp
@@ -98,7 +98,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class DMMetaEngine : public AdvancedMetaEngine {
public:
DMMetaEngine() : AdvancedMetaEngine(DM::gameDescriptions, sizeof(DMADGameDescription), DMGames, optionsList) {
- _singleId = "dm";
}
virtual const char *getEngineId() const {
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 8fd62cc..97dbbee 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -84,7 +84,6 @@ const ADGameDescription gameDescriptions[] = {
class DraciMetaEngine : public AdvancedMetaEngine {
public:
DraciMetaEngine() : AdvancedMetaEngine(Draci::gameDescriptions, sizeof(ADGameDescription), draciGames) {
- _singleId = "draci";
}
const char *getEngineId() const {
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 3c67147..7ed2abc 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -339,7 +339,6 @@ SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot, bool setPlayTi
class DrasculaMetaEngine : public AdvancedMetaEngine {
public:
DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) {
- _singleId = "drascula";
_guiOptions = GUIO1(GUIO_NOMIDI);
}
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index bbb7077..cb81414 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -71,7 +71,6 @@ public:
AdvancedMetaEngine(DreamWeb::gameDescriptions,
sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames,
gameGuiOptions) {
- _singleId = "dreamweb";
_guiOptions = GUIO1(GUIO_NOMIDI);
}
diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp
index a76b473..05c4732 100644
--- a/engines/fullpipe/detection.cpp
+++ b/engines/fullpipe/detection.cpp
@@ -130,7 +130,6 @@ static const ADGameDescription gameDescriptions[] = {
class FullpipeMetaEngine : public AdvancedMetaEngine {
public:
FullpipeMetaEngine() : AdvancedMetaEngine(Fullpipe::gameDescriptions, sizeof(ADGameDescription), fullpipeGames) {
- _singleId = "fullpipe";
}
const char *getEngineId() const {
diff --git a/engines/gnap/detection.cpp b/engines/gnap/detection.cpp
index f792fe5..343180d 100644
--- a/engines/gnap/detection.cpp
+++ b/engines/gnap/detection.cpp
@@ -78,7 +78,6 @@ static const ADGameDescription gameDescriptions[] = {
class GnapMetaEngine : public AdvancedMetaEngine {
public:
GnapMetaEngine() : AdvancedMetaEngine(Gnap::gameDescriptions, sizeof(ADGameDescription), gnapGames) {
- _singleId = "gnap";
_maxScanDepth = 3;
}
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index 2a51961..c56ed45 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -22,7 +22,6 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
-#include "engines/obsolete.h"
#include "gob/gob.h"
#include "gob/dataio.h"
@@ -33,8 +32,6 @@ class GobMetaEngine : public AdvancedMetaEngine {
public:
GobMetaEngine();
- PlainGameDescriptor findGame(const char *gameId) const override;
-
const char *getEngineId() const {
return "gob";
}
@@ -59,14 +56,9 @@ private:
GobMetaEngine::GobMetaEngine() :
AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) {
- _singleId = "gob";
_guiOptions = GUIO1(GUIO_NOLAUNCHLOAD);
}
-PlainGameDescriptor GobMetaEngine::findGame(const char *gameId) const {
- return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
-}
-
ADDetectedGame GobMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
ADDetectedGame detectedGame = detectGameFilebased(allFiles, fslist, Gob::fileBased);
if (!detectedGame.desc) {
@@ -180,7 +172,6 @@ bool Gob::GobEngine::hasFeature(EngineFeature f) const {
}
Common::Error GobMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
return AdvancedMetaEngine::createInstance(syst, engine);
}
diff --git a/engines/gob/detection/tables.h b/engines/gob/detection/tables.h
index 9b24203..031ea62 100644
--- a/engines/gob/detection/tables.h
+++ b/engines/gob/detection/tables.h
@@ -41,7 +41,6 @@ using namespace Common;
// Game IDs and proper names
static const PlainGameDescriptor gobGames[] = {
- {"gob", "Gob engine game"},
{"gob1", "Gobliiins"},
{"gob1cd", "Gobliiins CD"},
{"gob2", "Gobliins 2"},
@@ -81,13 +80,6 @@ static const PlainGameDescriptor gobGames[] = {
{0, 0}
};
-// Obsolete IDs we don't want anymore
-static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
- {"gob1", "gob", kPlatformUnknown},
- {"gob2", "gob", kPlatformUnknown},
- {0, 0, kPlatformUnknown}
-};
-
namespace Gob {
// Detection tables
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 0aa06de..f386d8b 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -42,8 +42,6 @@ static const PlainGameDescriptor groovieGames[] = {
{"tlc", "Tender Loving Care"},
#endif
- // Unknown
- {"groovie", "Groovie engine game"},
{0, 0}
};
@@ -333,8 +331,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class GroovieMetaEngine : public AdvancedMetaEngine {
public:
GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames, optionsList) {
- _singleId = "groovie";
-
// Use kADFlagUseExtraAsHint in order to distinguish the 11th hour from
// its "Making of" as well as the Clandestiny Trailer; they all share
// the same MD5.
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index 4cb7b03..5a64a83 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -167,7 +167,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class HDBMetaEngine : public AdvancedMetaEngine {
public:
HDBMetaEngine() : AdvancedMetaEngine(HDB::gameDescriptions, sizeof(ADGameDescription), hdbGames, optionsList) {
- _singleId = "hdb";
}
const char *getEngineId() const {
diff --git a/engines/illusions/detection.cpp b/engines/illusions/detection.cpp
index 18c5018..72c5620 100644
--- a/engines/illusions/detection.cpp
+++ b/engines/illusions/detection.cpp
@@ -32,7 +32,6 @@
#include "graphics/thumbnail.h"
static const PlainGameDescriptor illusionsGames[] = {
- { "illusions", "Illusions engine game" },
{ "bbdou", "Beavis and Butt-head Do U" },
{ "duckman", "Duckman" },
{ 0, 0 }
@@ -115,7 +114,6 @@ static const char * const directoryGlobs[] = {
class IllusionsMetaEngine : public AdvancedMetaEngine {
public:
IllusionsMetaEngine() : AdvancedMetaEngine(Illusions::gameDescriptions, sizeof(Illusions::IllusionsGameDescription), illusionsGames) {
- _singleId = "illusions";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index 009bd5c..a2570f6 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -115,8 +115,6 @@ uint32 LabEngine::getFeatures() const {
class LabMetaEngine : public AdvancedMetaEngine {
public:
LabMetaEngine() : AdvancedMetaEngine(labDescriptions, sizeof(ADGameDescription), lab_setting) {
- _singleId = "lab";
-
_maxScanDepth = 4;
_directoryGlobs = directoryGlobs;
_flags = kADFlagUseExtraAsHint;
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 3e6aa3a..94fbbae 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -227,7 +227,6 @@ static const ADGameDescription gameDescriptions[] = {
class LastExpressMetaEngine : public AdvancedMetaEngine {
public:
LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) {
- _singleId = "lastexpress";
_guiOptions = GUIO2(GUIO_NOSUBTITLES, GUIO_NOSFX);
}
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index b9473b2..0a87303 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -207,7 +207,6 @@ class LureMetaEngine : public AdvancedMetaEngine {
public:
LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) {
_md5Bytes = 1024;
- _singleId = "lure";
// Use kADFlagUseExtraAsHint to distinguish between EGA and VGA versions
// of italian Lure when their datafiles sit in the same directory.
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index 71e2de6..f4f46f3 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -46,7 +46,6 @@ uint16 MadeEngine::getVersion() const {
}
static const PlainGameDescriptor madeGames[] = {
- {"made", "MADE engine game"},
{"manhole", "The Manhole"},
{"rtz", "Return to Zork"},
{"lgop2", "Leather Goddesses of Phobos 2"},
@@ -57,7 +56,6 @@ static const PlainGameDescriptor madeGames[] = {
class MadeMetaEngine : public AdvancedMetaEngine {
public:
MadeMetaEngine() : AdvancedMetaEngine(Made::gameDescriptions, sizeof(Made::MadeGameDescription), madeGames) {
- _singleId = "made";
}
const char *getEngineId() const {
diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp
index 77df3a0..65725a8 100644
--- a/engines/mads/detection.cpp
+++ b/engines/mads/detection.cpp
@@ -69,7 +69,6 @@ Common::Platform MADSEngine::getPlatform() const {
} // End of namespace MADS
static const PlainGameDescriptor MADSGames[] = {
- {"MADS", "MADS"},
{"dragonsphere", "Dragonsphere"},
{"nebular", "Rex Nebular and the Cosmic Gender Bender"},
{"phantom", "Return of the Phantom"},
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 278cce2..bc7f6cd 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -136,7 +136,6 @@ bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
} // End of Namespace Mohawk
static const PlainGameDescriptor mohawkGames[] = {
- {"mohawk", "Mohawk Game"},
{"myst", "Myst"},
{"makingofmyst", "The Making of Myst"},
{"riven", "Riven: The Sequel to Myst"},
@@ -196,7 +195,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class MohawkMetaEngine : public AdvancedMetaEngine {
public:
MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames, optionsList) {
- _singleId = "mohawk";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index fc1acff..f941829 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -55,7 +55,6 @@ public:
MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::MortevielleGameDescriptions, sizeof(Mortevielle::MortevielleGameDescription),
MortevielleGame) {
_md5Bytes = 512;
- _singleId = "mortevielle";
// Use kADFlagUseExtraAsHint to distinguish between original and improved versions
// (i.e. use or not of the game data file).
_flags = kADFlagUseExtraAsHint;
diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp
index dcaf653..0d4a727 100644
--- a/engines/neverhood/detection.cpp
+++ b/engines/neverhood/detection.cpp
@@ -198,7 +198,6 @@ static const ExtraGuiOption neverhoodExtraGuiOption3 = {
class NeverhoodMetaEngine : public AdvancedMetaEngine {
public:
NeverhoodMetaEngine() : AdvancedMetaEngine(Neverhood::gameDescriptions, sizeof(Neverhood::NeverhoodGameDescription), neverhoodGames) {
- _singleId = "neverhood";
_guiOptions = GUIO2(GUIO_NOSUBTITLES, GUIO_NOMIDI);
}
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index f4dcc16..dfcf406 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -45,7 +45,6 @@ Common::Platform Parallaction::getPlatform() const { return _gameDescription->de
}
static const PlainGameDescriptor parallactionGames[] = {
- {"parallaction", "Parallaction engine game"},
{"nippon", "Nippon Safes Inc."},
{"bra", "The Big Red Adventure"},
{0, 0}
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index fbacf09..4bc56e7 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -135,7 +135,6 @@ static const PegasusGameDescription gameDescriptions[] = {
class PegasusMetaEngine : public AdvancedMetaEngine {
public:
PegasusMetaEngine() : AdvancedMetaEngine(Pegasus::gameDescriptions, sizeof(Pegasus::PegasusGameDescription), pegasusGames) {
- _singleId = "pegasus";
}
virtual const char *getEngineId() const {
diff --git a/engines/plumbers/detection.cpp b/engines/plumbers/detection.cpp
index 6a5e81f..37c6368 100644
--- a/engines/plumbers/detection.cpp
+++ b/engines/plumbers/detection.cpp
@@ -73,7 +73,6 @@ static const ADGameDescription gameDescriptions[] = {
class PlumbersMetaEngine : public AdvancedMetaEngine {
public:
PlumbersMetaEngine() : AdvancedMetaEngine(Plumbers::gameDescriptions, sizeof(ADGameDescription), plumbersGames) {
- _singleId = "plumbers";
}
const char *getEngineId() const {
diff --git a/engines/prince/detection.cpp b/engines/prince/detection.cpp
index 400c2da..5390e36 100644
--- a/engines/prince/detection.cpp
+++ b/engines/prince/detection.cpp
@@ -148,7 +148,6 @@ const static char *directoryGlobs[] = {
class PrinceMetaEngine : public AdvancedMetaEngine {
public:
PrinceMetaEngine() : AdvancedMetaEngine(Prince::gameDescriptions, sizeof(Prince::PrinceGameDescription), princeGames) {
- _singleId = "prince";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/queen/detection.cpp b/engines/queen/detection.cpp
index ed8f3dd..ed7dd7b 100644
--- a/engines/queen/detection.cpp
+++ b/engines/queen/detection.cpp
@@ -482,7 +482,6 @@ static const QueenGameDescription gameDescriptions[] = {
class QueenMetaEngine : public AdvancedMetaEngine {
public:
QueenMetaEngine() : AdvancedMetaEngine(Queen::gameDescriptions, sizeof(Queen::QueenGameDescription), queenGames, optionsList) {
- _singleId = "queen";
}
const char *getEngineId() const {
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 7137565..ed8d7cd 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -28,7 +28,6 @@
#include "common/config-manager.h"
#include "engines/advancedDetector.h"
-#include "engines/obsolete.h"
#include "common/system.h"
#include "graphics/thumbnail.h"
@@ -81,7 +80,6 @@ const ADGameFileDescription *SagaEngine::getFilesDescriptions() const { return _
}
static const PlainGameDescriptor sagaGames[] = {
- {"saga", "SAGA Engine game"},
{"ite", "Inherit the Earth: Quest for the Orb"},
{"ihnm", "I Have No Mouth and I Must Scream"},
{"dino", "Dinotopia"},
@@ -89,24 +87,11 @@ static const PlainGameDescriptor sagaGames[] = {
{0, 0}
};
-static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
- {"ite", "saga", Common::kPlatformUnknown},
- {"ihnm", "saga", Common::kPlatformUnknown},
- {"dino", "saga", Common::kPlatformUnknown},
- {"fta2", "saga", Common::kPlatformUnknown},
- {0, 0, Common::kPlatformUnknown}
-};
-
#include "saga/detection_tables.h"
class SagaMetaEngine : public AdvancedMetaEngine {
public:
SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) {
- _singleId = "saga";
- }
-
- PlainGameDescriptor findGame(const char *gameId) const override {
- return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
const char *getEngineId() const {
@@ -142,7 +127,6 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const {
- Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
return AdvancedMetaEngine::createInstance(syst, engine);
}
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 8e766c8..422c32a 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -558,7 +558,6 @@ static const char *directoryGlobs[] = {
class SciMetaEngine : public AdvancedMetaEngine {
public:
SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles, optionsList) {
- _singleId = "sci";
_maxScanDepth = 3;
_directoryGlobs = directoryGlobs;
_matchFullPaths = true;
diff --git a/engines/sludge/detection.cpp b/engines/sludge/detection.cpp
index 1f005ea..bd469c8 100644
--- a/engines/sludge/detection.cpp
+++ b/engines/sludge/detection.cpp
@@ -79,7 +79,6 @@ static char s_fallbackFileNameBuffer[51];
class SludgeMetaEngine : public AdvancedMetaEngine {
public:
SludgeMetaEngine() : AdvancedMetaEngine(Sludge::gameDescriptions, sizeof(Sludge::SludgeGameDescription), sludgeGames) {
- _singleId = "sludge";
_maxScanDepth = 1;
}
diff --git a/engines/startrek/detection.cpp b/engines/startrek/detection.cpp
index 7d47d5e..4135481 100644
--- a/engines/startrek/detection.cpp
+++ b/engines/startrek/detection.cpp
@@ -60,7 +60,6 @@ Common::Language StarTrekEngine::getLanguage() const {
} // End of Namespace StarTrek
static const PlainGameDescriptor starTrekGames[] = {
- {"startrek", "Star Trek game"},
{"st25", "Star Trek: 25th Anniversary"},
{"stjr", "Star Trek: Judgment Rites"},
{0, 0}
@@ -321,7 +320,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
class StarTrekMetaEngine : public AdvancedMetaEngine {
public:
StarTrekMetaEngine() : AdvancedMetaEngine(StarTrek::gameDescriptions, sizeof(StarTrek::StarTrekGameDescription), starTrekGames) {
- _singleId = "startrek";
}
const char *getEngineId() const {
diff --git a/engines/supernova/detection.cpp b/engines/supernova/detection.cpp
index f225601..c511c2a 100644
--- a/engines/supernova/detection.cpp
+++ b/engines/supernova/detection.cpp
@@ -100,7 +100,6 @@ static const ADGameDescription gameDescriptions[] = {
class SupernovaMetaEngine: public AdvancedMetaEngine {
public:
SupernovaMetaEngine() : AdvancedMetaEngine(Supernova::gameDescriptions, sizeof(ADGameDescription), supernovaGames, optionsList) {
-// _singleId = "supernova";
}
const char *getEngineId() const {
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index 5601f48..44df771 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -88,7 +88,6 @@ enum {
class TeenAgentMetaEngine : public AdvancedMetaEngine {
public:
TeenAgentMetaEngine() : AdvancedMetaEngine(teenAgentGameDescriptions, sizeof(ADGameDescription), teenAgentGames) {
- _singleId = "teenagent";
}
const char *getEngineId() const {
diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index 86199ae..7aa97ac 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -49,7 +49,6 @@ class TestbedMetaEngine : public AdvancedMetaEngine {
public:
TestbedMetaEngine() : AdvancedMetaEngine(testbedDescriptions, sizeof(ADGameDescription), testbed_setting) {
_md5Bytes = 512;
- _singleId = "testbed";
}
const char *getEngineId() const {
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index 408247b..0516a47 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -74,7 +74,6 @@ bool TinselEngine::isV1CD() const {
} // End of namespace Tinsel
static const PlainGameDescriptor tinselGames[] = {
- {"tinsel", "Tinsel engine game"},
{"dw", "Discworld"},
{"dw2", "Discworld 2: Missing Presumed ...!?"},
{0, 0}
@@ -85,7 +84,6 @@ static const PlainGameDescriptor tinselGames[] = {
class TinselMetaEngine : public AdvancedMetaEngine {
public:
TinselMetaEngine() : AdvancedMetaEngine(Tinsel::gameDescriptions, sizeof(Tinsel::TinselGameDescription), tinselGames) {
- _singleId = "tinsel";
}
const char *getEngineId() const {
diff --git a/engines/toltecs/detection.cpp b/engines/toltecs/detection.cpp
index d372c30..153d96a 100644
--- a/engines/toltecs/detection.cpp
+++ b/engines/toltecs/detection.cpp
@@ -220,7 +220,6 @@ static const ExtraGuiOption toltecsExtraGuiOption = {
class ToltecsMetaEngine : public AdvancedMetaEngine {
public:
ToltecsMetaEngine() : AdvancedMetaEngine(Toltecs::gameDescriptions, sizeof(Toltecs::ToltecsGameDescription), toltecsGames) {
- _singleId = "toltecs";
}
const char *getEngineId() const {
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index ece06df..4fc6b06 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -137,7 +137,6 @@ static const char * const directoryGlobs[] = {
class ToonMetaEngine : public AdvancedMetaEngine {
public:
ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) {
- _singleId = "toon";
_maxScanDepth = 3;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index 1d96259..08644cc 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -128,7 +128,6 @@ class ToucheMetaEngine : public AdvancedMetaEngine {
public:
ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) {
_md5Bytes = 4096;
- _singleId = "touche";
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
}
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index f10b932..d6473ea 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -58,7 +58,6 @@ Common::String TSageEngine::getPrimaryFilename() const {
} // End of namespace TsAGE
static const PlainGameDescriptor tSageGameTitles[] = {
- { "tsage", "Tsunami TsAGE-based Game" },
{ "ringworld", "Ringworld: Revenge of the Patriarch" },
{ "blueforce", "Blue Force" },
{ "ringworld2", "Return to Ringworld" },
@@ -75,7 +74,6 @@ enum {
class TSageMetaEngine : public AdvancedMetaEngine {
public:
TSageMetaEngine() : AdvancedMetaEngine(TsAGE::gameDescriptions, sizeof(TsAGE::tSageGameDescription), tSageGameTitles) {
- _singleId = "tsage";
}
const char *getEngineId() const {
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index 39ecf15..990c1ad 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -125,7 +125,6 @@ class TuckerMetaEngine : public AdvancedMetaEngine {
public:
TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) {
_md5Bytes = 512;
- _singleId = "tucker";
}
const char *getEngineId() const {
diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp
index 75bfa96..49a01f8 100644
--- a/engines/wage/detection.cpp
+++ b/engines/wage/detection.cpp
@@ -55,7 +55,6 @@ class WageMetaEngine : public AdvancedMetaEngine {
public:
WageMetaEngine() : AdvancedMetaEngine(Wage::gameDescriptions, sizeof(ADGameDescription), wageGames) {
_md5Bytes = 2 * 1024 * 1024;
- _singleId = "wage";
_guiOptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI);
}
diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp
index 6f3be39..3411512 100644
--- a/engines/wintermute/detection.cpp
+++ b/engines/wintermute/detection.cpp
@@ -88,7 +88,6 @@ static const char *directoryGlobs[] = {
class WintermuteMetaEngine : public AdvancedMetaEngine {
public:
WintermuteMetaEngine() : AdvancedMetaEngine(Wintermute::gameDescriptions, sizeof(WMEGameDescription), Wintermute::wintermuteGames, gameGuiOptions) {
- _singleId = "wintermute";
_guiOptions = GUIO3(GUIO_NOMIDI, GAMEOPTION_SHOW_FPS, GAMEOPTION_BILINEAR);
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;
diff --git a/engines/xeen/detection.cpp b/engines/xeen/detection.cpp
index 3a19172..45490f3 100644
--- a/engines/xeen/detection.cpp
+++ b/engines/xeen/detection.cpp
@@ -76,7 +76,6 @@ bool XeenEngine::getIsCD() const {
} // End of namespace Xeen
static const PlainGameDescriptor XeenGames[] = {
- { "xeen", "Xeen" },
{ "cloudsofxeen", "Might and Magic IV: Clouds of Xeen" },
{ "darksideofxeen", "Might and Magic V: Dark Side of Xeen" },
{ "worldofxeen", "Might and Magic: World of Xeen" },
diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp
index 50e5f9a..1ce9871 100644
--- a/engines/zvision/detection.cpp
+++ b/engines/zvision/detection.cpp
@@ -61,7 +61,6 @@ public:
ZVisionMetaEngine() : AdvancedMetaEngine(ZVision::gameDescriptions, sizeof(ZVision::ZVisionGameDescription), ZVision::zVisionGames, ZVision::optionsList) {
_maxScanDepth = 2;
_directoryGlobs = ZVision::directoryGlobs;
- _singleId = "zvision";
}
const char *getEngineId() const {
diff --git a/engines/zvision/detection_tables.h b/engines/zvision/detection_tables.h
index 05e3807..171df1f 100644
--- a/engines/zvision/detection_tables.h
+++ b/engines/zvision/detection_tables.h
@@ -26,7 +26,6 @@
namespace ZVision {
static const PlainGameDescriptor zVisionGames[] = {
- { "zvision", "Z-Vision Game" },
{ "znemesis", "Zork Nemesis: The Forbidden Lands" },
{ "zgi", "Zork: Grand Inquisitor" },
{ 0, 0 }
Commit: bb813719b56a3e2a51b7c73385d036f61fdde584
https://github.com/scummvm/scummvm/commit/bb813719b56a3e2a51b7c73385d036f61fdde584
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
ENGINES: Change targets to have an 'engine ID'
The engine ID identifies which engine should be used to launch the target.
Also remove the 'single ID' system. Different games from engines that used
that system now have different game IDs.
Also-By: Matthew Hoops <clone2727 at gmail.com>
Changed paths:
base/commandLine.cpp
base/main.cpp
base/plugins.cpp
base/plugins.h
engines/advancedDetector.cpp
engines/advancedDetector.h
engines/engine.cpp
engines/game.cpp
engines/game.h
engines/glk/detection.cpp
engines/glk/frotz/detection.cpp
engines/glk/level9/detection.cpp
engines/glk/tads/detection.cpp
engines/illusions/menusystem.cpp
engines/macventure/detection.cpp
engines/metaengine.h
engines/neverhood/menumodule.cpp
engines/obsolete.cpp
engines/obsolete.h
engines/pegasus/pegasus.cpp
engines/scumm/detection.cpp
engines/sky/detection.cpp
engines/sword1/detection.cpp
engines/sword2/sword2.cpp
gui/EventRecorder.cpp
gui/launcher.cpp
gui/massadd.cpp
gui/recorderdialog.cpp
gui/saveload.cpp
gui/unknown-game-dialog.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index b4a9174..74a5982 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -705,9 +705,8 @@ static void listTargets() {
printf("Target Description \n"
"-------------------- ------------------------------------------------------\n");
- using namespace Common;
- const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
- ConfigManager::DomainMap::const_iterator iter;
+ const Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
+ Common::ConfigManager::DomainMap::const_iterator iter;
Common::Array<Common::String> targets;
targets.reserve(domains.size());
@@ -716,15 +715,15 @@ static void listTargets() {
Common::String name(iter->_key);
Common::String description(iter->_value.getVal("description"));
+ // If there's no description, fallback on the default description.
if (description.empty()) {
- // FIXME: At this point, we should check for a "gameid" override
- // to find the proper desc. In fact, the platform probably should
- // be taken into account, too.
- const Common::String &gameid = name;
- PlainGameDescriptor g = EngineMan.findGame(gameid);
+ PlainGameDescriptor g = EngineMan.findTarget(name);
if (g.description)
description = g.description;
}
+ // If there's still no description, we cannot come up with one. Insert some dummy text.
+ if (description.empty())
+ description = "<Unknown game>";
targets.push_back(Common::String::format("%-20s %s", name.c_str(), description.c_str()));
}
@@ -766,24 +765,21 @@ static Common::Error listSaves(const Common::String &target) {
// target specific savepath will be checked
ConfMan.setActiveDomain(*i);
- // Grab the gameid from the domain resp. use the target as gameid
- Common::String gameid;
- if (domain)
- gameid = domain->getVal("gameid");
- if (gameid.empty())
- gameid = *i;
- gameid.toLowercase(); // Normalize it to lower case
-
- // Find the plugin that will handle the specified gameid
+ // Look for a game matching the target
const Plugin *plugin = nullptr;
- EngineMan.findGame(gameid, &plugin);
+ PlainGameDescriptor game;
+ if (domain) {
+ game = EngineMan.findTarget(target, &plugin);
+ } else {
+ game = EngineMan.findGame(target, &plugin);
+ }
if (!plugin) {
// If the target was specified, treat this as an error, and otherwise skip it.
if (!target.empty())
return Common::Error(Common::kEnginePluginNotFound,
- Common::String::format("target '%s', gameid '%s", i->c_str(), gameid.c_str()));
- printf("Plugin could not be loaded for target '%s', gameid '%s", i->c_str(), gameid.c_str());
+ Common::String::format("target '%s', gameid '%s", i->c_str(), game.gameId));
+ printf("Plugin could not be loaded for target '%s', gameid '%s", i->c_str(), game.gameId);
continue;
}
@@ -794,7 +790,7 @@ static Common::Error listSaves(const Common::String &target) {
if (!target.empty())
// TODO: Include more info about the target (desc, engine name, ...) ???
return Common::Error(Common::kEnginePluginNotSupportSaves,
- Common::String::format("target '%s', gameid '%s", i->c_str(), gameid.c_str()));
+ Common::String::format("target '%s', gameid '%s", i->c_str(), game.gameId));
continue;
}
@@ -805,7 +801,7 @@ static Common::Error listSaves(const Common::String &target) {
// TODO: Include more info about the target (desc, engine name, ...) ???
if (atLeastOneFound)
printf("\n");
- printf("Save states for target '%s' (gameid '%s'):\n", i->c_str(), gameid.c_str());
+ printf("Save states for target '%s' (gameid '%s'):\n", i->c_str(), game.gameId);
printf(" Slot Description \n"
" ---- ------------------------------------------------------\n");
@@ -817,7 +813,7 @@ static Common::Error listSaves(const Common::String &target) {
} else {
// If the target was specified, indicate no save games were found for it. Otherwise just skip it.
if (!target.empty())
- printf("There are no save states for target '%s' (gameid '%s'):\n", i->c_str(), gameid.c_str());
+ printf("There are no save states for target '%s' (gameid '%s'):\n", i->c_str(), game.gameId);
}
}
@@ -916,10 +912,14 @@ static Common::String detectGames(const Common::String &path, const Common::Stri
return Common::String();
}
// TODO this is not especially pretty
- printf("ID Description Full Path\n");
- printf("-------------- ---------------------------------------------------------- ---------------------------------------------------------\n");
+ printf("EngineID GameID Description Full Path\n");
+ printf("-------------- -------------- ---------------------------------------------------------- ---------------------------------------------------------\n");
for (DetectedGames::const_iterator v = candidates.begin(); v != candidates.end(); ++v) {
- printf("%-14s %-58s %s\n", v->gameId.c_str(), v->description.c_str(), v->path.c_str());
+ printf("%-14s %-14s %-58s %s\n",
+ v->engineId.c_str(),
+ v->gameId.c_str(),
+ v->description.c_str(),
+ v->path.c_str());
}
return candidates[0].gameId;
@@ -1010,7 +1010,7 @@ static void runDetectorTest() {
bool gameidDiffers = false;
DetectedGames::const_iterator x;
for (x = candidates.begin(); x != candidates.end(); ++x) {
- gameidDiffers |= (scumm_stricmp(gameid.c_str(), x->gameId.c_str()) != 0);
+ gameidDiffers |= !gameid.equalsIgnoreCase(x->gameId);
}
if (candidates.empty()) {
@@ -1120,7 +1120,8 @@ void upgradeTargets() {
// At this point, g points to a GameDescriptor which we can use to update
// the target referred to by dom. We update several things
- // Always set the gameid explicitly (in case of legacy targets)
+ // Always set the engine ID and game ID explicitly (in case of legacy targets)
+ dom["engineid"] = g->engineId;
dom["gameid"] = g->gameId;
// Always set the GUI options. The user should not modify them, and engines might
@@ -1149,7 +1150,7 @@ void upgradeTargets() {
// ScummVM still generates an incorrect description string. So, the description
// should only be updated if the user explicitly requests this.
#if 0
- if (desc != g->description()) {
+ if (desc != g->description) {
printf(" -> update desc from '%s' to\n '%s' ?\n", desc.c_str(), g->description.c_str());
dom["description"] = g->description;
}
@@ -1248,9 +1249,17 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// domain (i.e. a target) matching this argument, or alternatively
// whether there is a gameid matching that name.
if (!command.empty()) {
- PlainGameDescriptor gd = EngineMan.findGame(command);
- if (ConfMan.hasGameDomain(command) || gd.gameId) {
- bool idCameFromCommandLine = false;
+ PlainGameDescriptor gd;
+ const Plugin *plugin = nullptr;
+ if (ConfMan.hasGameDomain(command)) {
+ // Command is a known target
+ ConfMan.setActiveDomain(command);
+ } else if (gd = EngineMan.findGame(command, &plugin), gd.gameId) {
+ // Command is a known game ID
+ ConfMan.setActiveDomain(command);
+
+ ConfMan.set("gameid", gd.gameId);
+ ConfMan.set("engineid", plugin->get<MetaEngine>().getEngineId());
// WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching
// undefined target adds launcher entry"
@@ -1258,15 +1267,7 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// We designate gameids which come strictly from command line
// so AdvancedDetector will not save config file with invalid
// gameid in case target autoupgrade was performed
- if (!ConfMan.hasGameDomain(command)) {
- idCameFromCommandLine = true;
- }
-
- ConfMan.setActiveDomain(command);
-
- if (idCameFromCommandLine)
- ConfMan.set("id_came_from_command_line", "1");
-
+ ConfMan.set("id_came_from_command_line", "1");
} else {
#ifndef DISABLE_COMMAND_LINE
usage("Unrecognized game target '%s'", command.c_str());
diff --git a/base/main.cpp b/base/main.cpp
index 750e09e..45c8e39 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -108,39 +108,50 @@ static bool launcherDialog() {
}
static const Plugin *detectPlugin() {
- const Plugin *plugin = nullptr;
+ // Figure out the engine ID and game ID
+ Common::String engineId = ConfMan.get("engineid");
+ Common::String gameId = ConfMan.get("gameid");
- // Make sure the gameid is set in the config manager, and that it is lowercase.
- Common::String gameid(ConfMan.getActiveDomainName());
- assert(!gameid.empty());
- if (ConfMan.hasKey("gameid")) {
- gameid = ConfMan.get("gameid");
+ // Print text saying what's going on
+ printf("User picked target '%s' (engine ID '%s', game ID '%s')...\n", ConfMan.getActiveDomainName().c_str(), engineId.c_str(), gameId.c_str());
- // Set last selected game, that the game will be highlighted
- // on RTL
- ConfMan.set("lastselectedgame", ConfMan.getActiveDomainName(), Common::ConfigManager::kApplicationDomain);
- ConfMan.flushToDisk();
+ // At this point the engine ID and game ID must be known
+ if (engineId.empty()) {
+ warning("The engine ID is not set for target '%s'", ConfMan.getActiveDomainName().c_str());
+ return 0;
}
- gameid.toLowercase();
- ConfMan.set("gameid", gameid);
-
- // Query the plugins and find one that will handle the specified gameid
- printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
- printf(" Looking for a plugin supporting this gameid... ");
+ if (gameId.empty()) {
+ warning("The game ID is not set for target '%s'", ConfMan.getActiveDomainName().c_str());
+ return 0;
+ }
- PlainGameDescriptor game = EngineMan.findGame(gameid, &plugin);
+ const Plugin *plugin = EngineMan.findPlugin(engineId);
+ if (!plugin) {
+ warning("'%s' is an invalid engine ID. Use the --list-engines command to list supported engine IDs", engineId.c_str());
+ return 0;
+ }
- if (plugin == 0) {
- printf("failed\n");
- warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
- } else {
- printf("%s\n Starting '%s'\n", plugin->getName(), game.description);
+ // Query the plugin for the game descriptor
+ printf(" Looking for a plugin supporting this target... %s\n", plugin->getName());
+ PlainGameDescriptor game = plugin->get<MetaEngine>().findGame(gameId.c_str());
+ if (!game.gameId) {
+ warning("'%s' is an invalid game ID for the engine '%s'. Use the --list-games option to list supported game IDs", gameId.c_str(), engineId.c_str());
+ return 0;
}
return plugin;
}
+void saveLastLaunchedTarget(const Common::String &target) {
+ if (ConfMan.hasGameDomain(target)) {
+ // Set the last selected game, so the game will be highlighted next time the user
+ // returns to the launcher.
+ ConfMan.set("lastselectedgame", target, Common::ConfigManager::kApplicationDomain);
+ ConfMan.flushToDisk();
+ }
+}
+
// TODO: specify the possible return values here
static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common::String &edebuglevels) {
// Determine the game data path, for validation and error messages
@@ -208,7 +219,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
Common::String caption(ConfMan.get("description"));
if (caption.empty()) {
- PlainGameDescriptor game = EngineMan.findGame(ConfMan.get("gameid"));
+ PlainGameDescriptor game = EngineMan.findTarget(ConfMan.getActiveDomainName());
if (game.description) {
caption = game.description;
}
@@ -532,6 +543,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
// work as well as it should. In theory everything should be destroyed
// cleanly, so this is now enabled to encourage people to fix bits :)
while (0 != ConfMan.getActiveDomain()) {
+ saveLastLaunchedTarget(ConfMan.getActiveDomainName());
+
// Try to find a plugin which feels responsible for the specified game.
const Plugin *plugin = detectPlugin();
if (plugin) {
diff --git a/base/plugins.cpp b/base/plugins.cpp
index ac217ab..a64dbdd 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -287,14 +287,14 @@ void PluginManagerUncached::init() {
/**
* Try to load the plugin by searching in the ConfigManager for a matching
- * gameId under the domain 'plugin_files'.
+ * engine ID under the domain 'engine_plugin_files'.
**/
-bool PluginManagerUncached::loadPluginFromGameId(const Common::String &gameId) {
- Common::ConfigManager::Domain *domain = ConfMan.getDomain("plugin_files");
+bool PluginManagerUncached::loadPluginFromEngineId(const Common::String &engineId) {
+ Common::ConfigManager::Domain *domain = ConfMan.getDomain("engine_plugin_files");
if (domain) {
- if (domain->contains(gameId)) {
- Common::String filename = (*domain)[gameId];
+ if (domain->contains(engineId)) {
+ Common::String filename = (*domain)[engineId];
if (loadPluginByFileName(filename)) {
return true;
@@ -326,17 +326,17 @@ bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename)
/**
* Update the config manager with a plugin file name that we found can handle
- * the game.
+ * the engine.
**/
-void PluginManagerUncached::updateConfigWithFileName(const Common::String &gameId) {
+void PluginManagerUncached::updateConfigWithFileName(const Common::String &engineId) {
// Check if we have a filename for the current plugin
if ((*_currentPlugin)->getFileName()) {
- if (!ConfMan.hasMiscDomain("plugin_files"))
- ConfMan.addMiscDomain("plugin_files");
+ if (!ConfMan.hasMiscDomain("engine_plugin_files"))
+ ConfMan.addMiscDomain("engine_plugin_files");
- Common::ConfigManager::Domain *domain = ConfMan.getDomain("plugin_files");
+ Common::ConfigManager::Domain *domain = ConfMan.getDomain("engine_plugin_files");
assert(domain);
- (*domain)[gameId] = (*_currentPlugin)->getFileName();
+ (*domain)[engineId] = (*_currentPlugin)->getFileName();
ConfMan.flushToDisk();
}
@@ -490,24 +490,12 @@ PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, cons
return result;
}
- // Now look for the game using the gameId. This is much faster than scanning plugin
- // by plugin
- if (PluginMan.loadPluginFromGameId(gameName)) {
- result = findGameInLoadedPlugins(gameName, plugin);
- if (result.gameId) {
- return result;
- }
- }
-
- // We failed to find it using the gameid. Scan the list of plugins
+ // We failed to find it in memory. Scan the list of plugins
PluginMan.loadFirstPlugin();
do {
result = findGameInLoadedPlugins(gameName, plugin);
- if (result.gameId) {
- // Update with new plugin file name
- PluginMan.updateConfigWithFileName(gameName);
+ if (result.gameId)
break;
- }
} while (PluginMan.loadNextPlugin());
return result;
@@ -551,7 +539,6 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const
DetectedGames engineCandidates = metaEngine.detectGames(fslist);
for (uint i = 0; i < engineCandidates.size(); i++) {
- engineCandidates[i].engineName = metaEngine.getName();
engineCandidates[i].path = fslist.begin()->getParent().getPath();
engineCandidates[i].shortPath = fslist.begin()->getParent().getDisplayName();
candidates.push_back(engineCandidates[i]);
@@ -597,6 +584,7 @@ Common::String EngineManager::createTargetForGame(const DetectedGame &game) {
ConfMan.addGameDomain(domain);
// Copy all non-empty relevant values into the new domain
+ addStringToConf("engineid", game.engineId, domain);
addStringToConf("gameid", game.gameId, domain);
addStringToConf("description", game.description, domain);
addStringToConf("language", Common::getLanguageCode(game.language), domain);
@@ -623,6 +611,70 @@ Common::String EngineManager::createTargetForGame(const DetectedGame &game) {
return domain;
}
+const Plugin *EngineManager::findLoadedPlugin(const Common::String &engineId) const {
+ const PluginList &plugins = getPlugins();
+
+ for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); iter++)
+ if (engineId == (*iter)->get<MetaEngine>().getEngineId())
+ return *iter;
+
+ return 0;
+}
+
+const Plugin *EngineManager::findPlugin(const Common::String &engineId) const {
+ // First look for the game using the plugins in memory. This is critical
+ // for calls coming from inside games
+ const Plugin *plugin = findLoadedPlugin(engineId);
+ if (plugin)
+ return plugin;
+
+ // Now look for the plugin using the engine ID. This is much faster than scanning plugin
+ // by plugin
+ if (PluginMan.loadPluginFromEngineId(engineId)) {
+ plugin = findLoadedPlugin(engineId);
+ if (plugin)
+ return plugin;
+ }
+
+ // We failed to find it using the engine ID. Scan the list of plugins
+ PluginMan.loadFirstPlugin();
+ do {
+ plugin = findLoadedPlugin(engineId);
+ if (plugin) {
+ // Update with new plugin file name
+ PluginMan.updateConfigWithFileName(engineId);
+ return plugin;
+ }
+ } while (PluginMan.loadNextPlugin());
+
+ return 0;
+}
+
+PlainGameDescriptor EngineManager::findTarget(const Common::String &target, const Plugin **plugin) const {
+ // Ignore empty targets
+ if (target.empty())
+ return PlainGameDescriptor();
+
+ // Lookup the domain. If we have no domain, fallback on the old function [ultra-deprecated].
+ const Common::ConfigManager::Domain *domain = ConfMan.getDomain(target);
+ if (!domain || !domain->contains("gameid") || !domain->contains("engineid"))
+ return PlainGameDescriptor();
+
+ // Look for the engine ID
+ const Plugin *foundPlugin = findPlugin(domain->getVal("engineid"));
+ if (!foundPlugin) {
+ return PlainGameDescriptor();
+ }
+
+ // Make sure it does support the game ID
+ PlainGameDescriptor desc = foundPlugin->get<MetaEngine>().findGame(domain->getVal("gameid").c_str());
+
+ if (desc.gameId && plugin)
+ *plugin = foundPlugin;
+
+ return desc;
+}
+
// Music plugins
#include "audio/musicplugin.h"
diff --git a/base/plugins.h b/base/plugins.h
index 1daa426..ccb1acf 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -315,8 +315,8 @@ public:
virtual void init() {}
virtual void loadFirstPlugin() {}
virtual bool loadNextPlugin() { return false; }
- virtual bool loadPluginFromGameId(const Common::String &gameId) { return false; }
- virtual void updateConfigWithFileName(const Common::String &gameId) {}
+ virtual bool loadPluginFromEngineId(const Common::String &engineId) { return false; }
+ virtual void updateConfigWithFileName(const Common::String &engineId) {}
// Functions used only by the cached PluginManager
virtual void loadAllPlugins();
@@ -345,8 +345,8 @@ public:
virtual void init();
virtual void loadFirstPlugin();
virtual bool loadNextPlugin();
- virtual bool loadPluginFromGameId(const Common::String &gameId);
- virtual void updateConfigWithFileName(const Common::String &gameId);
+ virtual bool loadPluginFromEngineId(const Common::String &engineId);
+ virtual void updateConfigWithFileName(const Common::String &engineId);
virtual void loadAllPlugins() {} // we don't allow these
virtual void loadAllPluginsOfType(PluginType type) {}
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 10ddb0d..4cc05ae 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -82,8 +82,6 @@ static Common::String generatePreferredTarget(const ADGameDescription *desc) {
DetectedGame AdvancedMetaEngine::toDetectedGame(const ADDetectedGame &adGame) const {
const ADGameDescription *desc = adGame.desc;
- const char *gameId = _singleId ? _singleId : desc->gameId;
-
const char *title;
const char *extra;
if (desc->flags & ADGF_USEEXTRAASTITLE) {
@@ -99,7 +97,7 @@ DetectedGame AdvancedMetaEngine::toDetectedGame(const ADDetectedGame &adGame) co
extra = desc->extra;
}
- DetectedGame game(gameId, title, desc->language, desc->platform, extra);
+ DetectedGame game(getEngineId(), desc->gameId, title, desc->language, desc->platform, extra);
game.hasUnknownFiles = adGame.hasUnknownFiles;
game.matchedFiles = adGame.matchedFiles;
game.preferredTarget = generatePreferredTarget(desc);
@@ -264,7 +262,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
ADDetectedGame agdDesc;
for (uint i = 0; i < matches.size(); i++) {
- if ((_singleId || matches[i].desc->gameId == gameid) && !matches[i].hasUnknownFiles) {
+ if (matches[i].desc->gameId == gameid && !matches[i].hasUnknownFiles) {
agdDesc = matches[i];
break;
}
@@ -277,7 +275,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (agdDesc.desc) {
// Seems we found a fallback match. But first perform a basic
// sanity check: the gameid must match.
- if (!_singleId && agdDesc.desc->gameId != gameid)
+ if (agdDesc.desc->gameId != gameid)
agdDesc = ADDetectedGame();
}
}
@@ -556,21 +554,6 @@ ADDetectedGame AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles,
}
PlainGameList AdvancedMetaEngine::getSupportedGames() const {
- if (_singleId != NULL) {
- PlainGameList gl;
-
- const PlainGameDescriptor *g = _gameIds;
- while (g->gameId) {
- if (0 == scumm_stricmp(_singleId, g->gameId)) {
- gl.push_back(*g);
-
- return gl;
- }
- g++;
- }
- error("Engine %s doesn't have its singleid specified in ids list", _singleId);
- }
-
return PlainGameList(_gameIds);
}
@@ -589,7 +572,6 @@ AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, con
_extraGuiOptions(extraGuiOptions) {
_md5Bytes = 5000;
- _singleId = NULL;
_flags = 0;
_guiOptions = GUIO_NONE;
_maxScanDepth = 1;
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 326cb79..088dfea 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -206,19 +206,6 @@ protected:
uint _md5Bytes;
/**
- * Name of single gameid (optional).
- *
- * Used to override gameid.
- * This is a recommended setting to prevent global gameid pollution.
- * With this option set, the gameid effectively turns into engineid.
- *
- * FIXME: This field actually removes a feature (gameid) in order to
- * address a more generic problem. We should find a better way to
- * disambiguate gameids.
- */
- const char *_singleId;
-
- /**
* A bitmask of flags which can be used to configure the behavior
* of the AdvancedDetector. Refer to ADFlags for a list of flags
* that can be ORed together and passed here.
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 30cbb0b..bee5177 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -673,12 +673,7 @@ bool Engine::shouldQuit() {
/*
EnginePlugin *Engine::getMetaEnginePlugin() const {
-
- const EnginePlugin *plugin = 0;
- Common::String gameid = ConfMan.get("gameid");
- gameid.toLowercase();
- EngineMan.findGame(gameid, &plugin);
- return plugin;
+ return EngineMan.findPlugin(ConfMan.get("engineid"));
}
*/
diff --git a/engines/game.cpp b/engines/game.cpp
index 24e1258..13c24a0 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -50,7 +50,6 @@ PlainGameDescriptor PlainGameDescriptor::of(const char *gameId, const char *desc
}
DetectedGame::DetectedGame() :
- engineName(nullptr),
hasUnknownFiles(false),
canBeAdded(true),
language(Common::UNK_LANG),
@@ -58,8 +57,8 @@ DetectedGame::DetectedGame() :
gameSupportLevel(kStableGame) {
}
-DetectedGame::DetectedGame(const PlainGameDescriptor &pgd) :
- engineName(nullptr),
+DetectedGame::DetectedGame(const Common::String &engine, const PlainGameDescriptor &pgd) :
+ engineId(engine),
hasUnknownFiles(false),
canBeAdded(true),
language(Common::UNK_LANG),
@@ -71,8 +70,8 @@ DetectedGame::DetectedGame(const PlainGameDescriptor &pgd) :
description = pgd.description;
}
-DetectedGame::DetectedGame(const Common::String &id, const Common::String &d, Common::Language l, Common::Platform p, const Common::String &ex) :
- engineName(nullptr),
+DetectedGame::DetectedGame(const Common::String &engine, const Common::String &id, const Common::String &d, Common::Language l, Common::Platform p, const Common::String &ex) :
+ engineId(engine),
hasUnknownFiles(false),
canBeAdded(true),
gameSupportLevel(kStableGame) {
@@ -178,20 +177,20 @@ Common::String generateUnknownGameReport(const DetectedGames &detectedGames, boo
FilePropertiesMap matchedFiles;
- const char *currentEngineName = nullptr;
+ Common::String currentEngineId;
for (uint i = 0; i < detectedGames.size(); i++) {
const DetectedGame &game = detectedGames[i];
if (!game.hasUnknownFiles) continue;
- if (!currentEngineName || strcmp(currentEngineName, game.engineName) != 0) {
- currentEngineName = game.engineName;
+ if (currentEngineId.empty() || currentEngineId != game.engineId) {
+ currentEngineId = game.engineId;
// If the engine is not the same as for the previous entry, print an engine line header
report += "\n";
report += Common::String::format(
translate ? _(reportEngineHeader) : reportEngineHeader,
- game.engineName
+ game.engineId.c_str()
);
report += " ";
diff --git a/engines/game.h b/engines/game.h
index 8a678cf..92fce63 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -98,8 +98,8 @@ typedef Common::HashMap<Common::String, FileProperties, Common::IgnoreCase_Hash,
*/
struct DetectedGame {
DetectedGame();
- explicit DetectedGame(const PlainGameDescriptor &pgd);
- DetectedGame(const Common::String &id,
+ DetectedGame(const Common::String &engine, const PlainGameDescriptor &pgd);
+ DetectedGame(const Common::String &engine, const Common::String &id,
const Common::String &description,
Common::Language language = Common::UNK_LANG,
Common::Platform platform = Common::kPlatformUnknown,
@@ -109,10 +109,7 @@ struct DetectedGame {
void appendGUIOptions(const Common::String &str);
Common::String getGUIOptions() const { return _guiOptions; }
- /**
- * The name of the engine supporting the detected game
- */
- const char *engineName;
+ Common::String engineId;
/**
* A game was detected, but some files were not recognized
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index b4d5bff..1e465e9 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -104,27 +104,27 @@
namespace Glk {
GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename) :
- DetectedGame(id, desc, Common::EN_ANY, Common::kPlatformUnknown) {
+ DetectedGame("glk", id, desc, Common::EN_ANY, Common::kPlatformUnknown) {
setGUIOptions(GUIO3(GUIO_NOSPEECH, GUIO_NOMUSIC, GUIO_NOSUBTITLES));
addExtraEntry("filename", filename);
}
GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename,
- Common::Language lang) : DetectedGame(id, desc, lang, Common::kPlatformUnknown) {
+ Common::Language lang) : DetectedGame("glk", id, desc, lang, Common::kPlatformUnknown) {
setGUIOptions(GUIO3(GUIO_NOSPEECH, GUIO_NOMUSIC, GUIO_NOSUBTITLES));
addExtraEntry("filename", filename);
}
GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const char *xtra,
const Common::String &filename, Common::Language lang) :
- DetectedGame(id, desc, lang, Common::kPlatformUnknown, xtra) {
+ DetectedGame("glk", id, desc, lang, Common::kPlatformUnknown, xtra) {
setGUIOptions(GUIO3(GUIO_NOSPEECH, GUIO_NOMUSIC, GUIO_NOSUBTITLES));
addExtraEntry("filename", filename);
}
GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename,
const Common::String &md5, size_t filesize) :
- DetectedGame(id, desc, Common::UNK_LANG, Common::kPlatformUnknown) {
+ DetectedGame("glk", id, desc, Common::UNK_LANG, Common::kPlatformUnknown) {
setGUIOptions(GUIO3(GUIO_NOSPEECH, GUIO_NOMUSIC, GUIO_NOSUBTITLES));
addExtraEntry("filename", filename);
diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp
index d4ffee3..f699c83 100644
--- a/engines/glk/frotz/detection.cpp
+++ b/engines/glk/frotz/detection.cpp
@@ -123,7 +123,7 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize));
} else {
GameDescriptor gameDesc = findGame(p->_gameId);
- DetectedGame gd = DetectedGame(p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra);
+ DetectedGame gd = DetectedGame("glk", p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra);
gd.setGUIOptions(p->_guiOptions);
gd.addExtraEntry("filename", filename);
diff --git a/engines/glk/level9/detection.cpp b/engines/glk/level9/detection.cpp
index 5788c0f..a366bc0 100644
--- a/engines/glk/level9/detection.cpp
+++ b/engines/glk/level9/detection.cpp
@@ -752,7 +752,7 @@ bool Level9MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
continue;
// Found the game, add a detection entry
- DetectedGame gd = DetectedGame(game->gameId, game->name, Common::UNK_LANG,
+ DetectedGame gd = DetectedGame("glk", game->gameId, game->name, Common::UNK_LANG,
Common::kPlatformUnknown, game->extra);
gd.addExtraEntry("filename", filename);
gameList.push_back(gd);
diff --git a/engines/glk/tads/detection.cpp b/engines/glk/tads/detection.cpp
index 7bca1bb..9c0c5eb 100644
--- a/engines/glk/tads/detection.cpp
+++ b/engines/glk/tads/detection.cpp
@@ -110,7 +110,7 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
gameList.push_back(GlkDetectedGame(desc._gameId, desc._description, filename, md5, filesize));
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
- gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
+ gd = DetectedGame("glk", p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
gd.addExtraEntry("filename", filename);
gameList.push_back(gd);
}
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp
index f61adb4..72cdeee 100644
--- a/engines/illusions/menusystem.cpp
+++ b/engines/illusions/menusystem.cpp
@@ -673,14 +673,12 @@ MenuActionLoadGame::MenuActionLoadGame(BaseMenuSystem *menuSystem, uint choiceIn
}
void MenuActionLoadGame::execute() {
- const Plugin *plugin = NULL;
- EngineMan.findGame(ConfMan.get("gameid"), &plugin);
GUI::SaveLoadChooser *dialog;
Common::String desc;
int slot;
dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
- slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ slot = dialog->runModalWithCurrentTarget();
delete dialog;
@@ -698,14 +696,12 @@ MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIn
}
void MenuActionSaveGame::execute() {
- const Plugin *plugin = NULL;
- EngineMan.findGame(ConfMan.get("gameid"), &plugin);
GUI::SaveLoadChooser *dialog;
Common::String desc;
int slot;
dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
- slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ slot = dialog->runModalWithCurrentTarget();
desc = dialog->getResultString().c_str();
delete dialog;
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index 5c419e8..d258ea0 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -63,10 +63,6 @@ public:
_md5Bytes = 5000000; // TODO: Upper limit, adjust it once all games are added
}
- const char *getName() const {
- return "MacVenture";
- }
-
const char *getEngineId() const override {
return "macventure";
}
diff --git a/engines/metaengine.h b/engines/metaengine.h
index a95ff15..89f786f 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -65,6 +65,9 @@ class MetaEngine : public PluginObject {
public:
virtual ~MetaEngine() {}
+ /** Get the engine ID */
+ virtual const char *getEngineId() const = 0;
+
/** Returns some copyright information about the original engine. */
virtual const char *getOriginalCopyright() const = 0;
@@ -267,17 +270,37 @@ public:
*/
class EngineManager : public Common::Singleton<EngineManager> {
public:
- PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
- PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
+ /**
+ * Given a list of FSNodes in a given directory, detect a set of games contained within
+ *
+ * Returns an empty list if none are found.
+ */
DetectionResults detectGames(const Common::FSList &fslist) const;
+
+ /** Find a plugin by its engine ID */
+ const Plugin *findPlugin(const Common::String &engineId) const;
+
+ /** Get the list of all engine plugins */
const PluginList &getPlugins() const;
+ /** Find a target */ // TODO: Expand on description
+ PlainGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;
+
+ /** Find a game across all plugins */ // TODO: Naming, this should be gameId
+ PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
+
/**
* Create a target from the supplied game descriptor
*
* Returns the created target name.
*/
Common::String createTargetForGame(const DetectedGame &game);
+private:
+ /** Find a game across all loaded plugins */
+ PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
+
+ /** Find a loaded plugin with the given engine ID */
+ const Plugin *findLoadedPlugin(const Common::String &engineId) const;
};
/** Convenience shortcut for accessing the engine manager. */
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index b64f4dc..3c16122 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -870,8 +870,6 @@ void SavegameListBox::pageDown() {
}
int GameStateMenu::scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc) {
- const Plugin *plugin = nullptr;
- EngineMan.findGame(ConfMan.get("gameid"), &plugin);
GUI::SaveLoadChooser *dialog;
Common::String desc;
int slot;
@@ -879,7 +877,7 @@ int GameStateMenu::scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc)
if (isSave) {
dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
- slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ slot = dialog->runModalWithCurrentTarget();
desc = dialog->getResultString();
if (desc.empty())
@@ -891,7 +889,7 @@ int GameStateMenu::scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc)
saveDesc = desc;
} else {
dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
- slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ slot = dialog->runModalWithCurrentTarget();
}
delete dialog;
diff --git a/engines/obsolete.cpp b/engines/obsolete.cpp
index ea96cff..40fe832 100644
--- a/engines/obsolete.cpp
+++ b/engines/obsolete.cpp
@@ -58,8 +58,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList) {
PlainGameDescriptor findGameID(
const char *gameid,
const PlainGameDescriptor *gameids,
- const ObsoleteGameID *obsoleteList
- ) {
+ const ObsoleteGameID *obsoleteList) {
// First search the list of supported gameids for a match.
const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids);
if (g)
diff --git a/engines/obsolete.h b/engines/obsolete.h
index 7c7249e..c1bbad6 100644
--- a/engines/obsolete.h
+++ b/engines/obsolete.h
@@ -69,8 +69,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList);
PlainGameDescriptor findGameID(
const char *gameid,
const PlainGameDescriptor *gameids,
- const ObsoleteGameID *obsoleteList = 0
- );
+ const ObsoleteGameID *obsoleteList = 0);
} // End of namespace Engines
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 043fddc..a1aa5be 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -354,12 +354,7 @@ void PegasusEngine::runIntro() {
Common::Error PegasusEngine::showLoadDialog() {
GUI::SaveLoadChooser slc(_("Load game:"), _("Load"), false);
- Common::String gameId = ConfMan.get("gameid");
-
- const Plugin *plugin = nullptr;
- EngineMan.findGame(gameId, &plugin);
-
- int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ int slot = slc.runModalWithCurrentTarget();
Common::Error result;
@@ -378,12 +373,7 @@ Common::Error PegasusEngine::showLoadDialog() {
Common::Error PegasusEngine::showSaveDialog() {
GUI::SaveLoadChooser slc(_("Save game:"), _("Save"), true);
- Common::String gameId = ConfMan.get("gameid");
-
- const Plugin *plugin = nullptr;
- EngineMan.findGame(gameId, &plugin);
-
- int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ int slot = slc.runModalWithCurrentTarget();
if (slot >= 0)
return saveGameState(slot, slc.getResultString());
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index adfc7a3..1576ee3 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -1049,7 +1049,7 @@ DetectedGames ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
const PlainGameDescriptor *g = findPlainGameDescriptor(x->game.gameid, gameDescriptions);
assert(g);
- DetectedGame game = DetectedGame(x->game.gameid, g->description, x->language, x->game.platform, x->extra);
+ DetectedGame game = DetectedGame(getEngineId(), x->game.gameid, g->description, x->language, x->game.platform, x->extra);
// Compute and set the preferred target name for this game.
// Based on generateComplexID() in advancedDetector.cpp.
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 1934d84..9ce13a6 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -189,12 +189,12 @@ DetectedGames SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
if (sv->dinnerTableEntries) {
Common::String extra = Common::String::format("v0.0%d %s", sv->version, sv->extraDesc);
- DetectedGame game = DetectedGame(skySetting.gameId, skySetting.description, Common::UNK_LANG, Common::kPlatformUnknown, extra);
+ DetectedGame game = DetectedGame(getEngineId(), skySetting.gameId, skySetting.description, Common::UNK_LANG, Common::kPlatformUnknown, extra);
game.setGUIOptions(sv->guioptions);
detectedGames.push_back(game);
} else {
- detectedGames.push_back(DetectedGame(skySetting.gameId, skySetting.description));
+ detectedGames.push_back(DetectedGame(getEngineId(), skySetting.gameId, skySetting.description));
}
}
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index a02b02b..2d39a2d 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -218,17 +218,17 @@ DetectedGames SwordMetaEngine::detectGames(const Common::FSList &fslist) const {
DetectedGame game;
if (mainFilesFound && pcFilesFound && demoFilesFound)
- game = DetectedGame(sword1DemoSettings);
+ game = DetectedGame(getEngineId(), sword1DemoSettings);
else if (mainFilesFound && pcFilesFound && psxFilesFound)
- game = DetectedGame(sword1PSXSettings);
+ game = DetectedGame(getEngineId(), sword1PSXSettings);
else if (mainFilesFound && pcFilesFound && psxDemoFilesFound)
- game = DetectedGame(sword1PSXDemoSettings);
+ game = DetectedGame(getEngineId(), sword1PSXDemoSettings);
else if (mainFilesFound && pcFilesFound && !psxFilesFound)
- game = DetectedGame(sword1FullSettings);
+ game = DetectedGame(getEngineId(), sword1FullSettings);
else if (mainFilesFound && macFilesFound)
- game = DetectedGame(sword1MacFullSettings);
+ game = DetectedGame(getEngineId(), sword1MacFullSettings);
else if (mainFilesFound && macDemoFilesFound)
- game = DetectedGame(sword1MacDemoSettings);
+ game = DetectedGame(getEngineId(), sword1MacDemoSettings);
else
return detectedGames;
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 4e67f0d..2c682bc 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -196,7 +196,7 @@ DetectedGames detectGamesImpl(const Common::FSList &fslist, bool recursion = fal
continue;
// Match found, add to list of candidates, then abort inner loop.
- DetectedGame game = DetectedGame(g->gameid, g->description);
+ DetectedGame game = DetectedGame("sword2", g->gameid, g->description);
game.setGUIOptions(GUIO2(GUIO_NOMIDI, GUIO_NOASPECT));
detectedGames.push_back(game);
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index d249ea4..a7f6e1b 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -599,7 +599,7 @@ void EventRecorder::setFileHeader() {
return;
}
TimeDate t;
- PlainGameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
+ PlainGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName());
g_system->getTimeAndDate(t);
if (_author.empty()) {
setAuthor("Unknown Author");
@@ -618,9 +618,7 @@ SDL_Surface *EventRecorder::getSurface(int width, int height) {
}
bool EventRecorder::switchMode() {
- const Common::String gameId = ConfMan.get("gameid");
- const Plugin *plugin = nullptr;
- EngineMan.findGame(gameId, &plugin);
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
bool metaInfoSupport = plugin->get<MetaEngine>().hasFeature(MetaEngine::kSavesSupportMetaInfo);
bool featuresSupport = metaInfoSupport &&
g_engine->canSaveGameStateCurrently() &&
@@ -630,8 +628,10 @@ bool EventRecorder::switchMode() {
return false;
}
+ const Common::String target = ConfMan.getActiveDomainName();
+ SaveStateList saveList = plugin->get<MetaEngine>().listSaves(target.c_str());
+
int emptySlot = 1;
- SaveStateList saveList = plugin->get<MetaEngine>().listSaves(gameId.c_str());
for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) {
int saveSlot = x->getSaveSlot();
if (saveSlot == 0) {
@@ -666,10 +666,9 @@ bool EventRecorder::checkForContinueGame() {
void EventRecorder::deleteTemporarySave() {
if (_temporarySlot == -1) return;
- const Common::String gameId = ConfMan.get("gameid");
- const Plugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
- plugin->get<MetaEngine>().removeSaveState(gameId.c_str(), _temporarySlot);
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
+ const Common::String target = ConfMan.getActiveDomainName();
+ plugin->get<MetaEngine>().removeSaveState(target.c_str(), _temporarySlot);
_temporarySlot = -1;
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index ac414e0..c8c2cc0 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -269,8 +269,9 @@ void LauncherDialog::updateListing() {
if (gameid.empty())
gameid = iter->_key;
+
if (description.empty()) {
- PlainGameDescriptor g = EngineMan.findGame(gameid);
+ PlainGameDescriptor g = EngineMan.findTarget(iter->_key);
if (g.description)
description = g.description;
}
@@ -416,9 +417,6 @@ void LauncherDialog::editGame(int item) {
// This is useful because e.g. MonkeyVGA needs AdLib music to have decent
// music support etc.
assert(item >= 0);
- String gameId(ConfMan.get("gameid", _domains[item]));
- if (gameId.empty())
- gameId = _domains[item];
EditGameDialog editDialog(_domains[item]);
if (editDialog.runModal() > 0) {
@@ -480,17 +478,13 @@ void LauncherDialog::recordGame(int item) {
#endif
void LauncherDialog::loadGame(int item) {
- String gameId = ConfMan.get("gameid", _domains[item]);
- if (gameId.empty())
- gameId = _domains[item];
-
- const Plugin *plugin = nullptr;
-
- EngineMan.findGame(gameId, &plugin);
-
String target = _domains[item];
target.toLowercase();
+ // Look for the plugin
+ const Plugin *plugin = nullptr;
+ EngineMan.findTarget(target, &plugin);
+
if (plugin) {
const MetaEngine &metaEngine = plugin->get<MetaEngine>();
if (metaEngine.hasFeature(MetaEngine::kSupportsListSaves) &&
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index f4d857a..1d1d119 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -207,7 +207,7 @@ void MassAddDialog::handleTickle() {
while (path != "/" && path.lastChar() == '/')
path.deleteLastChar();
- // Check for existing config entries for this path/gameid/lang/platform combination
+ // Check for existing config entries for this path/engineid/gameid/lang/platform combination
if (_pathToTargets.contains(path)) {
Common::String resultPlatformCode = Common::getPlatformCode(result.platform);
Common::String resultLanguageCode = Common::getLanguageCode(result.language);
@@ -215,11 +215,12 @@ void MassAddDialog::handleTickle() {
bool duplicate = false;
const StringArray &targets = _pathToTargets[path];
for (StringArray::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) {
- // If the gameid, platform and language match -> skip it
+ // If the engineid, gameid, platform and language match -> skip it
Common::ConfigManager::Domain *dom = ConfMan.getDomain(*iter);
assert(dom);
- if ((*dom)["gameid"] == result.gameId &&
+ if ((*dom)["engineid"] == result.engineId &&
+ (*dom)["gameid"] == result.gameId &&
(*dom)["platform"] == resultPlatformCode &&
(*dom)["language"] == resultLanguageCode) {
duplicate = true;
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index 7a2cd04..ced5bcb 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -166,8 +166,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
break;
case kRecordCmd: {
TimeDate t;
- Common::String gameId = ConfMan.get("gameid", _target);
- PlainGameDescriptor desc = EngineMan.findGame(gameId);
+ PlainGameDescriptor desc = EngineMan.findTarget(_target);
g_system->getTimeAndDate(t);
EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description, "");
if (editDlg.runModal() != kOKCmd) {
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 6de8be9..4e2525a 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -76,11 +76,7 @@ Common::String SaveLoadChooser::createDefaultSaveDescription(const int slot) con
}
int SaveLoadChooser::runModalWithCurrentTarget() {
- const Common::String gameId = ConfMan.get("gameid");
-
- const Plugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
-
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
return runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
}
diff --git a/gui/unknown-game-dialog.cpp b/gui/unknown-game-dialog.cpp
index 790f724..cdbfcd4 100644
--- a/gui/unknown-game-dialog.cpp
+++ b/gui/unknown-game-dialog.cpp
@@ -193,13 +193,13 @@ Common::String UnknownGameDialog::generateBugtrackerURL() {
Common::String report = generateUnknownGameReport(_detectedGame, false, false);
report = encodeUrlString(report);
- Common::String engineName = encodeUrlString(_detectedGame.engineName);
+ Common::String engineId = encodeUrlString(_detectedGame.engineId);
return Common::String::format(
"https://www.scummvm.org/unknowngame?"
"engine=%s"
"&description=%s",
- engineName.c_str(),
+ engineId.c_str(),
report.c_str());
}
Commit: ae9f764c7ac4fcc418ca7182163f4e9646f4bc31
https://github.com/scummvm/scummvm/commit/ae9f764c7ac4fcc418ca7182163f4e9646f4bc31
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
ENGINES: Automatically upgrade the targets on launch to add an engine ID
Changed paths:
base/commandLine.cpp
base/main.cpp
base/plugins.cpp
engines/metaengine.h
gui/editgamedialog.cpp
gui/launcher.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 74a5982..5c823b2 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -769,6 +769,7 @@ static Common::Error listSaves(const Common::String &target) {
const Plugin *plugin = nullptr;
PlainGameDescriptor game;
if (domain) {
+ EngineMan.upgradeTargetIfNecessary(target);
game = EngineMan.findTarget(target, &plugin);
} else {
game = EngineMan.findGame(target, &plugin);
diff --git a/base/main.cpp b/base/main.cpp
index 45c8e39..85fdbb2 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -545,6 +545,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
while (0 != ConfMan.getActiveDomain()) {
saveLastLaunchedTarget(ConfMan.getActiveDomainName());
+ EngineMan.upgradeTargetIfNecessary(ConfMan.getActiveDomainName());
+
// Try to find a plugin which feels responsible for the specified game.
const Plugin *plugin = detectPlugin();
if (plugin) {
diff --git a/base/plugins.cpp b/base/plugins.cpp
index a64dbdd..ac98de4 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -675,6 +675,90 @@ PlainGameDescriptor EngineManager::findTarget(const Common::String &target, cons
return desc;
}
+void EngineManager::upgradeTargetIfNecessary(const Common::String &target) const {
+ Common::ConfigManager::Domain *domain = ConfMan.getDomain(target);
+ assert(domain);
+
+ if (!domain->contains("engineid")) {
+ upgradeTargetForEngineId(target);
+ }
+}
+
+void EngineManager::upgradeTargetForEngineId(const Common::String &target) const {
+ Common::ConfigManager::Domain *domain = ConfMan.getDomain(target);
+ assert(domain);
+
+ debug("Target '%s' lacks an engine ID, upgrading...", target.c_str());
+
+ Common::String oldGameId = domain->getVal("gameid");
+ Common::String path = domain->getVal("path");
+
+ // At this point the game ID and game path must be known
+ if (oldGameId.empty()) {
+ warning("The game ID is required to upgrade target '%s'", target.c_str());
+ return;
+ }
+ if (path.empty()) {
+ warning("The game path is required to upgrade target '%s'", target.c_str());
+ return;
+ }
+
+ // Game descriptor for the upgraded target
+ Common::String engineId;
+ Common::String newGameId;
+
+ // First, try to update entries for engines that previously used the "single id" system
+ // Search for an engine whose ID is the game ID
+ const Plugin *plugin = findPlugin(oldGameId);
+ if (plugin) {
+ // Run detection on the game path
+ Common::FSNode dir(path);
+ Common::FSList files;
+ if (!dir.getChildren(files, Common::FSNode::kListAll)) {
+ warning("Failed to access path '%s' when upgrading target '%s'", path.c_str(), target.c_str());
+ return;
+ }
+
+ // Take the first detection entry
+ const MetaEngine &metaEngine = plugin->get<MetaEngine>();
+ DetectedGames candidates = metaEngine.detectGames(files);
+ if (candidates.empty()) {
+ warning("No games supported by the engine '%s' were found in path '%s' when upgrading target '%s'",
+ metaEngine.getEngineId(), path.c_str(), target.c_str());
+ return;
+ }
+
+ engineId = candidates[0].engineId;
+ newGameId = candidates[0].gameId;
+ }
+
+ // Next, try to find an engine with the game ID in its supported games list
+ if (engineId.empty()) {
+ PlainGameDescriptor pgd = findGame(oldGameId, &plugin);
+ if (plugin) {
+ engineId = plugin->get<MetaEngine>().getEngineId();
+ newGameId = pgd.gameId;
+ }
+ }
+
+ if (engineId.empty() || newGameId.empty()) {
+ warning("No matching engine was found when upgrading target '%s'", target.c_str());
+ return;
+ }
+
+ domain->setVal("engineid", engineId);
+ domain->setVal("gameid", newGameId);
+
+ // Save a backup of the pre-upgrade gameId to the config file
+ if (newGameId != oldGameId) {
+ domain->setVal("oldgameid", oldGameId);
+ }
+
+ debug("Upgrade complete (engine ID '%s', game ID '%s')", engineId.c_str(), newGameId.c_str());
+
+ ConfMan.flushToDisk();
+}
+
// Music plugins
#include "audio/musicplugin.h"
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 89f786f..a6c2c06 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -295,12 +295,19 @@ public:
* Returns the created target name.
*/
Common::String createTargetForGame(const DetectedGame &game);
+
+ /** Upgrade a target to the current configuration format */
+ void upgradeTargetIfNecessary(const Common::String &target) const;
+
private:
/** Find a game across all loaded plugins */
PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
/** Find a loaded plugin with the given engine ID */
const Plugin *findLoadedPlugin(const Common::String &engineId) const;
+
+ /** Use heuristics to complete a target lacking an engine ID */
+ void upgradeTargetForEngineId(const Common::String &target) const;
};
/** Convenience shortcut for accessing the engine manager. */
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index ac030d7..4f3c164 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -100,6 +100,8 @@ protected:
EditGameDialog::EditGameDialog(const String &domain)
: OptionsDialog(domain, "GameOptions") {
+ EngineMan.upgradeTargetIfNecessary(domain);
+
// Retrieve all game specific options.
const Plugin *plugin = nullptr;
// To allow for game domains without a gameid.
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index c8c2cc0..a3151a0 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -481,6 +481,8 @@ void LauncherDialog::loadGame(int item) {
String target = _domains[item];
target.toLowercase();
+ EngineMan.upgradeTargetIfNecessary(target);
+
// Look for the plugin
const Plugin *plugin = nullptr;
EngineMan.findTarget(target, &plugin);
Commit: 3d34c3e5c0736c32bb88d5e4465fc815d97a3dc3
https://github.com/scummvm/scummvm/commit/3d34c3e5c0736c32bb88d5e4465fc815d97a3dc3
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
MOHAWK: Stop relying on the target to detect the current game
The target is user defined and not may not contain the game name
Changed paths:
engines/mohawk/detection.cpp
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index bc7f6cd..96b68af 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -23,6 +23,7 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
+#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
#include "common/textconsole.h"
@@ -260,11 +261,12 @@ SaveStateList MohawkMetaEngine::listSavesForPrefix(const char *prefix, const cha
}
SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
+ Common::String gameId = ConfMan.get("gameid", target);
SaveStateList saveList;
// Loading games is only supported in Myst/Riven currently.
#ifdef ENABLE_MYST
- if (strstr(target, "myst")) {
+ if (gameId == "myst") {
saveList = listSavesForPrefix("myst", "mys");
for (SaveStateList::iterator save = saveList.begin(); save != saveList.end(); ++save) {
@@ -276,7 +278,7 @@ SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
}
#endif
#ifdef ENABLE_RIVEN
- if (strstr(target, "riven")) {
+ if (gameId == "riven") {
saveList = listSavesForPrefix("riven", "rvn");
for (SaveStateList::iterator save = saveList.begin(); save != saveList.end(); ++save) {
@@ -292,28 +294,31 @@ SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
}
void MohawkMetaEngine::removeSaveState(const char *target, int slot) const {
+ Common::String gameId = ConfMan.get("gameid", target);
// Removing saved games is only supported in Myst/Riven currently.
#ifdef ENABLE_MYST
- if (strstr(target, "myst")) {
+ if (gameId == "myst") {
Mohawk::MystGameState::deleteSave(slot);
}
#endif
#ifdef ENABLE_RIVEN
- if (strstr(target, "riven")) {
+ if (gameId == "riven") {
Mohawk::RivenSaveLoad::deleteSave(slot);
}
#endif
}
SaveStateDescriptor MohawkMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::String gameId = ConfMan.get("gameid", target);
+
#ifdef ENABLE_MYST
- if (strstr(target, "myst")) {
+ if (gameId == "myst") {
return Mohawk::MystGameState::querySaveMetaInfos(slot);
}
#endif
#ifdef ENABLE_RIVEN
- if (strstr(target, "riven")) {
+ if (gameId == "riven") {
return Mohawk::RivenSaveLoad::querySaveMetaInfos(slot);
} else
#endif
Commit: 47a2b2a9a21c0134254cc9cb2990cc30c7ca1a66
https://github.com/scummvm/scummvm/commit/47a2b2a9a21c0134254cc9cb2990cc30c7ca1a66
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
BASE: Add a command line option to list the engines
Changed paths:
base/commandLine.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 5c823b2..692d8bb 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -68,6 +68,7 @@ static const char HELP_STRING[] =
" -h, --help Display a brief help text and exit\n"
" -z, --list-games Display list of supported games and exit\n"
" -t, --list-targets Display list of configured targets and exit\n"
+ " --list-engines Display list of suppported engines and exit\n"
" --list-saves Display a list of saved games for the target specified\n"
" with --game=TARGET, or all targets if none is specified\n"
" -a, --add Add all games from current or specified directory.\n"
@@ -441,6 +442,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
DO_COMMAND('z', "list-games")
END_COMMAND
+ DO_LONG_COMMAND("list-engines")
+ END_COMMAND
+
DO_COMMAND('a', "add")
END_COMMAND
@@ -688,16 +692,44 @@ unknownOption:
/** List all supported game IDs, i.e. all games which any loaded plugin supports. */
static void listGames() {
- printf("Game ID Full Title \n"
- "-------------------- ------------------------------------------------------\n");
+ printf("Engine ID Game ID Full Title \n"
+ "--------------- -------------------- ------------------------------------------------------\n");
+
+ Common::Array<Common::String> games;
const PluginList &plugins = EngineMan.getPlugins();
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
- PlainGameList list = (*iter)->get<MetaEngine>().getSupportedGames();
- for (PlainGameList::iterator v = list.begin(); v != list.end(); ++v) {
- printf("%-20s %s\n", v->gameId, v->description);
+ MetaEngine &metaengine = (*iter)->get<MetaEngine>();
+
+ PlainGameList list = metaengine.getSupportedGames();
+ for (PlainGameList::const_iterator v = list.begin(); v != list.end(); ++v) {
+ games.push_back(Common::String::format("%-15s %-20s %s", metaengine.getEngineId(), v->gameId, v->description));
}
}
+
+ Common::sort(games.begin(), games.end());
+
+ for (Common::Array<Common::String>::const_iterator i = games.begin(), end = games.end(); i != end; ++i)
+ printf("%s\n", i->c_str());
+}
+
+/** List all supported engines, i.e. all loaded plugins. */
+static void listEngines() {
+ printf("Engine ID Engine Name \n"
+ "--------------- ------------------------------------------------------\n");
+
+ Common::Array<Common::String> engines;
+
+ const PluginList &plugins = EngineMan.getPlugins();
+ for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
+ const MetaEngine &metaEngine = (*iter)->get<MetaEngine>();
+ engines.push_back(Common::String::format("%-15s %s", metaEngine.getEngineId(), metaEngine.getName()));
+ }
+
+ Common::sort(engines.begin(), engines.end());
+
+ for (Common::Array<Common::String>::const_iterator i = engines.begin(), end = engines.end(); i != end; ++i)
+ printf("%s\n", i->c_str());
}
/** List all targets which are configured in the config file. */
@@ -1188,6 +1220,9 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
} else if (command == "list-games") {
listGames();
return true;
+ } else if (command == "list-engines") {
+ listEngines();
+ return true;
} else if (command == "list-saves") {
err = listSaves(settings["game"]);
return true;
Commit: c142838122c49811a3b77c6909705aab7121c6ff
https://github.com/scummvm/scummvm/commit/c142838122c49811a3b77c6909705aab7121c6ff
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
BASE: Change the command line interface to use engine-qualified game names
Qualified game names have the following form: engineId:gameId.
Unqualified game names are still supported as long as they are not
ambiguous. However they are considered deprecated and are no longer
displayed by the --list-games command.
Changed paths:
base/commandLine.cpp
base/main.cpp
base/plugins.cpp
engines/game.cpp
engines/game.h
engines/metaengine.h
gui/EventRecorder.cpp
gui/editgamedialog.cpp
gui/launcher.cpp
gui/recorderdialog.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 692d8bb..bcc4304 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -35,9 +35,9 @@
#include "common/config-manager.h"
#include "common/fs.h"
#include "common/rendermode.h"
-#include "common/stack.h"
#include "common/system.h"
#include "common/textconsole.h"
+#include "common/tokenizer.h"
#include "gui/ThemeEngine.h"
@@ -203,6 +203,10 @@ static void ensureFirstCommand(const Common::String &existingCommand, const char
usage("--%s: Cannot accept more than one command (already found --%s).", newCommand, existingCommand.c_str());
}
+static Common::String buildQualifiedGameName(const Common::String &engineId, const Common::String &gameId) {
+ return Common::String::format("%s:%s", engineId.c_str(), gameId.c_str());
+}
+
#endif // DISABLE_COMMAND_LINE
@@ -309,6 +313,70 @@ void registerDefaults() {
#endif
}
+static bool parseGameName(const Common::String &gameName, Common::String &engineId, Common::String &gameId) {
+ Common::StringTokenizer tokenizer(gameName, ":");
+ Common::String token1, token2;
+
+ if (!tokenizer.empty()) {
+ token1 = tokenizer.nextToken();
+ }
+
+ if (!tokenizer.empty()) {
+ token2 = tokenizer.nextToken();
+ }
+
+ if (!tokenizer.empty()) {
+ return false; // Stray colon
+ }
+
+ if (!token1.empty() && !token2.empty()) {
+ engineId = token1;
+ gameId = token2;
+ return true;
+ } else if (!token1.empty()) {
+ engineId.clear();
+ gameId = token1;
+ return true;
+ }
+
+ return false;
+}
+
+static QualifiedGameDescriptor findGameMatchingName(const Common::String &name) {
+ if (name.empty()) {
+ return QualifiedGameDescriptor();
+ }
+
+ Common::String engineId;
+ Common::String gameId;
+ if (!parseGameName(name, engineId, gameId)) {
+ return QualifiedGameDescriptor(); // Invalid name format
+ }
+
+ // Check if the name is a known game id
+ QualifiedGameList games = EngineMan.findGamesMatching(engineId, gameId);
+ if (games.size() != 1) {
+ // Game not found or ambiguous name
+ return QualifiedGameDescriptor();
+ }
+
+ return games[0];
+}
+
+static Common::String createTemporaryTarget(const Common::String &engineId, const Common::String &gameId) {
+ Common::String domainName = gameId;
+
+ ConfMan.addGameDomain(domainName);
+ ConfMan.set("engineid", engineId, domainName);
+ ConfMan.set("gameid", gameId, domainName);
+
+ // We designate targets which come strictly from command line
+ // so ConfMan will not save them to the configuration file.
+ ConfMan.set("id_came_from_command_line", "1", domainName);
+
+ return domainName;
+}
+
//
// Various macros used by the command line parser.
//
@@ -692,18 +760,18 @@ unknownOption:
/** List all supported game IDs, i.e. all games which any loaded plugin supports. */
static void listGames() {
- printf("Engine ID Game ID Full Title \n"
- "--------------- -------------------- ------------------------------------------------------\n");
+ printf("Game ID Full Title \n"
+ "------------------------------ -----------------------------------------------------------\n");
Common::Array<Common::String> games;
const PluginList &plugins = EngineMan.getPlugins();
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
- MetaEngine &metaengine = (*iter)->get<MetaEngine>();
+ const MetaEngine &metaengine = (*iter)->get<MetaEngine>();
PlainGameList list = metaengine.getSupportedGames();
for (PlainGameList::const_iterator v = list.begin(); v != list.end(); ++v) {
- games.push_back(Common::String::format("%-15s %-20s %s", metaengine.getEngineId(), v->gameId, v->description));
+ games.push_back(Common::String::format("%-30s %s", buildQualifiedGameName(metaengine.getEngineId(), v->gameId).c_str(), v->description));
}
}
@@ -749,7 +817,7 @@ static void listTargets() {
// If there's no description, fallback on the default description.
if (description.empty()) {
- PlainGameDescriptor g = EngineMan.findTarget(name);
+ QualifiedGameDescriptor g = EngineMan.findTarget(name);
if (g.description)
description = g.description;
}
@@ -767,13 +835,13 @@ static void listTargets() {
}
/** List all saves states for the given target. */
-static Common::Error listSaves(const Common::String &target) {
+static Common::Error listSaves(const Common::String &singleTarget) {
Common::Error result = Common::kNoError;
// If no target is specified, list save games for all known targets
Common::Array<Common::String> targets;
- if (!target.empty())
- targets.push_back(target);
+ if (!singleTarget.empty())
+ targets.push_back(singleTarget);
else {
const Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
Common::ConfigManager::DomainMap::const_iterator iter;
@@ -790,51 +858,56 @@ static Common::Error listSaves(const Common::String &target) {
bool atLeastOneFound = false;
for (Common::Array<Common::String>::const_iterator i = targets.begin(), end = targets.end(); i != end; ++i) {
- // Grab the "target" domain, if any
- const Common::ConfigManager::Domain *domain = ConfMan.getDomain(*i);
-
- // Set up the game domain as newly active domain, so
- // target specific savepath will be checked
- ConfMan.setActiveDomain(*i);
-
- // Look for a game matching the target
+ // Check whether there is either a game domain (i.e. a target) matching
+ // the specified game name, or alternatively whether there is a matching game id.
+ Common::String currentTarget;
+ QualifiedGameDescriptor game;
const Plugin *plugin = nullptr;
- PlainGameDescriptor game;
- if (domain) {
- EngineMan.upgradeTargetIfNecessary(target);
- game = EngineMan.findTarget(target, &plugin);
+ if (ConfMan.hasGameDomain(*i)) {
+ // The name is a known target
+ currentTarget = *i;
+ EngineMan.upgradeTargetIfNecessary(*i);
+ game = EngineMan.findTarget(*i, &plugin);
+ } else if (game = findGameMatchingName(*i), game.gameId) {
+ // The name is a known game id
+ plugin = EngineMan.findPlugin(game.engineId);
+ currentTarget = createTemporaryTarget(game.engineId, game.gameId);
} else {
- game = EngineMan.findGame(target, &plugin);
+ return Common::Error(Common::kEnginePluginNotFound, Common::String::format("target '%s'", singleTarget.c_str()));
}
+ // If we actually found a domain, we're going to change the domain
+ ConfMan.setActiveDomain(currentTarget);
+
if (!plugin) {
// If the target was specified, treat this as an error, and otherwise skip it.
- if (!target.empty())
+ if (!singleTarget.empty())
return Common::Error(Common::kEnginePluginNotFound,
- Common::String::format("target '%s', gameid '%s", i->c_str(), game.gameId));
- printf("Plugin could not be loaded for target '%s', gameid '%s", i->c_str(), game.gameId);
+ Common::String::format("target '%s'", i->c_str()));
+ printf("Plugin could not be loaded for target '%s'\n", i->c_str());
continue;
}
const MetaEngine &metaEngine = plugin->get<MetaEngine>();
+ Common::String qualifiedGameId = buildQualifiedGameName(game.engineId, game.gameId);
if (!metaEngine.hasFeature(MetaEngine::kSupportsListSaves)) {
// If the target was specified, treat this as an error, and otherwise skip it.
- if (!target.empty())
+ if (!singleTarget.empty())
// TODO: Include more info about the target (desc, engine name, ...) ???
return Common::Error(Common::kEnginePluginNotSupportSaves,
- Common::String::format("target '%s', gameid '%s", i->c_str(), game.gameId));
+ Common::String::format("target '%s', gameid '%s'", i->c_str(), qualifiedGameId.c_str()));
continue;
}
// Query the plugin for a list of saved games
SaveStateList saveList = metaEngine.listSaves(i->c_str());
- if (saveList.size() > 0) {
+ if (!saveList.empty()) {
// TODO: Include more info about the target (desc, engine name, ...) ???
if (atLeastOneFound)
printf("\n");
- printf("Save states for target '%s' (gameid '%s'):\n", i->c_str(), game.gameId);
+ printf("Save states for target '%s' (gameid '%s'):\n", i->c_str(), qualifiedGameId.c_str());
printf(" Slot Description \n"
" ---- ------------------------------------------------------\n");
@@ -845,15 +918,15 @@ static Common::Error listSaves(const Common::String &target) {
atLeastOneFound = true;
} else {
// If the target was specified, indicate no save games were found for it. Otherwise just skip it.
- if (!target.empty())
- printf("There are no save states for target '%s' (gameid '%s'):\n", i->c_str(), game.gameId);
+ if (!singleTarget.empty())
+ printf("There are no save states for target '%s' (gameid '%s'):\n", i->c_str(), qualifiedGameId.c_str());
}
}
// Revert to the old active domain
ConfMan.setActiveDomain(oldDomain);
- if (!atLeastOneFound && target.empty())
+ if (!atLeastOneFound && singleTarget.empty())
printf("No save states could be found.\n");
return result;
@@ -909,16 +982,17 @@ static DetectedGames getGameList(const Common::FSNode &dir) {
return detectionResults.listRecognizedGames();
}
-static DetectedGames recListGames(const Common::FSNode &dir, const Common::String &gameId, bool recursive) {
+static DetectedGames recListGames(const Common::FSNode &dir, const Common::String &engineId, const Common::String &gameId, bool recursive) {
DetectedGames list = getGameList(dir);
if (recursive) {
Common::FSList files;
dir.getChildren(files, Common::FSNode::kListDirectoriesOnly);
for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) {
- DetectedGames rec = recListGames(*file, gameId, recursive);
+ DetectedGames rec = recListGames(*file, engineId, gameId, recursive);
for (DetectedGames::const_iterator game = rec.begin(); game != rec.end(); ++game) {
- if (gameId.empty() || game->gameId == gameId)
+ if ((game->engineId == engineId && game->gameId == gameId)
+ || gameId.empty())
list.push_back(*game);
}
}
@@ -928,11 +1002,11 @@ static DetectedGames recListGames(const Common::FSNode &dir, const Common::Strin
}
/** Display all games in the given directory, return ID of first detected game */
-static Common::String detectGames(const Common::String &path, const Common::String &gameId, bool recursive) {
+static Common::String detectGames(const Common::String &path, const Common::String &engineId, const Common::String &gameId, bool recursive) {
bool noPath = path.empty();
//Current directory
Common::FSNode dir(path);
- DetectedGames candidates = recListGames(dir, gameId, recursive);
+ DetectedGames candidates = recListGames(dir, engineId, gameId, recursive);
if (candidates.empty()) {
printf("WARNING: ScummVM could not find any game in %s\n", dir.getPath().c_str());
@@ -945,28 +1019,31 @@ static Common::String detectGames(const Common::String &path, const Common::Stri
return Common::String();
}
// TODO this is not especially pretty
- printf("EngineID GameID Description Full Path\n");
- printf("-------------- -------------- ---------------------------------------------------------- ---------------------------------------------------------\n");
+ printf("GameID Description Full Path\n");
+ printf("------------------------------ ---------------------------------------------------------- ---------------------------------------------------------\n");
for (DetectedGames::const_iterator v = candidates.begin(); v != candidates.end(); ++v) {
- printf("%-14s %-14s %-58s %s\n",
- v->engineId.c_str(),
- v->gameId.c_str(),
+ printf("%-30s %-58s %s\n",
+ buildQualifiedGameName(v->engineId, v->gameId).c_str(),
v->description.c_str(),
v->path.c_str());
}
- return candidates[0].gameId;
+ return buildQualifiedGameName(candidates[0].engineId, candidates[0].gameId);
}
-static int recAddGames(const Common::FSNode &dir, const Common::String &game, bool recursive) {
+static int recAddGames(const Common::FSNode &dir, const Common::String &engineId, const Common::String &gameId, bool recursive) {
int count = 0;
DetectedGames list = getGameList(dir);
for (DetectedGames::const_iterator v = list.begin(); v != list.end(); ++v) {
- if (v->gameId != game && !game.empty()) {
- printf("Found %s, only adding %s per --game option, ignoring...\n", v->gameId.c_str(), game.c_str());
+ if ((v->engineId != engineId || v->gameId != gameId)
+ && !gameId.empty()) {
+ printf("Found %s, only adding %s per --game option, ignoring...\n",
+ buildQualifiedGameName(v->engineId, v->gameId).c_str(),
+ buildQualifiedGameName(engineId, gameId).c_str());
} else if (ConfMan.hasGameDomain(v->preferredTarget)) {
// TODO Better check for game already added?
- printf("Found %s, but has already been added, skipping\n", v->gameId.c_str());
+ printf("Found %s, but has already been added, skipping\n",
+ buildQualifiedGameName(v->engineId, v->gameId).c_str());
} else {
Common::String target = EngineMan.createTargetForGame(*v);
count++;
@@ -974,7 +1051,7 @@ static int recAddGames(const Common::FSNode &dir, const Common::String &game, bo
// Display added game info
printf("Game Added: \n Target: %s\n GameID: %s\n Name: %s\n Language: %s\n Platform: %s\n",
target.c_str(),
- v->gameId.c_str(),
+ buildQualifiedGameName(v->engineId, v->gameId).c_str(),
v->description.c_str(),
Common::getLanguageDescription(v->language),
Common::getPlatformDescription(v->platform)
@@ -986,7 +1063,7 @@ static int recAddGames(const Common::FSNode &dir, const Common::String &game, bo
Common::FSList files;
if (dir.getChildren(files, Common::FSNode::kListDirectoriesOnly)) {
for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) {
- count += recAddGames(*file, game, recursive);
+ count += recAddGames(*file, engineId, gameId, recursive);
}
}
}
@@ -994,10 +1071,10 @@ static int recAddGames(const Common::FSNode &dir, const Common::String &game, bo
return count;
}
-static bool addGames(const Common::String &path, const Common::String &game, bool recursive) {
+static bool addGames(const Common::String &path, const Common::String &engineId, const Common::String &gameId, bool recursive) {
//Current directory
Common::FSNode dir(path);
- int added = recAddGames(dir, game, recursive);
+ int added = recAddGames(dir, engineId, gameId, recursive);
printf("Added %d games\n", added);
if (added == 0 && !recursive) {
printf("Consider using --recursive to search inside subdirectories\n");
@@ -1211,6 +1288,15 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
#ifndef DISABLE_COMMAND_LINE
+ // Check the --game argument refers to a known game id.
+ QualifiedGameDescriptor gameOption;
+ if (settings.contains("game")) {
+ gameOption = findGameMatchingName(settings["game"]);
+ if (!gameOption.gameId) {
+ usage("Unrecognized game '%s'. Use the --list-games command for a list of accepted values.\n", settings["game"].c_str());
+ }
+ }
+
// Handle commands passed via the command line (like --list-targets and
// --list-games). This must be done after the config file and the plugins
// have been loaded.
@@ -1252,17 +1338,17 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// From an UX point of view, however, it might get confusing.
// Consider removing this if consensus says otherwise.
} else {
- command = detectGames(settings["path"], settings["game"], resursive);
+ command = detectGames(settings["path"], gameOption.engineId, gameOption.gameId, resursive);
if (command.empty()) {
err = Common::kNoGameDataFoundError;
return true;
}
}
} else if (command == "detect") {
- detectGames(settings["path"], settings["game"], settings["recursive"] == "true");
+ detectGames(settings["path"], gameOption.engineId, gameOption.gameId, settings["recursive"] == "true");
return true;
} else if (command == "add") {
- addGames(settings["path"], settings["game"], settings["recursive"] == "true");
+ addGames(settings["path"], gameOption.engineId, gameOption.gameId, settings["recursive"] == "true");
return true;
}
#ifdef DETECTOR_TESTING_HACK
@@ -1285,28 +1371,17 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// domain (i.e. a target) matching this argument, or alternatively
// whether there is a gameid matching that name.
if (!command.empty()) {
- PlainGameDescriptor gd;
- const Plugin *plugin = nullptr;
+ QualifiedGameDescriptor gd;
if (ConfMan.hasGameDomain(command)) {
// Command is a known target
ConfMan.setActiveDomain(command);
- } else if (gd = EngineMan.findGame(command, &plugin), gd.gameId) {
+ } else if (gd = findGameMatchingName(command), gd.gameId) {
// Command is a known game ID
- ConfMan.setActiveDomain(command);
-
- ConfMan.set("gameid", gd.gameId);
- ConfMan.set("engineid", plugin->get<MetaEngine>().getEngineId());
-
- // WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching
- // undefined target adds launcher entry"
- //
- // We designate gameids which come strictly from command line
- // so AdvancedDetector will not save config file with invalid
- // gameid in case target autoupgrade was performed
- ConfMan.set("id_came_from_command_line", "1");
+ Common::String domainName = createTemporaryTarget(gd.engineId, gd.gameId);
+ ConfMan.setActiveDomain(domainName);
} else {
#ifndef DISABLE_COMMAND_LINE
- usage("Unrecognized game target '%s'", command.c_str());
+ usage("Unrecognized game '%s'. Use the --list-targets and --list-games commands for a list of accepted values.", command.c_str());
#endif // DISABLE_COMMAND_LINE
}
}
diff --git a/base/main.cpp b/base/main.cpp
index 85fdbb2..5df9fec 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -219,7 +219,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
Common::String caption(ConfMan.get("description"));
if (caption.empty()) {
- PlainGameDescriptor game = EngineMan.findTarget(ConfMan.getActiveDomainName());
+ QualifiedGameDescriptor game = EngineMan.findTarget(ConfMan.getActiveDomainName());
if (game.description) {
caption = game.description;
}
diff --git a/base/plugins.cpp b/base/plugins.cpp
index ac98de4..6a24409 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -479,50 +479,54 @@ DECLARE_SINGLETON(EngineManager);
* This function works for both cached and uncached PluginManagers.
* For the cached version, most of the logic here will short circuit.
*
- * For the uncached version, we first try to find the plugin using the gameId
+ * For the uncached version, we first try to find the plugin using the engineId
* and only if we can't find it there, we loop through the plugins.
**/
-PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const {
- // First look for the game using the plugins in memory. This is critical
- // for calls coming from inside games
- PlainGameDescriptor result = findGameInLoadedPlugins(gameName, plugin);
- if (result.gameId) {
- return result;
+QualifiedGameList EngineManager::findGamesMatching(const Common::String &engineId, const Common::String &gameId) const {
+ QualifiedGameList results;
+
+ if (!engineId.empty()) {
+ // If we got an engine name, look for THE game only in that engine
+ const Plugin *p = EngineMan.findPlugin(engineId);
+ if (p) {
+ const MetaEngine &engine = p->get<MetaEngine>();
+
+ PlainGameDescriptor pluginResult = engine.findGame(gameId.c_str());
+ if (pluginResult.gameId) {
+ results.push_back(QualifiedGameDescriptor(engine.getEngineId(), pluginResult));
+ }
+ }
+ } else {
+ // This is a slow path, we have to scan the list of plugins
+ PluginMan.loadFirstPlugin();
+ do {
+ results.push_back(findGameInLoadedPlugins(gameId));
+ } while (PluginMan.loadNextPlugin());
}
- // We failed to find it in memory. Scan the list of plugins
- PluginMan.loadFirstPlugin();
- do {
- result = findGameInLoadedPlugins(gameName, plugin);
- if (result.gameId)
- break;
- } while (PluginMan.loadNextPlugin());
-
- return result;
+ return results;
}
/**
* Find the game within the plugins loaded in memory
**/
-PlainGameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const {
+QualifiedGameList EngineManager::findGameInLoadedPlugins(const Common::String &gameId) const {
// Find the GameDescriptor for this target
const PluginList &plugins = getPlugins();
- if (plugin)
- *plugin = 0;
-
+ QualifiedGameList results;
PluginList::const_iterator iter;
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
- PlainGameDescriptor pgd = (*iter)->get<MetaEngine>().findGame(gameName.c_str());
- if (pgd.gameId) {
- if (plugin)
- *plugin = *iter;
- return pgd;
+ const MetaEngine &engine = (*iter)->get<MetaEngine>();
+ PlainGameDescriptor pluginResult = engine.findGame(gameId.c_str());
+
+ if (pluginResult.gameId) {
+ results.push_back(QualifiedGameDescriptor(engine.getEngineId(), pluginResult));
}
}
- return PlainGameDescriptor::empty();
+ return results;
}
DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const {
@@ -650,29 +654,33 @@ const Plugin *EngineManager::findPlugin(const Common::String &engineId) const {
return 0;
}
-PlainGameDescriptor EngineManager::findTarget(const Common::String &target, const Plugin **plugin) const {
+QualifiedGameDescriptor EngineManager::findTarget(const Common::String &target, const Plugin **plugin) const {
// Ignore empty targets
if (target.empty())
- return PlainGameDescriptor();
+ return QualifiedGameDescriptor();
// Lookup the domain. If we have no domain, fallback on the old function [ultra-deprecated].
const Common::ConfigManager::Domain *domain = ConfMan.getDomain(target);
if (!domain || !domain->contains("gameid") || !domain->contains("engineid"))
- return PlainGameDescriptor();
+ return QualifiedGameDescriptor();
// Look for the engine ID
const Plugin *foundPlugin = findPlugin(domain->getVal("engineid"));
if (!foundPlugin) {
- return PlainGameDescriptor();
+ return QualifiedGameDescriptor();
}
// Make sure it does support the game ID
- PlainGameDescriptor desc = foundPlugin->get<MetaEngine>().findGame(domain->getVal("gameid").c_str());
+ const MetaEngine &engine = foundPlugin->get<MetaEngine>();
+ PlainGameDescriptor desc = engine.findGame(domain->getVal("gameid").c_str());
+ if (!desc.gameId) {
+ return QualifiedGameDescriptor();
+ }
- if (desc.gameId && plugin)
+ if (plugin)
*plugin = foundPlugin;
- return desc;
+ return QualifiedGameDescriptor(engine.getEngineId(), desc);
}
void EngineManager::upgradeTargetIfNecessary(const Common::String &target) const {
@@ -734,10 +742,13 @@ void EngineManager::upgradeTargetForEngineId(const Common::String &target) const
// Next, try to find an engine with the game ID in its supported games list
if (engineId.empty()) {
- PlainGameDescriptor pgd = findGame(oldGameId, &plugin);
- if (plugin) {
- engineId = plugin->get<MetaEngine>().getEngineId();
- newGameId = pgd.gameId;
+ QualifiedGameList candidates = findGamesMatching("", oldGameId);
+ if (candidates.size() > 1) {
+ warning("Multiple matching engines were found when upgrading target '%s'", target.c_str());
+ return;
+ } else if (!candidates.empty()) {
+ engineId = candidates[0].engineId;
+ newGameId = candidates[0].gameId;
}
}
diff --git a/engines/game.cpp b/engines/game.cpp
index 13c24a0..b706e1d 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -49,6 +49,20 @@ PlainGameDescriptor PlainGameDescriptor::of(const char *gameId, const char *desc
return pgd;
}
+QualifiedGameDescriptor::QualifiedGameDescriptor() :
+ PlainGameDescriptor() {
+ engineId = nullptr;
+ gameId = nullptr;
+ description = nullptr;
+}
+
+QualifiedGameDescriptor::QualifiedGameDescriptor(const char *engine, const PlainGameDescriptor &pgd) :
+ PlainGameDescriptor() {
+ engineId = engine;
+ gameId = pgd.gameId;
+ description = pgd.description;
+}
+
DetectedGame::DetectedGame() :
hasUnknownFiles(false),
canBeAdded(true),
diff --git a/engines/game.h b/engines/game.h
index 92fce63..e378976 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -64,6 +64,18 @@ public:
};
/**
+ * The description of a game supported by an engine
+ */
+struct QualifiedGameDescriptor : public PlainGameDescriptor {
+ const char *engineId;
+
+ QualifiedGameDescriptor();
+ QualifiedGameDescriptor(const char *engine, const PlainGameDescriptor &pgd);
+};
+
+typedef Common::Array<QualifiedGameDescriptor> QualifiedGameList;
+
+/**
* Ths is an enum to describe how done a game is. This also indicates what level of support is expected.
*/
enum GameSupportLevel {
diff --git a/engines/metaengine.h b/engines/metaengine.h
index a6c2c06..7cb27dd 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -284,10 +284,16 @@ public:
const PluginList &getPlugins() const;
/** Find a target */ // TODO: Expand on description
- PlainGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;
+ QualifiedGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;
- /** Find a game across all plugins */ // TODO: Naming, this should be gameId
- PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
+ /**
+ * List games matching the specified criteria
+ *
+ * If the engine id is not specified, this scans all the plugins,
+ * loading them from disk if necessary. This is a slow operation on
+ * some platforms and should not be used for the happy path.
+ */
+ QualifiedGameList findGamesMatching(const Common::String &engineId, const Common::String &gameId) const;
/**
* Create a target from the supplied game descriptor
@@ -301,7 +307,7 @@ public:
private:
/** Find a game across all loaded plugins */
- PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
+ QualifiedGameList findGameInLoadedPlugins(const Common::String &gameId) const;
/** Find a loaded plugin with the given engine ID */
const Plugin *findLoadedPlugin(const Common::String &engineId) const;
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index a7f6e1b..92fbf65 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -599,7 +599,7 @@ void EventRecorder::setFileHeader() {
return;
}
TimeDate t;
- PlainGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName());
+ QualifiedGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName());
g_system->getTimeAndDate(t);
if (_author.empty()) {
setAuthor("Unknown Author");
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 4f3c164..1b34a47 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -103,15 +103,11 @@ EditGameDialog::EditGameDialog(const String &domain)
EngineMan.upgradeTargetIfNecessary(domain);
// Retrieve all game specific options.
- const Plugin *plugin = nullptr;
- // To allow for game domains without a gameid.
- // TODO: Is it intentional that this is still supported?
- String gameId(ConfMan.get("gameid", domain));
- if (gameId.empty())
- gameId = domain;
+
// Retrieve the plugin, since we need to access the engine's MetaEngine
// implementation.
- PlainGameDescriptor pgd = EngineMan.findGame(gameId, &plugin);
+ const Plugin *plugin = nullptr;
+ QualifiedGameDescriptor qgd = EngineMan.findTarget(domain, &plugin);
if (plugin) {
_engineOptions = plugin->get<MetaEngine>().getExtraGuiOptions(domain);
} else {
@@ -125,8 +121,8 @@ EditGameDialog::EditGameDialog(const String &domain)
// GAME: Determine the description string
String description(ConfMan.get("description", domain));
- if (description.empty() && pgd.description) {
- description = pgd.description;
+ if (description.empty() && qgd.description) {
+ description = qgd.description;
}
// GUI: Add tab widget
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index a3151a0..84512ea 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -271,7 +271,7 @@ void LauncherDialog::updateListing() {
gameid = iter->_key;
if (description.empty()) {
- PlainGameDescriptor g = EngineMan.findTarget(iter->_key);
+ QualifiedGameDescriptor g = EngineMan.findTarget(iter->_key);
if (g.description)
description = g.description;
}
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index ced5bcb..cbe90c9 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -166,7 +166,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
break;
case kRecordCmd: {
TimeDate t;
- PlainGameDescriptor desc = EngineMan.findTarget(_target);
+ QualifiedGameDescriptor desc = EngineMan.findTarget(_target);
g_system->getTimeAndDate(t);
EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description, "");
if (editDlg.runModal() != kOKCmd) {
Commit: 780db83e13c12965af415c52c06f6d0e024cc135
https://github.com/scummvm/scummvm/commit/780db83e13c12965af415c52c06f6d0e024cc135
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
DC: Update for the engineId changes
Changed paths:
backends/platform/dc/dc.h
backends/platform/dc/dcmain.cpp
backends/platform/dc/selector.cpp
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index a3f7423..cdea88e 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -262,7 +262,7 @@ public:
extern int handleInput(struct mapledev *pad,
int &mouse_x, int &mouse_y,
byte &shiftFlags, Interactive *inter = NULL);
-extern bool selectGame(char *&, char *&, Common::Language &, Common::Platform &, class Icon &);
+extern bool selectGame(char *&, char *&, char *&, Common::Language &, Common::Platform &, class Icon &);
#ifdef DYNAMIC_MODULES
extern bool selectPluginDir(Common::String &selection, const Common::FSNode &base);
#endif
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index c84aef9..26cf9de 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -365,28 +365,31 @@ int main()
int DCLauncherDialog::runModal()
{
- char *base = NULL, *dir = NULL;
+ char *engineId = NULL, *gameId = NULL, *dir = NULL;
Common::Language language = Common::UNK_LANG;
Common::Platform platform = Common::kPlatformUnknown;
- if (!selectGame(base, dir, language, platform, icon))
+ if (!selectGame(engineId, gameId, dir, language, platform, icon))
g_system->quit();
// Set the game path.
- ConfMan.addGameDomain(base);
+ ConfMan.addGameDomain(gameId);
+ ConfMan.set("engineid", engineId, gameId);
+ ConfMan.set("gameid", gameId, gameId);
+
if (dir != NULL)
- ConfMan.set("path", dir, base);
+ ConfMan.set("path", dir, gameId);
// Set the game language.
if (language != Common::UNK_LANG)
- ConfMan.set("language", Common::getLanguageCode(language), base);
+ ConfMan.set("language", Common::getLanguageCode(language), gameId);
// Set the game platform.
if (platform != Common::kPlatformUnknown)
- ConfMan.set("platform", Common::getPlatformCode(platform), base);
+ ConfMan.set("platform", Common::getPlatformCode(platform), gameId);
// Set the target.
- ConfMan.setActiveDomain(base);
+ ConfMan.setActiveDomain(gameId);
return 0;
}
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index 18528f8..f70ce67 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -137,6 +137,7 @@ void draw_trans_quad(float x1, float y1, float x2, float y2,
struct Game
{
char dir[256];
+ char engine_id[256];
char filename_base[256];
char text[256];
Common::Language language;
@@ -233,6 +234,8 @@ static int findGames(Game *games, int max, bool use_ini)
}
if (curr_game < max) {
strcpy(games[curr_game].filename_base, (*i)._key.c_str());
+ strncpy(games[curr_game].engine_id, (*i)._value["engineid"].c_str(), 256);
+ games[curr_game].engine_id[255] = '\0';
strncpy(games[curr_game].dir, dirs[j].node.getPath().c_str(), 256);
games[curr_game].dir[255] = '\0';
games[curr_game].language = Common::UNK_LANG;
@@ -278,6 +281,7 @@ static int findGames(Game *games, int max, bool use_ini)
for (DetectedGames::const_iterator ge = candidates.begin();
ge != candidates.end(); ++ge)
if (curr_game < max) {
+ strcpy(games[curr_game].engine_id, ge->engineId.c_str());
strcpy(games[curr_game].filename_base, ge->gameId.c_str());
strcpy(games[curr_game].dir, dirs[curr_dir-1].name);
games[curr_game].language = ge->language;
@@ -465,7 +469,7 @@ int gameMenu(Game *games, int num_games)
}
}
-bool selectGame(char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::Platform &plf_ret, Icon &icon)
+bool selectGame(char *&engineId, char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::Platform &plf_ret, Icon &icon)
{
Game *games = new Game[MAX_GAMES];
int selected, num_games;
@@ -510,6 +514,7 @@ bool selectGame(char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::
chdir("/");
dir_ret = the_game.dir;
#endif
+ engineId = the_game.engine_id;
ret = the_game.filename_base;
lang_ret = the_game.language;
plf_ret = the_game.platform;
Commit: d5bab0cd2a97e59470dbd55fa5d579daaa9676ad
https://github.com/scummvm/scummvm/commit/d5bab0cd2a97e59470dbd55fa5d579daaa9676ad
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
CRYO: Revert copyright string change
Changed paths:
engines/cryo/detection.cpp
diff --git a/engines/cryo/detection.cpp b/engines/cryo/detection.cpp
index bb5be81..c2be650 100644
--- a/engines/cryo/detection.cpp
+++ b/engines/cryo/detection.cpp
@@ -144,7 +144,7 @@ public:
}
virtual const char *getOriginalCopyright() const {
- return "Cryo (C) Cryo Interactive";
+ return "Cryo Engine (C) Cryo Interactive";
}
virtual bool hasFeature(MetaEngineFeature f) const;
Commit: 8ba2d22407a43a6fd7717df5878ec87bfe04e077
https://github.com/scummvm/scummvm/commit/8ba2d22407a43a6fd7717df5878ec87bfe04e077
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
ENGINES: Remove useless TODO
Changed paths:
engines/metaengine.h
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 7cb27dd..8853d65 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -283,7 +283,7 @@ public:
/** Get the list of all engine plugins */
const PluginList &getPlugins() const;
- /** Find a target */ // TODO: Expand on description
+ /** Find a target */
QualifiedGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;
/**
Commit: 3c0abc080075adfc2d752a006654c8168b8c43ab
https://github.com/scummvm/scummvm/commit/3c0abc080075adfc2d752a006654c8168b8c43ab
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
BASE: Remove the engines/games alphabetical sort
Changed paths:
base/commandLine.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index bcc4304..a0058e1 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -763,22 +763,15 @@ static void listGames() {
printf("Game ID Full Title \n"
"------------------------------ -----------------------------------------------------------\n");
- Common::Array<Common::String> games;
-
const PluginList &plugins = EngineMan.getPlugins();
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
const MetaEngine &metaengine = (*iter)->get<MetaEngine>();
PlainGameList list = metaengine.getSupportedGames();
for (PlainGameList::const_iterator v = list.begin(); v != list.end(); ++v) {
- games.push_back(Common::String::format("%-30s %s", buildQualifiedGameName(metaengine.getEngineId(), v->gameId).c_str(), v->description));
+ printf("%-30s %s\n", buildQualifiedGameName(metaengine.getEngineId(), v->gameId).c_str(), v->description);
}
}
-
- Common::sort(games.begin(), games.end());
-
- for (Common::Array<Common::String>::const_iterator i = games.begin(), end = games.end(); i != end; ++i)
- printf("%s\n", i->c_str());
}
/** List all supported engines, i.e. all loaded plugins. */
@@ -786,18 +779,11 @@ static void listEngines() {
printf("Engine ID Engine Name \n"
"--------------- ------------------------------------------------------\n");
- Common::Array<Common::String> engines;
-
const PluginList &plugins = EngineMan.getPlugins();
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
const MetaEngine &metaEngine = (*iter)->get<MetaEngine>();
- engines.push_back(Common::String::format("%-15s %s", metaEngine.getEngineId(), metaEngine.getName()));
+ printf("%-15s %s\n", metaEngine.getEngineId(), metaEngine.getName());
}
-
- Common::sort(engines.begin(), engines.end());
-
- for (Common::Array<Common::String>::const_iterator i = engines.begin(), end = engines.end(); i != end; ++i)
- printf("%s\n", i->c_str());
}
/** List all targets which are configured in the config file. */
Commit: 6919e71608b7ff0db99c57fbb3abd7e0220f0fd0
https://github.com/scummvm/scummvm/commit/6919e71608b7ff0db99c57fbb3abd7e0220f0fd0
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-11-03T11:43:00+01:00
Commit Message:
DOC: Update the documentation for engineId
Changed paths:
README.md
dists/scummvm.6
diff --git a/README.md b/README.md
index 116f2fc..fe93564 100644
--- a/README.md
+++ b/README.md
@@ -1360,7 +1360,7 @@ arguments -- see the next section.
Usage: scummvm [OPTIONS]... [GAME]
- [GAME] Short name of game to load. For example, 'monkey'
+ [GAME] Short name of game to load. For example, 'scumm:monkey'
for Monkey Island. This can be either a built-in
gameid, or a user configured target.
@@ -1368,6 +1368,7 @@ arguments -- see the next section.
-h, --help Display a brief help text and exit
-z, --list-games Display list of supported games and exit
-t, --list-targets Display list of configured targets and exit
+ --list-engines Display list of suppported engines and exit
--list-saves Display a list of saved games for the target specified
with --game=TARGET, or all targets if none is specified
-a, --add Add all games from current or specified directory.
@@ -1461,17 +1462,17 @@ Examples:
- Win32:
Running Monkey Island, fullscreen, from a hard disk:
`C:\Games\LucasArts\scummvm.exe -f -pC:\Games\LucasArts\monkey\
- monkey`
+ scumm:monkey`
Running Full Throttle from CD, fullscreen and with subtitles
enabled:
- `C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ ft`
+ `C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ scumm:ft`
- Unix:
Running Monkey Island, fullscreen, from a hard disk:
- `/path/to/scummvm -f -p/games/LucasArts/monkey/ monkey`
+ `/path/to/scummvm -f -p/games/LucasArts/monkey/ scumm:monkey`
Running Full Throttle from CD, fullscreen and with subtitles
enabled:
- `/path/to/scummvm -f -n -p/cdrom/resource/ ft`
+ `/path/to/scummvm -f -n -p/cdrom/resource/ scumm:ft`
### 5.2) Global Menu
@@ -1549,7 +1550,7 @@ They are:
To select a graphics filter, select it in the Launcher, or pass its name
via the '-g' option to scummvm, for example:
- scummvm -gadvmame2x monkey2
+ scummvm -gadvmame2x scumm:monkey2
Note \#1: Not all backends support all (or even any) of the filters
listed above; some may support additional ones. The filters listed above
@@ -2114,7 +2115,7 @@ depending on your operating system and configuration.
To select a sound driver, select it in the Launcher, or pass its name
via the `-e` option to scummvm, for example:
-`scummvm -eadlib monkey2`
+`scummvm -eadlib scumm:monkey2`
### 7.1) AdLib emulation
diff --git a/dists/scummvm.6 b/dists/scummvm.6
index fed024c..efde6f3 100644
--- a/dists/scummvm.6
+++ b/dists/scummvm.6
@@ -14,7 +14,7 @@
is an interpreter that will play graphic adventure games
based on a variety of game engines.
.Pp
-\fIGAME\fR is a short name of game to load. For example, \fImonkey\fR for
+\fIGAME\fR is a short name of game to load. For example, \fIscumm:monkey\fR for
Monkey Island. This can be either a built-in gameid, or a user configured
target.
.Sh OPTIONS
@@ -36,6 +36,8 @@ Display a brief help text and exit.
Display list of supported games and exit.
.It Fl t, -list-targets
Display list of configured targets and exit.
+.It Fl t, -list-engines
+Display list of suppported engines and exit.
.It Fl -list-saves
Display a list of saved games for the target specified with
\fB--game=\fITARGET\fR or all targets if none is specified.
@@ -61,7 +63,7 @@ Use alternate configuration file.
Path to where the game is installed.
.It Fl x, -save-slot= Ns Ar [SLOT]
Saved game slot to load (default: autosave).
-.It Fl f, -fulscreen
+.It Fl f, -fullscreen
Force full-screen mode.
.It Fl F, -no-fullscreen
Force windowed mode.
@@ -296,15 +298,15 @@ Running the builtin game launcher:
.Pp
Running Day of the Tentacle specifying the path:
.Pp
-.Dl $ scummvm -p /usr/local/share/games/tentacle tentacle
+.Dl $ scummvm -p /usr/local/share/games/tentacle scumm:tentacle
.Pp
Running The Dig with advmame2x filter with subtitles:
.Pp
-.Dl $ scummvm -g advmame2x -n dig
+.Dl $ scummvm -g advmame2x -n scumm:dig
.Pp
Running the Italian version of Maniac Mansion fullscreen:
.Pp
-.Dl $ scummvm -q it -f maniac
+.Dl $ scummvm -q it -f scumm:maniac
.Sh SEE ALSO
More information can be found in the \fIREADME\fR and on the website
.Pa https://www.scummvm.org .
More information about the Scummvm-git-logs
mailing list