aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorMax Horn2006-11-12 03:23:29 +0000
committerMax Horn2006-11-12 03:23:29 +0000
commit1f26cb89652a5804ccace15587426ca2b9e1387d (patch)
tree105cfba6c96569f58e79a1cf9b1fedc72c76bf8a /engines/cine
parentc7b2f4d3325942330188f04d23d4a60797c7d2c2 (diff)
downloadscummvm-rg350-1f26cb89652a5804ccace15587426ca2b9e1387d.tar.gz
scummvm-rg350-1f26cb89652a5804ccace15587426ca2b9e1387d.tar.bz2
scummvm-rg350-1f26cb89652a5804ccace15587426ca2b9e1387d.zip
Reworked code in the advanced game detector (getting rid of much of the evil #define hell it consisted of previously)
svn-id: r24685
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/detection.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 4b8ce8d804..451100ebca 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -41,17 +41,10 @@ using Common::File;
static const PlainGameDescriptor cineGames[] = {
{"fw", "Future Wars"},
{"os", "Operation Stealth"},
- {NULL, NULL}
+ {0, 0}
};
-ADVANCED_DETECTOR_GAMEID_LIST(CINE, cineGames);
-
-ADVANCED_DETECTOR_FIND_GAMEID(CINE, cineGames, NULL);
-
-ADVANCED_DETECTOR_DETECT_GAMES(CINE, Cine::GAME_detectGames);
-
-ADVANCED_DETECTOR_ENGINE_CREATE(CINE, Cine::CineEngine, "CineEngine", NULL);
-
+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");
@@ -579,10 +572,27 @@ static const CINEGameDescription gameDescriptions[] = {
};
-ADVANCED_DETECTOR_TO_DETECTED_GAME(cineGames);
-
-ADVANCED_DETECTOR_DETECT_INIT_GAME(CineEngine::initGame, gameDescriptions, _gameDescription, Common::ADTrue);
+bool CineEngine::initGame() {
+ int i = Common::real_ADVANCED_DETECTOR_DETECT_INIT_GAME(
+ (const byte *)gameDescriptions,
+ sizeof(CINEGameDescription),
+ ARRAYSIZE(gameDescriptions),
+ FILE_MD5_BYTES,
+ cineGames
+ );
+ _gameDescription = &gameDescriptions[i];
+ return true;
+}
-ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(GAME_detectGames, gameDescriptions);
+DetectedGameList GAME_detectGames(const FSList &fslist) {
+ return real_ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
+ fslist,
+ (const byte *)gameDescriptions,
+ sizeof(CINEGameDescription),
+ ARRAYSIZE(gameDescriptions),
+ FILE_MD5_BYTES,
+ cineGames
+ );
+}
} // End of namespace Cine