diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 917f7b0ff39..a3b1fcdc328 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -47,8 +47,6 @@ #endif #endif -extern int gDebugLevel; - // DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :) #ifdef __PALM_OS__ static const char USAGE_STRING[] = "NoUsageString"; // save more data segment space @@ -378,7 +376,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { END_OPTION DO_OPTION_OPT('d', "debuglevel") - gDebugLevel = option ? (int)strtol(option, 0, 10) : 1; + gDebugLevel = option ? (int)strtol(option, 0, 10) : 0; printf("Debuglevel (from command line): %d\n", gDebugLevel); END_OPTION diff --git a/base/main.cpp b/base/main.cpp index d8afe0ddf7c..70ce2726bcf 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -185,8 +185,13 @@ static void do_memory_test(void) { #endif - -int gDebugLevel = 0; +/** + * The debug level. Initially set to -1, indicating that no debug output + * should be shown. Positive values usually imply an increasing number of + * debug output shall be generated, the higher the value, the more verbose the + * information (although the exact semantics are up to the engines). + */ +int gDebugLevel = -1; static void setupDummyPalette(OSystem &system) { // FIXME - mouse cursors are currently always set via 8 bit data. diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 11d85d5e3ff..0b74138248a 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -596,10 +596,10 @@ bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) { DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel); } else { // set level gDebugLevel = atoi(argv[1]); - if (gDebugLevel > 0) { + if (gDebugLevel >= 0) { _vm->_debugMode = true; DebugPrintf("Debug level set to level %d\n", gDebugLevel); - } else if (gDebugLevel == 0) { + } else if (gDebugLevel < 0) { _vm->_debugMode = false; DebugPrintf("Debugging is now disabled\n"); } else diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 1ff99b974a9..d4d26ef3f68 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1058,7 +1058,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS g_scumm = this; // Read settings from the detector & config manager - _debugMode = (gDebugLevel > 0); + _debugMode = (gDebugLevel >= 0); _dumpScripts = detector->_dumpScripts; _bootParam = ConfMan.getInt("boot_param"); diff --git a/simon/debugger.cpp b/simon/debugger.cpp index 8e59970a712..63522259ce5 100644 --- a/simon/debugger.cpp +++ b/simon/debugger.cpp @@ -90,10 +90,10 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) { DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel); } else { // set level gDebugLevel = atoi(argv[1]); - if (gDebugLevel > 0 && gDebugLevel < 10) { + if (gDebugLevel >= 0 && gDebugLevel < 10) { _vm->_debugMode = true; DebugPrintf("Debug level set to level %d\n", gDebugLevel); - } else if (gDebugLevel == 0) { + } else if (gDebugLevel < 0) { _vm->_debugMode = false; DebugPrintf("Debugging is now disabled\n"); } else diff --git a/simon/simon.cpp b/simon/simon.cpp index 7455d39b5c5..42c5d33666c 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -695,7 +695,7 @@ int SimonEngine::init(GameDetector &detector) { warning ("MIDI Player init failed: \"%s\"", midi.getErrorName (ret)); midi.set_volume(ConfMan.getInt("music_volume")); - _debugMode = (gDebugLevel > 0); + _debugMode = (gDebugLevel >= 0); if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1) midi.pause(_music_paused ^= 1);