diff options
author | Max Horn | 2006-03-14 13:28:28 +0000 |
---|---|---|
committer | Max Horn | 2006-03-14 13:28:28 +0000 |
commit | ab1694aef99c850b85f833413bd2c70cf732b664 (patch) | |
tree | 2008220cafc48063e5ec51b1c1f09ba4142dc0a8 /engines/saga | |
parent | d68b64184ef0610c98feef066911634078a319d8 (diff) | |
download | scummvm-rg350-ab1694aef99c850b85f833413bd2c70cf732b664.tar.gz scummvm-rg350-ab1694aef99c850b85f833413bd2c70cf732b664.tar.bz2 scummvm-rg350-ab1694aef99c850b85f833413bd2c70cf732b664.zip |
Compute the full game title when detecting games & creating engine instances, and also use that for savegames (all for debugging)
svn-id: r21285
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/game.cpp | 33 | ||||
-rw-r--r-- | engines/saga/saga.h | 1 | ||||
-rw-r--r-- | engines/saga/saveload.cpp | 9 |
3 files changed, 21 insertions, 22 deletions
diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp index 68becbcca3..5d6aa1efed 100644 --- a/engines/saga/game.cpp +++ b/engines/saga/game.cpp @@ -1577,6 +1577,18 @@ static GameDescription gameDescriptions[] = { }, }; + +static DetectedGame toDetectedGame(const GameDescription &g) { + const char *title = 0; + if (g.gameType == GType_ITE) + title = "Inherit the Earth: Quest for the Orb"; + else if (g.gameType == GType_IHNM) + title = "I Have No Mouth and I Must Scream"; + DetectedGame dg(g.name, title, g.language, g.platform); + dg.updateDesc(g.extra); + return dg; +} + bool SagaEngine::initGame() { uint16 gameCount = ARRAYSIZE(gameDescriptions); int gameNumber = -1; @@ -1609,7 +1621,7 @@ bool SagaEngine::initGame() { language != Common::UNK_LANG) || (gameDescriptions[matches[i]].platform != platform && platform != Common::kPlatformUnknown)) { - debug(2, "Purged (pass 2) %d (%s)", matches[i], gameDescriptions[matches[i]].extra); + debug(2, "Purged (pass 2) %s", toDetectedGame(gameDescriptions[matches[i]]).description.c_str()); matches[i] = -1; } else @@ -1633,7 +1645,8 @@ bool SagaEngine::initGame() { error("SagaEngine::loadGame wrong gameNumber"); } - debug(2, "Running %d (%s)", gameNumber, gameDescriptions[gameNumber].extra); + _gameTitle = toDetectedGame(gameDescriptions[gameNumber]).description; + debug(2, "Running %s", _gameTitle.c_str()); _gameNumber = gameNumber; _gameDescription = &gameDescriptions[gameNumber]; @@ -1687,7 +1700,7 @@ DetectedGameList GAME_ProbeGame(const FSList &fslist, int **retmatches) { if (gameMD5[j].id == gameDescriptions[matches[i]].gameId) count++; if (count < maxcount) { - debug(2, "Purged: %d (%s)", matches[i], gameDescriptions[matches[i]].extra); + debug(2, "Purged: %s", toDetectedGame(gameDescriptions[matches[i]]).description.c_str()); matches[i] = -1; } } @@ -1697,15 +1710,7 @@ DetectedGameList GAME_ProbeGame(const FSList &fslist, int **retmatches) { // and now push them into list of detected games for (i = 0; i < index; i++) if (matches[i] != -1) { - GameDescription &g = gameDescriptions[matches[i]]; - const char *title = 0; - if (g.gameType == GType_ITE) - title = "Inherit the Earth: Quest for the Orb"; - else if (g.gameType == GType_IHNM) - title = "I Have No Mouth and I Must Scream"; - DetectedGame dg(g.name, title, g.language, g.platform); - dg.updateDesc(g.extra); - detectedGames.push_back(dg); + detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]])); } if (retmatches) { @@ -1804,7 +1809,7 @@ int detectGame(const FSList &fslist, bool mode, int start) { } else { bool match = true; - debug(2, "Probing game: %d (%s)", game_n, gameDescriptions[game_n].extra); + debug(2, "Probing game: %s", toDetectedGame(gameDescriptions[game_n]).description.c_str()); for (int i = 0; i < ARRAYSIZE(gameMD5); i++) { if (gameMD5[i].id == gameDescriptions[game_n].gameId) { @@ -1819,7 +1824,7 @@ int detectGame(const FSList &fslist, bool mode, int start) { if (!match) continue; - debug(2, "Found game: %d (%s)", game_n, gameDescriptions[game_n].extra); + debug(2, "Found game: %s", toDetectedGame(gameDescriptions[game_n]).description.c_str()); return game_n; } diff --git a/engines/saga/saga.h b/engines/saga/saga.h index ef38895352..e7637161fe 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -679,6 +679,7 @@ public: //current game description int _gameNumber; GameDescription *_gameDescription; + Common::String _gameTitle; Common::Rect _displayClip; protected: diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 2678de94bf..e89244698c 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -185,14 +185,7 @@ void SagaEngine::save(const char *fileName, const char *saveName) { // Original game title memset(title, 0, TITLESIZE); - // TODO: This used to include the full title. I (Fingolfin) don't understand - // the purpose of saving this information here, which is why I am not - // changing it at the moment (it seems to *only* be used in a debug() call - // when loading). If desired, the full description string could be saved here - // again (as it used to be), ideally by computing it once and storing it in - // a member variable. - // If desired, I can implement it, it just didn't seem worth the effort. - strncpy(title, getGameDescription()->extra, TITLESIZE); + strncpy(title, _gameTitle.c_str(), TITLESIZE); out->write(title, TITLESIZE); // Surrounding scene |