AdvancedDetector changes:
* Renamed genGameList to gameIDList to make it match the corresponding plugin API function name * removed the detectFunc param from detectGameForEngineCreation, as it *always* pointed to a straight wrapper around AdvancedDetector::detectAllGames * as a consequence, removed the various GAME_detectGames functions from the engines, and removed the detectFunc param from ADVANCED_DETECTOR_DEFINE_PLUGIN svn-id: r25547
This commit is contained in:
parent
08079c9dec
commit
4968e912ce
9 changed files with 17 additions and 58 deletions
|
@ -50,7 +50,7 @@ namespace AdvancedDetector {
|
|||
static ADList detectGame(const FSList *fslist, const Common::ADParams ¶ms, Language language, Platform platform);
|
||||
|
||||
|
||||
GameList genGameList(const Common::ADParams ¶ms) {
|
||||
GameList gameIDList(const Common::ADParams ¶ms) {
|
||||
if (params.singleid != NULL) {
|
||||
GameList gl;
|
||||
|
||||
|
@ -221,7 +221,6 @@ int detectBestMatchingGame(
|
|||
}
|
||||
|
||||
PluginError detectGameForEngineCreation(
|
||||
GameList (*detectFunc)(const FSList &fslist),
|
||||
const Common::ADParams ¶ms
|
||||
) {
|
||||
Common::String gameid = ConfMan.get("gameid");
|
||||
|
@ -232,7 +231,7 @@ PluginError detectGameForEngineCreation(
|
|||
return kInvalidPathError;
|
||||
}
|
||||
|
||||
GameList detectedGames = detectFunc(fslist);
|
||||
GameList detectedGames = detectAllGames(fslist, params);
|
||||
|
||||
// We have single ID set, so we have a game if there are hits
|
||||
if (params.singleid != NULL && detectedGames.size())
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace AdvancedDetector {
|
|||
* Returns list of targets supported by the engine.
|
||||
* Distinguishes engines with single ID
|
||||
*/
|
||||
GameList genGameList(const Common::ADParams ¶ms);
|
||||
GameList gameIDList(const Common::ADParams ¶ms);
|
||||
|
||||
/**
|
||||
* Scan through the game descriptors specified in params and search for
|
||||
|
@ -137,7 +137,6 @@ void upgradeTargetIfNecessary(const Common::ADParams ¶ms);
|
|||
|
||||
// FIXME/TODO: Rename this function to something more sensible.
|
||||
PluginError detectGameForEngineCreation(
|
||||
GameList (*detectFunc)(const FSList &fslist),
|
||||
const Common::ADParams ¶ms
|
||||
);
|
||||
|
||||
|
@ -153,32 +152,32 @@ PluginError detectGameForEngineCreation(
|
|||
} // End of namespace AdvancedDetector
|
||||
|
||||
|
||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,factoryFunc,detectFunc,params) \
|
||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,factoryFunc,params) \
|
||||
GameList Engine_##engine##_gameIDList() { \
|
||||
return Common::AdvancedDetector::genGameList(params); \
|
||||
return Common::AdvancedDetector::gameIDList(params); \
|
||||
} \
|
||||
GameDescriptor Engine_##engine##_findGameID(const char *gameid) { \
|
||||
return Common::AdvancedDetector::findGameID(gameid, params); \
|
||||
} \
|
||||
GameList Engine_##engine##_detectGames(const FSList &fslist) { \
|
||||
return detectFunc(fslist); \
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, params); \
|
||||
} \
|
||||
PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
|
||||
assert(syst); \
|
||||
assert(engine); \
|
||||
Common::AdvancedDetector::upgradeTargetIfNecessary(params); \
|
||||
PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(detectFunc, params); \
|
||||
PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(params); \
|
||||
if (err == kNoError) \
|
||||
*engine = factoryFunc(syst); \
|
||||
return err; \
|
||||
} \
|
||||
void dummyFuncToAllowTrailingSemicolon()
|
||||
|
||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,detectFunc,params) \
|
||||
static className *engine##_createInstance(OSystem *syst) { \
|
||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,params) \
|
||||
static Engine *engine##_createInstance(OSystem *syst) { \
|
||||
return new className(syst); \
|
||||
} \
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,engine##_createInstance,detectFunc,params); \
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,engine##_createInstance,params); \
|
||||
void dummyFuncToAllowTrailingSemicolon()
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ uint16 AgiEngine::getVersion() const {
|
|||
return _gameDescription->version;
|
||||
}
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
static const PlainGameDescriptor agiGames[] = {
|
||||
|
@ -1743,7 +1742,7 @@ static const Common::ADParams detectionParams = {
|
|||
Common::kADFlagAugmentPreferredTarget
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, Agi::AgiEngine, Agi::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, Agi::AgiEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(AGI, "AGI v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software");
|
||||
|
||||
|
@ -1758,9 +1757,5 @@ bool AgiEngine::initGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Agi
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ struct AGOSGameDescription {
|
|||
uint32 features;
|
||||
};
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,7 +100,7 @@ static const Common::ADParams detectionParams = {
|
|||
Common::kADFlagAugmentPreferredTarget
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, AGOS::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, AGOS::AGOSEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
|
||||
|
||||
|
@ -116,9 +115,6 @@ bool AGOSEngine::initGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
int AGOSEngine::getGameId() const {
|
||||
return _gameDescription->gameId;
|
||||
|
|
|
@ -43,8 +43,6 @@ uint32 CineEngine::getFeatures() const { return _gameDescription->features; }
|
|||
Common::Language CineEngine::getLanguage() const { return _gameDescription->desc.language; }
|
||||
Common::Platform CineEngine::getPlatform() const { return _gameDescription->desc.platform; }
|
||||
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
static const PlainGameDescriptor cineGames[] = {
|
||||
|
@ -486,7 +484,7 @@ static const Common::ADParams detectionParams = {
|
|||
Common::kADFlagAugmentPreferredTarget
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, Cine::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software");
|
||||
|
||||
|
@ -501,8 +499,4 @@ bool CineEngine::initGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Cine
|
||||
|
|
|
@ -37,7 +37,6 @@ struct GOBGameDescription {
|
|||
const char *startTotBase;
|
||||
};
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
using namespace Common;
|
||||
|
@ -918,7 +917,7 @@ static const ADParams detectionParams = {
|
|||
kADFlagAugmentPreferredTarget | kADFlagFilebasedFallback
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, Gob::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");
|
||||
|
||||
|
@ -949,8 +948,4 @@ bool GobEngine::detectGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Parallaction
|
||||
|
|
|
@ -41,8 +41,6 @@ int Parallaction::getGameType() const { return _gameDescription->gameType; }
|
|||
uint32 Parallaction::getFeatures() const { return _gameDescription->features; }
|
||||
Common::Language Parallaction::getLanguage() const { return _gameDescription->desc.language; }
|
||||
Common::Platform Parallaction::getPlatform() const { return _gameDescription->desc.platform; }
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
static const PlainGameDescriptor parallactionGames[] = {
|
||||
|
@ -100,7 +98,7 @@ static const Common::ADParams detectionParams = {
|
|||
Common::kADFlagAugmentPreferredTarget
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Parallaction::Parallaction, Parallaction::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Parallaction::Parallaction, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte");
|
||||
|
||||
|
@ -114,8 +112,4 @@ bool Parallaction::detectGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Parallaction
|
||||
|
|
|
@ -79,7 +79,6 @@ int SagaEngine::getPatchesCount() const { return _gameDescription->patchesCount;
|
|||
const GamePatchDescription *SagaEngine::getPatchDescriptions() const { return _gameDescription->patchDescriptions; }
|
||||
const Common::ADGameFileDescription *SagaEngine::getFilesDescriptions() const { return _gameDescription->desc.filesDescriptions; }
|
||||
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
static const PlainGameDescriptor sagaGames[] = {
|
||||
|
@ -120,7 +119,7 @@ static const Common::ADParams detectionParams = {
|
|||
Common::kADFlagAugmentPreferredTarget
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, Saga::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
|
||||
|
||||
|
@ -140,8 +139,4 @@ bool SagaEngine::initGame() {
|
|||
return _resource->createContexts();
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Saga
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
|
||||
#include "touche/touche.h"
|
||||
|
||||
namespace Touche {
|
||||
static GameList GAME_detectGames(const FSList &fslist);
|
||||
}
|
||||
|
||||
|
||||
static const PlainGameDescriptor toucheGames[] = {
|
||||
{"touche", "Touche: The Adventures of the Fifth Musketeer"},
|
||||
|
@ -116,7 +112,7 @@ static const Common::ADParams detectionParams = {
|
|||
0
|
||||
};
|
||||
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Touche::ToucheEngine, Touche::GAME_detectGames, detectionParams);
|
||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Touche::ToucheEngine, detectionParams);
|
||||
|
||||
REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software");
|
||||
|
||||
|
@ -131,8 +127,4 @@ bool ToucheEngine::detectGame() {
|
|||
return true;
|
||||
}
|
||||
|
||||
GameList GAME_detectGames(const FSList &fslist) {
|
||||
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
||||
}
|
||||
|
||||
} // End of namespace Touche
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue