From 4d0bba314d3b584f15d1d50e59d8f1b8c9a39161 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Mon, 25 Apr 2011 15:26:38 -0500 Subject: ENGINES: Warn user about games marked with ADGF_UNSTABLE flags ADGF_UNSTABLE is always warned about. ADGF_TESTING is only warned about when running configure with --enable-relase. Both warnings are subject to the enable_wip_game_warning config option. --- engines/advancedDetector.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'engines/advancedDetector.cpp') diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 7ae4d7718a..d864fe8b52 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -51,7 +51,13 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa extra = g.extra; } - GameDescriptor gd(g.gameid, title, g.language, g.platform); + GameSupportLevel gsl = kStableGame; + if (g.flags & ADGF_UNSTABLE) + gsl = kUnstableGame; + else if (g.flags & ADGF_TESTING) + gsl = kTestingGame; + + GameDescriptor gd(g.gameid, title, g.language, g.platform, 0, gsl); gd.updateDesc(extra); return gd; } @@ -253,8 +259,21 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) Common::updateGameGUIOptions(agdDesc->guioptions | _guioptions, lang); + GameDescriptor gameDescriptor = toGameDescriptor(*agdDesc, _gameids); + + bool showTestingWarning = false; + +#ifdef RELEASE_BUILD + showTestingWarning = true; +#endif + + if (((gameDescriptor.getSupportLevel() == kUnstableGame + || (gameDescriptor.getSupportLevel() == kTestingGame + && showTestingWarning))) + && !Engine::warnUserAboutUnsupportedGame()) + return Common::kUserCanceled; - debug(2, "Running %s", toGameDescriptor(*agdDesc, _gameids).description().c_str()); + debug(2, "Running %s", gameDescriptor.description().c_str()); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else -- cgit v1.2.3