aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-04-24 12:21:53 +0000
committerMax Horn2005-04-24 12:21:53 +0000
commitce3cd9b194633e97eabf693f66498335f1f7557d (patch)
treeaaeeefb3556c31e71fc98feaaeaea69541bb9766
parent5553ef53f191ae190fcd6c35c430e61d665bae44 (diff)
downloadscummvm-rg350-ce3cd9b194633e97eabf693f66498335f1f7557d.tar.gz
scummvm-rg350-ce3cd9b194633e97eabf693f66498335f1f7557d.tar.bz2
scummvm-rg350-ce3cd9b194633e97eabf693f66498335f1f7557d.zip
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
-rw-r--r--base/gameDetector.cpp4
-rw-r--r--base/main.cpp9
-rw-r--r--scumm/debugger.cpp4
-rw-r--r--scumm/scumm.cpp2
-rw-r--r--simon/debugger.cpp4
-rw-r--r--simon/simon.cpp2
6 files changed, 14 insertions, 11 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 917f7b0ff3..a3b1fcdc32 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 d8afe0ddf7..70ce2726bc 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 11d85d5e3f..0b74138248 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 1ff99b974a..d4d26ef3f6 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 8e59970a71..63522259ce 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 7455d39b5c..42c5d33666 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);