diff --git a/base/main.cpp b/base/main.cpp index 04057533036..8163c229909 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -196,6 +196,17 @@ static Common::Error runGame(const Plugin *plugin, const Plugin *enginePlugin, O // before we instantiate the engine, we register debug channels for it DebugMan.addAllDebugChannels(metaEngineDetection.getDebugChannels()); + // On creation the engine should have set up all debug levels so we can use + // the command line arguments here + Common::StringTokenizer tokenizer(debugLevels, " ,"); + while (!tokenizer.empty()) { + Common::String token = tokenizer.nextToken(); + if (token.equalsIgnoreCase("all")) + DebugMan.enableAllDebugChannels(); + else if (!DebugMan.enableDebugChannel(token)) + warning("Engine does not support debug level '%s'", token.c_str()); + } + // Create the game's MetaEngine. MetaEngine &metaEngine = enginePlugin->get(); err = metaEngine.createInstance(&system, &engine); @@ -267,17 +278,6 @@ static Common::Error runGame(const Plugin *plugin, const Plugin *enginePlugin, O } } - // On creation the engine should have set up all debug levels so we can use - // the command line arguments here - Common::StringTokenizer tokenizer(debugLevels, " ,"); - while (!tokenizer.empty()) { - Common::String token = tokenizer.nextToken(); - if (token.equalsIgnoreCase("all")) - DebugMan.enableAllDebugChannels(); - else if (!DebugMan.enableDebugChannel(token)) - warning("Engine does not support debug level '%s'", token.c_str()); - } - #ifdef USE_TRANSLATION Common::String previousLanguage = TransMan.getCurrentLanguage(); if (ConfMan.hasKey("gui_use_game_language")