diff options
author | johndoe123 | 2014-01-30 20:18:55 +0100 |
---|---|---|
committer | johndoe123 | 2014-01-30 20:18:55 +0100 |
commit | cf51529cfd0fedb33b1b0c70beb59997b21cfc5b (patch) | |
tree | 1df30e23c7f1eac7ca4a8ddfba40c89c2577dda7 /base | |
parent | 542197a891eac799855571fe2849e0dca43bdd2b (diff) | |
parent | 462f7c1c24a48b7555316a3afae357bad14cc14b (diff) | |
download | scummvm-rg350-cf51529cfd0fedb33b1b0c70beb59997b21cfc5b.tar.gz scummvm-rg350-cf51529cfd0fedb33b1b0c70beb59997b21cfc5b.tar.bz2 scummvm-rg350-cf51529cfd0fedb33b1b0c70beb59997b21cfc5b.zip |
Merge remote-tracking branch 'origin/master' into bbvs
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 15 | ||||
-rw-r--r-- | base/plugins.cpp | 2 | ||||
-rw-r--r-- | base/plugins.h | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/base/main.cpp b/base/main.cpp index 103d743bbc..abf75b7e7e 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; @@ -184,7 +197,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // // Add the game path to the directory search list - SearchMan.addDirectory(dir.getPath(), dir, 0, 4); + engine->initializePath(dir); // Add extrapath (if any) to the directory search list if (ConfMan.hasKey("extrapath")) { diff --git a/base/plugins.cpp b/base/plugins.cpp index b8cd097683..a232bb1427 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -295,7 +295,7 @@ bool PluginManagerUncached::loadPluginFromGameId(const Common::String &gameId) { if (domain->contains(gameId)) { Common::String filename = (*domain)[gameId]; - if (loadPluginByFileName(filename)) { + if (loadPluginByFileName(filename)) { return true; } } diff --git a/base/plugins.h b/base/plugins.h index 4409c9eaea..e0673ce636 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -169,7 +169,7 @@ protected: PluginType _type; public: - Plugin() : _pluginObject(0) {} + Plugin() : _pluginObject(0), _type(PLUGIN_TYPE_MAX) {} virtual ~Plugin() { //if (isLoaded()) //unloadPlugin(); |