diff --git a/base/commandLine.cpp b/base/commandLine.cpp index f71b75859b2..bb6a143bc20 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -546,6 +546,12 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_LONG_COMMAND("list-all-games") END_COMMAND + DO_LONG_COMMAND("list-all-debugflags") + END_COMMAND + + DO_LONG_COMMAND("list-debugflags") + END_COMMAND + DO_LONG_COMMAND("list-engines") END_COMMAND @@ -944,6 +950,33 @@ static void listTargets() { printf("%s\n", i->c_str()); } +static void printDebugFlags(const DebugChannelDef *debugChannels) { + if (!debugChannels) + return; + for (uint i = 0; debugChannels[i].channel != 0; i++) { + printf("%-15s %s\n", debugChannels[i].name, debugChannels[i].description); + } +} + +/** List global debug flags*/ +static void listGlobalDebugFlags() { + printDebugFlags(globalDebugChannels); +} + +/** List all engine specified debug channels */ +static void listAllEngineDebugFlags() { + printf("Flag name Flag description \n"); + + const PluginList &plugins = EngineMan.getPlugins(); + for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) { + const MetaEngineDetection &metaEngine = (*iter)->get(); + printf("--------------- ------------------------------------------------------\n"); + printf("ID=%-12s Name=%s\n", metaEngine.getEngineId(), metaEngine.getName()); + printDebugFlags(metaEngine.getDebugChannels()); + } + +} + /** List all saves states for the given target. */ static Common::Error listSaves(const Common::String &singleTarget) { Common::Error result = Common::kNoError; @@ -1427,6 +1460,12 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo if (command == "list-targets") { listTargets(); return true; + } else if (command == "list-all-debugflags") { + listAllEngineDebugFlags(); + return true; + } else if (command == "list-debugflags") { + listGlobalDebugFlags(); + return true; } else if (command == "list-games") { listGames(); return true; diff --git a/engines/metaengine.h b/engines/metaengine.h index 401b939026f..e5604903f54 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -171,7 +171,6 @@ public: } virtual const DebugChannelDef *getDebugChannels() const { - warning("Using the default implementation of getDebugChannels"); return NULL; }