[Scummvm-cvs-logs] SF.net SVN: scummvm: [21285] scummvm/trunk/engines/saga
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Mar 14 06:28:05 CET 2006
Revision: 21285
Author: fingolfin
Date: 2006-03-14 05:28:28 -0800 (Tue, 14 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21285&view=rev
Log Message:
-----------
Compute the full game title when detecting games & creating engine instances, and also use that for savegames (all for debugging)
Modified Paths:
--------------
scummvm/trunk/engines/saga/game.cpp
scummvm/trunk/engines/saga/saga.h
scummvm/trunk/engines/saga/saveload.cpp
Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp 2006-03-14 13:26:06 UTC (rev 21284)
+++ scummvm/trunk/engines/saga/game.cpp 2006-03-14 13:28:28 UTC (rev 21285)
@@ -1577,6 +1577,18 @@
},
};
+
+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 @@
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 @@
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 @@
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 @@
// 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 @@
} 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 @@
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;
}
Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h 2006-03-14 13:26:06 UTC (rev 21284)
+++ scummvm/trunk/engines/saga/saga.h 2006-03-14 13:28:28 UTC (rev 21285)
@@ -679,6 +679,7 @@
//current game description
int _gameNumber;
GameDescription *_gameDescription;
+ Common::String _gameTitle;
Common::Rect _displayClip;
protected:
Modified: scummvm/trunk/engines/saga/saveload.cpp
===================================================================
--- scummvm/trunk/engines/saga/saveload.cpp 2006-03-14 13:26:06 UTC (rev 21284)
+++ scummvm/trunk/engines/saga/saveload.cpp 2006-03-14 13:28:28 UTC (rev 21285)
@@ -185,14 +185,7 @@
// 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list