aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorEugene Sandulenko2007-01-24 22:24:52 +0000
committerEugene Sandulenko2007-01-24 22:24:52 +0000
commitedd2422a55caeb5a46ee240feaea70a5aa4a4da2 (patch)
tree11c26d31c32895f734b2c7a9b177379e74d3cc24 /engines/agos
parentdc8dde1872e30182b178fb1a772d564a3fb696af (diff)
downloadscummvm-rg350-edd2422a55caeb5a46ee240feaea70a5aa4a4da2.tar.gz
scummvm-rg350-edd2422a55caeb5a46ee240feaea70a5aa4a4da2.tar.bz2
scummvm-rg350-edd2422a55caeb5a46ee240feaea70a5aa4a4da2.zip
Hide all AdvacedDetector parameters into a structure for easier maintenance
and extensibility svn-id: r25163
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agosgame.cpp2
-rw-r--r--engines/agos/game.cpp39
2 files changed, 23 insertions, 18 deletions
diff --git a/engines/agos/agosgame.cpp b/engines/agos/agosgame.cpp
index fa62a85b3c..cdc16d916b 100644
--- a/engines/agos/agosgame.cpp
+++ b/engines/agos/agosgame.cpp
@@ -1,5 +1,3 @@
-#define FILE_MD5_BYTES 5000
-
static const AGOSGameDescription gameDescriptions[] = {
// Elvira 1 - English Amiga Floppy
{
diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp
index d2e0e496c9..263dfa9e7c 100644
--- a/engines/agos/game.cpp
+++ b/engines/agos/game.cpp
@@ -79,33 +79,40 @@ static const PlainGameDescriptor simonGames[] = {
{0, 0}
};
-ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, AGOS::GAME_detectGames, simonGames, obsoleteGameIDsTable);
+namespace AGOS {
+
+#include "agosgame.cpp"
+
+}
+
+static const Common::ADParams detectionParams = {
+ // Pointer to ADGameDescription or its superset structure
+ (const byte *)AGOS::gameDescriptions,
+ // Size of that superset structure
+ sizeof(AGOS::AGOSGameDescription),
+ // Number of bytes to compute MD5 sum for
+ 5000,
+ // List of all engine targets
+ simonGames,
+ // Structure for autoupgrading obsolete targets
+ obsoleteGameIDsTable
+};
+
+ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, AGOS::GAME_detectGames, detectionParams);
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
namespace AGOS {
-#include "agosgame.cpp"
-
bool AGOSEngine::initGame() {
- int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(
- (const byte *)gameDescriptions,
- sizeof(AGOSGameDescription),
- FILE_MD5_BYTES,
- simonGames
- );
+ int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+
_gameDescription = &gameDescriptions[i];
return true;
}
GameList GAME_detectGames(const FSList &fslist) {
- return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
- fslist,
- (const byte *)gameDescriptions,
- sizeof(AGOSGameDescription),
- FILE_MD5_BYTES,
- simonGames
- );
+ return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
}
int AGOSEngine::getGameId() const {