[Scummvm-cvs-logs] SF.net SVN: scummvm: [21940] scummvm/trunk/engines/saga

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 16 06:13:05 CEST 2006


Revision: 21940
Author:   fingolfin
Date:     2006-04-16 06:12:23 -0700 (Sun, 16 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21940&view=rev

Log Message:
-----------
Reduced dependencies on base/plugins.h

Modified Paths:
--------------
    scummvm/trunk/engines/saga/game.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/simon/game.cpp
    scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp	2006-04-16 13:01:41 UTC (rev 21939)
+++ scummvm/trunk/engines/saga/game.cpp	2006-04-16 13:12:23 UTC (rev 21940)
@@ -1495,11 +1495,11 @@
 	},
 };
 
-DetectedGame GameDescription::toDetectedGame() {
+DetectedGame toDetectedGame(const GameDescription &g) {
 	const char *title;
-	title = saga_games[gameType].description;
-	DetectedGame dg(name, title, language, platform);
-	dg.updateDesc(extra);
+	title = saga_games[g.gameType].description;
+	DetectedGame dg(g.name, title, g.language, g.platform);
+	dg.updateDesc(g.extra);
 	return dg;
 }
 
@@ -1593,7 +1593,7 @@
 			}
 		}
 		if (!fileMissing) {
-			debug(2, "Found game: %s", gameDescriptions[i].toDetectedGame().description.c_str());
+			debug(2, "Found game: %s", toDetectedGame(gameDescriptions[i]).description.c_str());
 			matched[matchedCount++] = i;
 		}
 	}
@@ -1621,13 +1621,13 @@
 		for (i = 0; i < matchedCount; i++) {
 			if ((gameDescriptions[matched[i]].language != language && language != Common::UNK_LANG) ||
 				(gameDescriptions[matched[i]].platform != platform && platform != Common::kPlatformUnknown)) {
-				debug(2, "Purged %s", gameDescriptions[matched[i]].toDetectedGame().description.c_str());
+				debug(2, "Purged %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
 				matched[i] = -1;
 				continue;
 			}
 
 			if (gameDescriptions[matched[i]].filesCount < maxcount) {
-				debug(2, "Purged: %s", gameDescriptions[matched[i]].toDetectedGame().description.c_str());
+				debug(2, "Purged: %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
 				matched[i] = -1;
 			}
 		}
@@ -1676,7 +1676,7 @@
 		error("SagaEngine::loadGame wrong gameNumber");
 	}
 
-	_gameTitle = gameDescriptions[gameNumber].toDetectedGame().description;
+	_gameTitle = toDetectedGame(gameDescriptions[gameNumber]).description;
 	debug(2, "Running %s", _gameTitle.c_str());
 
 	_gameNumber = gameNumber;
@@ -1698,7 +1698,7 @@
 	count = detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown, matches);
 
 	for (int i = 0; i < count; i++)
-		detectedGames.push_back(gameDescriptions[matches[i]].toDetectedGame());
+		detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]]));
 	free(matches);
 	return detectedGames;
 }

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2006-04-16 13:01:41 UTC (rev 21939)
+++ scummvm/trunk/engines/saga/saga.h	2006-04-16 13:12:23 UTC (rev 21940)
@@ -28,7 +28,6 @@
 #include "base/engine.h"
 
 #include "common/stream.h"
-#include "base/plugins.h"
 
 #include "saga/gfx.h"
 #include "saga/list.h"
@@ -517,8 +516,6 @@
 	uint32 features;
 	Common::Language language;
 	Common::Platform platform;
-
-	DetectedGame toDetectedGame();
 };
 
 struct SaveFileData {

Modified: scummvm/trunk/engines/simon/game.cpp
===================================================================
--- scummvm/trunk/engines/simon/game.cpp	2006-04-16 13:01:41 UTC (rev 21939)
+++ scummvm/trunk/engines/simon/game.cpp	2006-04-16 13:12:23 UTC (rev 21940)
@@ -1240,11 +1240,11 @@
 	},
 };
 
-DetectedGame GameDescription::toDetectedGame() {
+DetectedGame toDetectedGame(const GameDescription &g) {
 	const char *title;
-	title = simonGames[gameType].description;
-	DetectedGame dg(name, title, language, platform);
-	dg.updateDesc(extra);
+	title = simonGames[g.gameType].description;
+	DetectedGame dg(g.name, title, g.language, g.platform);
+	dg.updateDesc(g.extra);
 	return dg;
 }
 
@@ -1339,7 +1339,7 @@
 			}
 		}
 		if (!fileMissing) {
-			debug(2, "Found game: %s", gameDescriptions[i].toDetectedGame().description.c_str());
+			debug(2, "Found game: %s", toDetectedGame(gameDescriptions[i]).description.c_str());
 			matched[matchedCount++] = i;
 		}
 	}
@@ -1366,13 +1366,13 @@
 		for (i = 0; i < matchedCount; i++) {
 			if ((gameDescriptions[matched[i]].language != language && language != Common::UNK_LANG) ||
 				(gameDescriptions[matched[i]].platform != platform && platform != Common::kPlatformUnknown)) {
-				debug(2, "Purged %s", gameDescriptions[matched[i]].toDetectedGame().description.c_str());
+				debug(2, "Purged %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
 				matched[i] = -1;
 				continue;
 			}
 
 			if (gameDescriptions[matched[i]].filesCount < maxcount) {
-				debug(2, "Purged: %s", gameDescriptions[matched[i]].toDetectedGame().description.c_str());
+				debug(2, "Purged: %s", toDetectedGame(gameDescriptions[matched[i]]).description.c_str());
 				matched[i] = -1;
 			}
 		}
@@ -1420,7 +1420,7 @@
 		error("SimonEngine::loadGame wrong gameNumber");
 	}
 
-	debug(2, "Running %s", gameDescriptions[gameNumber].toDetectedGame().description.c_str());
+	debug(2, "Running %s", toDetectedGame(gameDescriptions[gameNumber]).description.c_str());
 
 	_gameDescription = &gameDescriptions[gameNumber];
 
@@ -1434,7 +1434,7 @@
 	count = detectGame(&fslist, Common::UNK_LANG, Common::kPlatformUnknown, matches);
 
 	for (int i = 0; i < count; i++)
-		detectedGames.push_back(gameDescriptions[matches[i]].toDetectedGame());
+		detectedGames.push_back(toDetectedGame(gameDescriptions[matches[i]]));
 	free(matches);
 	return detectedGames;
 }

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-16 13:01:41 UTC (rev 21939)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-16 13:12:23 UTC (rev 21940)
@@ -26,7 +26,6 @@
 #include <stdio.h>
 
 #include "base/engine.h"
-#include "base/plugins.h"
 
 #include "common/rect.h"
 #include "common/util.h"
@@ -129,8 +128,6 @@
 	uint32 features;
 	Common::Language language;
 	Common::Platform platform;
-
-	DetectedGame toDetectedGame();
 };
 
 struct GameSpecificSettings;


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