From ed180f6b67b0f8c0bedfca7117ab279349c45e1e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 7 Oct 2013 00:58:19 +0200 Subject: BASE: Add hack to switch graphics manager in runGame. This is a (temporary) hack to assure that when the launcher is set up as an SurfaceSDL graphics mode and the game is using an OpenGL graphics mode everything will work as expected. --- base/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'base/main.cpp') 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; -- cgit v1.2.3 From 651e2808018d7ca8f36d05cda49e53229b0fd7dd Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 22 Jan 2014 18:07:06 +0100 Subject: ENGINES: Introduce method Engine::initializePath which sets up SearchMan. This replaces the hardcoded addition of the game path in runGame in base/main.cpp by an engine configurable one. --- base/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base/main.cpp') diff --git a/base/main.cpp b/base/main.cpp index c993dfa57a..abf75b7e7e 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -197,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")) { -- cgit v1.2.3 From f62153c7951b931619b3a6a35e22ba465bcfa6fa Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:18 +0100 Subject: BASE: Make GPL headers consistent in themselves. --- base/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base/main.cpp') diff --git a/base/main.cpp b/base/main.cpp index abf75b7e7e..1fa75d5e9c 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 960e16009c634e4060ffd892b19834b49ddfcbe9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 5 Jun 2014 16:35:07 +0200 Subject: BASE: Allow 'all' to enable all debug channels via CLI too. --- base/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'base/main.cpp') diff --git a/base/main.cpp b/base/main.cpp index 1fa75d5e9c..7451c007a4 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -222,7 +222,9 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const Common::StringTokenizer tokenizer(edebuglevels, " ,"); while (!tokenizer.empty()) { Common::String token = tokenizer.nextToken(); - if (!DebugMan.enableDebugChannel(token)) + if (token.equalsIgnoreCase("all")) + DebugMan.enableAllDebugChannels(); + else if (!DebugMan.enableDebugChannel(token)) warning(_("Engine does not support debug level '%s'"), token.c_str()); } -- cgit v1.2.3