ENGINES: Change MetaEngine::listSupportedGames to return plain game descriptors
This commit is contained in:
parent
8fb149e3c7
commit
643c24db75
9 changed files with 42 additions and 40 deletions
|
@ -687,9 +687,9 @@ static void listGames() {
|
|||
|
||||
const PluginList &plugins = EngineMan.getPlugins();
|
||||
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
||||
GameList list = (*iter)->get<MetaEngine>().getSupportedGames();
|
||||
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
|
||||
printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str());
|
||||
PlainGameList list = (*iter)->get<MetaEngine>().getSupportedGames();
|
||||
for (PlainGameList::iterator v = list.begin(); v != list.end(); ++v) {
|
||||
printf("%-20s %s\n", v->gameId, v->description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -583,14 +583,14 @@ ADDetectedGame AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles,
|
|||
return result;
|
||||
}
|
||||
|
||||
GameList AdvancedMetaEngine::getSupportedGames() const {
|
||||
PlainGameList AdvancedMetaEngine::getSupportedGames() const {
|
||||
if (_singleId != NULL) {
|
||||
GameList gl;
|
||||
PlainGameList gl;
|
||||
|
||||
const PlainGameDescriptor *g = _gameIds;
|
||||
while (g->gameId) {
|
||||
if (0 == scumm_stricmp(_singleId, g->gameId)) {
|
||||
gl.push_back(GameDescriptor(g->gameId, g->description));
|
||||
gl.push_back(*g);
|
||||
|
||||
return gl;
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ GameList AdvancedMetaEngine::getSupportedGames() const {
|
|||
error("Engine %s doesn't have its singleid specified in ids list", _singleId);
|
||||
}
|
||||
|
||||
return GameList(_gameIds);
|
||||
return PlainGameList(_gameIds);
|
||||
}
|
||||
|
||||
PlainGameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
* Returns list of targets supported by the engine.
|
||||
* Distinguishes engines with single ID
|
||||
*/
|
||||
virtual GameList getSupportedGames() const;
|
||||
PlainGameList getSupportedGames() const override;
|
||||
|
||||
PlainGameDescriptor findGame(const char *gameId) const override;
|
||||
|
||||
|
|
|
@ -50,6 +50,18 @@ struct PlainGameDescriptor {
|
|||
*/
|
||||
const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
|
||||
|
||||
class PlainGameList : public Common::Array<PlainGameDescriptor> {
|
||||
public:
|
||||
PlainGameList() {}
|
||||
PlainGameList(const PlainGameList &list) : Common::Array<PlainGameDescriptor>(list) {}
|
||||
PlainGameList(const PlainGameDescriptor *g) {
|
||||
while (g->gameId) {
|
||||
push_back(*g);
|
||||
g++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Ths is an enum to describe how done a game is. This also indicates what level of support is expected.
|
||||
*/
|
||||
|
@ -106,17 +118,7 @@ public:
|
|||
};
|
||||
|
||||
/** List of games. */
|
||||
class GameList : public Common::Array<GameDescriptor> {
|
||||
public:
|
||||
GameList() {}
|
||||
GameList(const GameList &list) : Common::Array<GameDescriptor>(list) {}
|
||||
GameList(const PlainGameDescriptor *g) {
|
||||
while (g->gameId) {
|
||||
push_back(GameDescriptor(*g));
|
||||
g++;
|
||||
}
|
||||
}
|
||||
};
|
||||
typedef Common::Array<GameDescriptor> GameList;
|
||||
|
||||
/**
|
||||
* A record describing the properties of a file. Used on the existing
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual const char *getOriginalCopyright() const = 0;
|
||||
|
||||
/** Returns a list of games supported by this engine. */
|
||||
virtual GameList getSupportedGames() const = 0;
|
||||
virtual PlainGameList getSupportedGames() const = 0;
|
||||
|
||||
/** Query the engine for a PlainGameDescriptor for the specified gameid, if any. */
|
||||
virtual PlainGameDescriptor findGame(const char *gameId) const = 0;
|
||||
|
|
|
@ -959,7 +959,7 @@ public:
|
|||
virtual const char *getOriginalCopyright() const;
|
||||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
PlainGameList getSupportedGames() const override;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
virtual DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
|
||||
|
@ -992,8 +992,8 @@ bool ScummEngine::hasFeature(EngineFeature f) const {
|
|||
(f == kSupportsSubtitleOptions);
|
||||
}
|
||||
|
||||
GameList ScummMetaEngine::getSupportedGames() const {
|
||||
return GameList(gameDescriptions);
|
||||
PlainGameList ScummMetaEngine::getSupportedGames() const {
|
||||
return PlainGameList(gameDescriptions);
|
||||
}
|
||||
|
||||
PlainGameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
virtual const char *getOriginalCopyright() const;
|
||||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
PlainGameList getSupportedGames() const override;
|
||||
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
|
@ -110,9 +110,9 @@ bool Sky::SkyEngine::hasFeature(EngineFeature f) const {
|
|||
(f == kSupportsSavingDuringRuntime);
|
||||
}
|
||||
|
||||
GameList SkyMetaEngine::getSupportedGames() const {
|
||||
GameList games;
|
||||
games.push_back(GameDescriptor(skySetting));
|
||||
PlainGameList SkyMetaEngine::getSupportedGames() const {
|
||||
PlainGameList games;
|
||||
games.push_back(skySetting);
|
||||
return games;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
}
|
||||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
PlainGameList getSupportedGames() const override;
|
||||
PlainGameDescriptor findGame(const char *gameId) const override;
|
||||
DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
virtual SaveStateList listSaves(const char *target) const;
|
||||
|
@ -116,14 +116,14 @@ bool Sword1::SwordEngine::hasFeature(EngineFeature f) const {
|
|||
(f == kSupportsLoadingDuringRuntime);
|
||||
}
|
||||
|
||||
GameList SwordMetaEngine::getSupportedGames() const {
|
||||
GameList games;
|
||||
games.push_back(GameDescriptor(sword1FullSettings, GUIO_NOMIDI));
|
||||
games.push_back(GameDescriptor(sword1DemoSettings, GUIO_NOMIDI));
|
||||
games.push_back(GameDescriptor(sword1MacFullSettings, GUIO_NOMIDI));
|
||||
games.push_back(GameDescriptor(sword1MacDemoSettings, GUIO_NOMIDI));
|
||||
games.push_back(GameDescriptor(sword1PSXSettings, GUIO_NOMIDI));
|
||||
games.push_back(GameDescriptor(sword1PSXDemoSettings, GUIO_NOMIDI));
|
||||
PlainGameList SwordMetaEngine::getSupportedGames() const {
|
||||
PlainGameList games;
|
||||
games.push_back(sword1FullSettings);
|
||||
games.push_back(sword1DemoSettings);
|
||||
games.push_back(sword1MacFullSettings);
|
||||
games.push_back(sword1MacDemoSettings);
|
||||
games.push_back(sword1PSXSettings);
|
||||
games.push_back(sword1PSXDemoSettings);
|
||||
return games;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
}
|
||||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
PlainGameList getSupportedGames() const override;
|
||||
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
virtual DetectedGames detectGames(const Common::FSList &fslist) const;
|
||||
|
@ -119,11 +119,11 @@ bool Sword2::Sword2Engine::hasFeature(EngineFeature f) const {
|
|||
(f == kSupportsLoadingDuringRuntime);
|
||||
}
|
||||
|
||||
GameList Sword2MetaEngine::getSupportedGames() const {
|
||||
PlainGameList Sword2MetaEngine::getSupportedGames() const {
|
||||
const Sword2::GameSettings *g = Sword2::sword2_settings;
|
||||
GameList games;
|
||||
PlainGameList games;
|
||||
while (g->gameid) {
|
||||
games.push_back(GameDescriptor(g->gameid, g->description));
|
||||
games.push_back(PlainGameDescriptor(g->gameid, g->description));
|
||||
g++;
|
||||
}
|
||||
return games;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue