BASE: Set debug flags before instantiating an engine
This commit is contained in:
parent
d9ed62041d
commit
44b12eb0c7
1 changed files with 11 additions and 11 deletions
|
@ -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
|
// before we instantiate the engine, we register debug channels for it
|
||||||
DebugMan.addAllDebugChannels(metaEngineDetection.getDebugChannels());
|
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.
|
// Create the game's MetaEngine.
|
||||||
MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
|
MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
|
||||||
err = metaEngine.createInstance(&system, &engine);
|
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
|
#ifdef USE_TRANSLATION
|
||||||
Common::String previousLanguage = TransMan.getCurrentLanguage();
|
Common::String previousLanguage = TransMan.getCurrentLanguage();
|
||||||
if (ConfMan.hasKey("gui_use_game_language")
|
if (ConfMan.hasKey("gui_use_game_language")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue