diff options
author | Max Horn | 2006-04-15 17:39:14 +0000 |
---|---|---|
committer | Max Horn | 2006-04-15 17:39:14 +0000 |
commit | ad45318328e23b76e346414c62ef4c22d8ebe059 (patch) | |
tree | 9956847a38797471f73fd26ec3203dbbae6efd78 /engines | |
parent | dc5f513bcf7b6177a4d8f7e10fb4ed4dd55d7588 (diff) | |
download | scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.tar.gz scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.tar.bz2 scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.zip |
Removed GameDetector::_gameid in favor of using a config manager entry
svn-id: r21915
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/plugin.cpp | 13 | ||||
-rw-r--r-- | engines/simon/game.cpp | 10 | ||||
-rw-r--r-- | engines/sword1/sword1.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 2 |
4 files changed, 13 insertions, 14 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp index a7657b99bf..ac9bcfc0bd 100644 --- a/engines/scumm/plugin.cpp +++ b/engines/scumm/plugin.cpp @@ -1620,15 +1620,15 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) { */ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { Engine *engine; + const char *gameid = ConfMan.get("gameid").c_str(); // We start by checking whether the specified game ID is obsolete. // If that is the case, we automatically upgrade the target to use // the correct new game ID (and platform, if specified). - const ObsoleteGameID *o = obsoleteGameIDsTable; - while (o->from) { - if (!scumm_stricmp(detector->_gameid.c_str(), o->from)) { + for (const ObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) { + if (!scumm_stricmp(gameid, o->from)) { // Match found, perform upgrade - detector->_gameid = o->to; + gameid = o->to; ConfMan.set("gameid", o->to); if (o->platform != Common::kPlatformUnknown) @@ -1638,14 +1638,13 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { ConfMan.flushToDisk(); break; } - o++; } // Lookup the game ID in our database. If this lookup fails, then // the game ID is unknown, and we have to abort. const GameSettings *g = gameVariantsTable; while (g->gameid) { - if (!scumm_stricmp(detector->_gameid.c_str(), g->gameid)) + if (!scumm_stricmp(gameid, g->gameid)) break; g++; } @@ -1655,7 +1654,7 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { // We now want to calculate the MD5 of the games detection file, so that we // can store it in savegames etc.. - const char *gameid = g->gameid; + gameid = g->gameid; char detectName[256], tempName[256]; uint8 md5sum[16]; SubstResFileNames subst = { 0, 0, kGenAsIs }; diff --git a/engines/simon/game.cpp b/engines/simon/game.cpp index 9e83b4d9ca..29d1df7bfb 100644 --- a/engines/simon/game.cpp +++ b/engines/simon/game.cpp @@ -113,11 +113,12 @@ DetectedGameList Engine_SIMON_detectGames(const FSList &fslist) { } Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst) { - const ObsoleteGameID *o = obsoleteGameIDsTable; - while (o->from) { - if (!scumm_stricmp(detector->_gameid.c_str(), o->from)) { - detector->_gameid = o->to; + const char *gameid = ConfMan.get("gameid").c_str(); + for (const ObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) { + if (!scumm_stricmp(gameid, o->from)) { + // Match found, perform upgrade + gameid = o->to; ConfMan.set("gameid", o->to); if (o->platform != Common::kPlatformUnknown) @@ -127,7 +128,6 @@ Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst) { ConfMan.flushToDisk(); break; } - o++; } return new Simon::SimonEngine(syst); diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 2b5436f0b6..7db5e26e2e 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -134,7 +134,7 @@ void SwordEngine::errorString(const char *buf1, char *buf2) { SwordEngine::SwordEngine(GameDetector *detector, OSystem *syst) : Engine(syst) { - if (0 == scumm_stricmp(detector->_gameid.c_str(), "sword1demo")) + if (0 == scumm_stricmp(ConfMan.get("gameid").c_str(), "sword1demo")) _features = GF_DEMO; else _features = 0; diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index abd2ce5291..32ce29c0f0 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -129,7 +129,7 @@ Sword2Engine::Sword2Engine(GameDetector *detector, OSystem *syst) : Engine(syst) Common::File::addDefaultDirectory(_gameDataPath + "sword2/"); Common::File::addDefaultDirectory(_gameDataPath + "video/"); - if (0 == scumm_stricmp(detector->_gameid.c_str(), "sword2demo")) + if (0 == scumm_stricmp(ConfMan.get("gameid").c_str(), "sword2demo")) _features = GF_DEMO; else _features = 0; |