aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
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/parallaction
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/parallaction')
-rw-r--r--engines/parallaction/detection.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index d3faefe31c..06aedd483a 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -51,15 +51,8 @@ static const PlainGameDescriptor parallactionGames[] = {
{0, 0}
};
-ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Parallaction::Parallaction, Parallaction::GAME_detectGames, parallactionGames, 0);
-
-REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte");
-
-
namespace Parallaction {
-#define FILE_MD5_BYTES 5000
-
static const PARALLACTIONGameDescription gameDescriptions[] = {
{
{
@@ -85,26 +78,37 @@ static const PARALLACTIONGameDescription gameDescriptions[] = {
{ { NULL, NULL, { { NULL, 0, NULL } }, Common::UNK_LANG, Common::kPlatformUnknown }, 0, 0 }
};
+}
+
+static const Common::ADParams detectionParams = {
+ // Pointer to ADGameDescription or its superset structure
+ (const byte *)Parallaction::gameDescriptions,
+ // Size of that superset structure
+ sizeof(Parallaction::PARALLACTIONGameDescription),
+ // Number of bytes to compute MD5 sum for
+ 5000,
+ // List of all engine targets
+ parallactionGames,
+ // Structure for autoupgrading obsolete targets
+ 0
+};
+
+ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Parallaction::Parallaction, Parallaction::GAME_detectGames, detectionParams);
+
+REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte");
+
+
+namespace Parallaction {
bool Parallaction::detectGame() {
- int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(
- (const byte *)gameDescriptions,
- sizeof(PARALLACTIONGameDescription),
- FILE_MD5_BYTES,
- parallactionGames
- );
+ 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(PARALLACTIONGameDescription),
- FILE_MD5_BYTES,
- parallactionGames
- );
+ return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
}
} // End of namespace Parallaction