diff options
author | Max Horn | 2006-11-12 03:23:29 +0000 |
---|---|---|
committer | Max Horn | 2006-11-12 03:23:29 +0000 |
commit | 1f26cb89652a5804ccace15587426ca2b9e1387d (patch) | |
tree | 105cfba6c96569f58e79a1cf9b1fedc72c76bf8a /engines/agos | |
parent | c7b2f4d3325942330188f04d23d4a60797c7d2c2 (diff) | |
download | scummvm-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/agos')
-rw-r--r-- | engines/agos/game.cpp | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp index 04860c41b4..d297dff825 100644 --- a/engines/agos/game.cpp +++ b/engines/agos/game.cpp @@ -54,7 +54,7 @@ static const Common::ADObsoleteGameID obsoleteGameIDsTable[] = { {"simon2talkie", "simon2", Common::kPlatformPC}, {"simon2mac", "simon2", Common::kPlatformMacintosh}, {"simon2win", "simon2", Common::kPlatformWindows}, - {NULL, NULL, Common::kPlatformUnknown} + {0, 0, Common::kPlatformUnknown} }; static const PlainGameDescriptor simonGames[] = { @@ -68,16 +68,10 @@ static const PlainGameDescriptor simonGames[] = { {"jumble", "Jumble"}, {"puzzle", "NoPatience"}, {"swampy", "Swampy Adventures"}, - {NULL, NULL} + {0, 0} }; -ADVANCED_DETECTOR_GAMEID_LIST(AGOS, simonGames); - -ADVANCED_DETECTOR_FIND_GAMEID(AGOS, simonGames, obsoleteGameIDsTable); - -ADVANCED_DETECTOR_DETECT_GAMES(AGOS, AGOS::GAME_detectGames); - -ADVANCED_DETECTOR_ENGINE_CREATE(AGOS, AGOS::AGOSEngine, "AGOSEngine", obsoleteGameIDsTable); +ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, AGOS::GAME_detectGames, simonGames, obsoleteGameIDsTable); REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft"); @@ -88,10 +82,27 @@ using Common::ADGameDescription; #include "agosgame.cpp" -ADVANCED_DETECTOR_TO_DETECTED_GAME(simonGames); - -ADVANCED_DETECTOR_DETECT_INIT_GAME(AGOSEngine::initGame, gameDescriptions, _gameDescription, Common::ADTrue); +bool AGOSEngine::initGame() { + int i = Common::real_ADVANCED_DETECTOR_DETECT_INIT_GAME( + (const byte *)gameDescriptions, + sizeof(AGOSGameDescription), + ARRAYSIZE(gameDescriptions), + FILE_MD5_BYTES, + simonGames + ); + _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(AGOSGameDescription), + ARRAYSIZE(gameDescriptions), + FILE_MD5_BYTES, + simonGames + ); +} } // End of namespace AGOS |