Changed the semantics of debug level 0 from off back to something more similiar to how it used to be (default debug level now is -1)

svn-id: r17788
This commit is contained in:
Max Horn 2005-04-24 12:21:53 +00:00
parent 5553ef53f1
commit ce3cd9b194
6 changed files with 14 additions and 11 deletions

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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");

View File

@ -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

View File

@ -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);