aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
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/saga
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/saga')
-rw-r--r--engines/saga/game.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp
index ed5d708c1f..cda47d956c 100644
--- a/engines/saga/game.cpp
+++ b/engines/saga/game.cpp
@@ -48,13 +48,7 @@ static const PlainGameDescriptor saga_games[] = {
{0, 0}
};
-ADVANCED_DETECTOR_GAMEID_LIST(SAGA, saga_games);
-
-ADVANCED_DETECTOR_FIND_GAMEID(SAGA, saga_games, NULL);
-
-ADVANCED_DETECTOR_DETECT_GAMES(SAGA, Saga::GAME_detectGames);
-
-ADVANCED_DETECTOR_ENGINE_CREATE(SAGA, Saga::SagaEngine, "SagaEngine", NULL);
+ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, Saga::GAME_detectGames, saga_games, 0);
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
@@ -66,8 +60,6 @@ using Common::ADGameDescription;
#include "sagagame.cpp"
-ADVANCED_DETECTOR_TO_DETECTED_GAME(saga_games);
-
bool SagaEngine::postInitGame() {
_gameDisplayInfo = *_gameDescription->gameDisplayInfo;
_displayClip.right = _gameDisplayInfo.logicalWidth;
@@ -79,8 +71,27 @@ bool SagaEngine::postInitGame() {
return true;
}
-ADVANCED_DETECTOR_DETECT_INIT_GAME(SagaEngine::initGame, gameDescriptions, _gameDescription, postInitGame);
+bool SagaEngine::initGame() {
+ int i = Common::real_ADVANCED_DETECTOR_DETECT_INIT_GAME(
+ (const byte *)gameDescriptions,
+ sizeof(SAGAGameDescription),
+ ARRAYSIZE(gameDescriptions),
+ FILE_MD5_BYTES,
+ saga_games
+ );
+ _gameDescription = &gameDescriptions[i];
+ return postInitGame();
+}
-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(SAGAGameDescription),
+ ARRAYSIZE(gameDescriptions),
+ FILE_MD5_BYTES,
+ saga_games
+ );
+}
} // End of namespace Saga