aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/detection.cpp
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/cine/detection.cpp
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/cine/detection.cpp')
-rw-r--r--engines/cine/detection.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index f4bbcd58dc..176378de3d 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -54,14 +54,8 @@ static const PlainGameDescriptor cineGames[] = {
{0, 0}
};
-ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, Cine::GAME_detectGames, cineGames, 0);
-
-REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software");
-
namespace Cine {
-#define FILE_MD5_BYTES 5000
-
static const CINEGameDescription gameDescriptions[] = {
{
{
@@ -435,25 +429,36 @@ static const CINEGameDescription gameDescriptions[] = {
{ { NULL, NULL, AD_ENTRY1(NULL, NULL), Common::UNK_LANG, Common::kPlatformUnknown }, 0, 0 }
};
+}
+
+static const Common::ADParams detectionParams = {
+ // Pointer to ADGameDescription or its superset structure
+ (const byte *)Cine::gameDescriptions,
+ // Size of that superset structure
+ sizeof(Cine::CINEGameDescription),
+ // Number of bytes to compute MD5 sum for
+ 5000,
+ // List of all engine targets
+ cineGames,
+ // Structure for autoupgrading obsolete targets
+ 0
+};
+
+ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, Cine::GAME_detectGames, detectionParams);
+
+REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software");
+
+namespace Cine {
+
bool CineEngine::initGame() {
- int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(
- (const byte *)gameDescriptions,
- sizeof(CINEGameDescription),
- FILE_MD5_BYTES,
- cineGames
- );
+ 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(CINEGameDescription),
- FILE_MD5_BYTES,
- cineGames
- );
+ return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
}
} // End of namespace Cine