diff options
Diffstat (limited to 'engines/game.cpp')
-rw-r--r-- | engines/game.cpp | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/engines/game.cpp b/engines/game.cpp index a14edb8af4..8ea68bb681 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -38,20 +38,15 @@ GameDescriptor::GameDescriptor() { setVal("description", ""); } -GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd) { - setVal("gameid", pgd.gameid); - setVal("description", pgd.description); -} - -GameDescriptor::GameDescriptor(const PlainGameDescriptorGUIOpts &pgd) { +GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd, uint32 guioptions) { setVal("gameid", pgd.gameid); setVal("description", pgd.description); - if (pgd.guioptions != 0) - setVal("guioptions", Common::getGameGUIOptionsDescription(pgd.guioptions)); + if (guioptions != 0) + setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions)); } -GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions) { +GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions, GameSupportLevel gsl) { setVal("gameid", g); setVal("description", d); if (l != Common::UNK_LANG) @@ -60,6 +55,8 @@ GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, setVal("platform", Common::getPlatformCode(p)); if (guioptions != 0) setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions)); + + setSupportLevel(gsl); } void GameDescriptor::setGUIOptions(uint32 guioptions) { @@ -74,9 +71,6 @@ void GameDescriptor::appendGUIOptions(const Common::String &str) { } void GameDescriptor::updateDesc(const char *extra) { - // TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone. - // We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or - // the seperator (instead of '/' use ', ' or ' '). const bool hasCustomLanguage = (language() != Common::UNK_LANG); const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown); const bool hasExtraDesc = (extra && extra[0]); @@ -102,3 +96,30 @@ void GameDescriptor::updateDesc(const char *extra) { setVal("description", descr); } } + +GameSupportLevel GameDescriptor::getSupportLevel() { + GameSupportLevel gsl = kStableGame; + if (contains("gsl")) { + Common::String gslString = getVal("gsl"); + if (gslString.equals("unstable")) + gsl = kUnstableGame; + else if (gslString.equals("testing")) + gsl = kTestingGame; + } + return gsl; +} + +void GameDescriptor::setSupportLevel(GameSupportLevel gsl) { + switch (gsl) { + case kUnstableGame: + setVal("gsl", "unstable"); + break; + case kTestingGame: + setVal("gsl", "testing"); + break; + case kStableGame: + // Fall Through intended + default: + erase("gsl"); + } +} |