aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2007-02-09 17:57:49 +0000
committerMax Horn2007-02-09 17:57:49 +0000
commit16a29408080d05016ec31da1c49c13e4a704c3e5 (patch)
tree03c9287921e775ee855d36e1637d5a014da5d4de /common
parent81ec51b8f7ed6ca59c83ff456f2043a8986bc256 (diff)
downloadscummvm-rg350-16a29408080d05016ec31da1c49c13e4a704c3e5.tar.gz
scummvm-rg350-16a29408080d05016ec31da1c49c13e4a704c3e5.tar.bz2
scummvm-rg350-16a29408080d05016ec31da1c49c13e4a704c3e5.zip
cleanup
svn-id: r25452
Diffstat (limited to 'common')
-rw-r--r--common/advancedDetector.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 486a69034e..92a4305b1b 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -163,9 +163,7 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa
* Makes gameid in form of
* gameid-plaform-lang
*/
-static String generateComplexID(const String id, int listPos, const Common::ADParams &params) {
- const ADGameDescription *desc = (const ADGameDescription *)(params.descs + listPos * params.descItemSize);
-
+static String generateComplexID(const String &id, const ADGameDescription *desc) {
String res(id);
if (desc->platform != kPlatformPC && desc->platform != kPlatformUnknown) {
@@ -187,7 +185,8 @@ GameList detectAllGames(
GameList detectedGames;
for (uint i = 0; i < matches.size(); i++) {
- GameDescriptor desc(toGameDescriptor(*(const ADGameDescription *)(params.descs + matches[i] * params.descItemSize), params.list));
+ const ADGameDescription *adgDesc = (const ADGameDescription *)(params.descs + matches[i] * params.descItemSize);
+ GameDescriptor desc(toGameDescriptor(*adgDesc, params.list));
if (params.singleid != NULL) {
desc["preferredtarget"] = desc["gameid"];
@@ -198,7 +197,7 @@ GameList detectAllGames(
if (!desc.contains("preferredtarget"))
desc["preferredtarget"] = desc["gameid"];
- desc["preferredtarget"] = generateComplexID(desc["preferredtarget"], matches[i], params);
+ desc["preferredtarget"] = generateComplexID(desc["preferredtarget"], adgDesc);
}
detectedGames.push_back(desc);