aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorKamil Zbróg2013-10-20 23:53:31 +0100
committerKamil Zbróg2013-10-20 23:53:31 +0100
commit1f0e976ea69e1e28aeb146047181eb814c0f2aef (patch)
tree6f39d3cd4aa27cf68177c02b46811ac24f1c71c1 /base
parent852a9637119b544400984508ca20ccf47ed66a81 (diff)
parentb6bace0fa070985f5301480c36318043ef7b025e (diff)
downloadscummvm-rg350-1f0e976ea69e1e28aeb146047181eb814c0f2aef.tar.gz
scummvm-rg350-1f0e976ea69e1e28aeb146047181eb814c0f2aef.tar.bz2
scummvm-rg350-1f0e976ea69e1e28aeb146047181eb814c0f2aef.zip
Merge branch 'master' into prince
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 103d743bbc..c993dfa57a 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -134,6 +134,19 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
Common::Error err = Common::kNoError;
Engine *engine = 0;
+#if defined(SDL_BACKEND) && defined(USE_OPENGL) && defined(USE_RGB_COLOR)
+ // HACK: We set up the requested graphics mode setting here to allow the
+ // backend to switch from Surface SDL to OpenGL if necessary. This is
+ // needed because otherwise the g_system->getSupportedFormats might return
+ // bad values.
+ g_system->beginGFXTransaction();
+ g_system->setGraphicsMode(ConfMan.get("gfx_mode").c_str());
+ if (g_system->endGFXTransaction() != OSystem::kTransactionSuccess) {
+ warning("Switching graphics mode to '%s' failed", ConfMan.get("gfx_mode").c_str());
+ return Common::kUnknownError;
+ }
+#endif
+
// Verify that the game path refers to an actual directory
if (!(dir.exists() && dir.isDirectory()))
err = Common::kPathNotDirectory;