[Scummvm-cvs-logs] CVS: scummvm/base gameDetector.cpp,1.111,1.112 main.cpp,1.75,1.76

Max Horn fingolfin at users.sourceforge.net
Sat Apr 23 06:52:48 CEST 2005


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6576/base

Modified Files:
	gameDetector.cpp main.cpp 
Log Message:
Simplified debuglevel handling:
 - it's only honored in the global level of the config file
 - all checks for it go through gDebugLevel now, which is made global
 - the '-d' switch is handled in a slightly saner and consistent way
 - removed 'debuglevel' from the config format documentation; we do
   not want to encourage the avarage user to use it


Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/gameDetector.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- gameDetector.cpp	22 Apr 2005 21:56:32 -0000	1.111
+++ gameDetector.cpp	23 Apr 2005 13:52:26 -0000	1.112
@@ -170,7 +170,6 @@
 #endif
 
 	// Miscellaneous
-	ConfMan.registerDefault("debuglevel", 0);
 	ConfMan.registerDefault("joystick_num", -1);
 	ConfMan.registerDefault("confirm_exit", false);
 #ifdef USE_ALSA
@@ -369,13 +368,8 @@
 			END_OPTION
 			
 			DO_OPTION_OPT('d', "debuglevel")
-				if (option != NULL)
-					ConfMan.set("debuglevel", (int)strtol(option, 0, 10), kTransientDomain);
-				gDebugLevel = ConfMan.getInt("debuglevel");
-				if (gDebugLevel)
-					printf("Debuglevel (from command line): %d\n", gDebugLevel);
-				else
-					printf("Debuglevel (from command line): 0 - Game only\n");
+				gDebugLevel = option ? (int)strtol(option, 0, 10) : 1;
+				printf("Debuglevel (from command line): %d\n", gDebugLevel);
 			END_OPTION
 			
 			DO_OPTION('e', "music-driver")
@@ -568,7 +562,6 @@
 void GameDetector::setTarget(const String &name) {
 	_targetName = name;
 	ConfMan.setActiveDomain(name);
-	gDebugLevel = ConfMan.getInt("debuglevel");
 }
 
 bool GameDetector::detectGame() {

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/main.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- main.cpp	19 Apr 2005 20:22:48 -0000	1.75
+++ main.cpp	23 Apr 2005 13:52:26 -0000	1.76
@@ -360,7 +360,8 @@
 	else
 		ConfMan.loadDefaultConfigFile();
 
-	gDebugLevel = ConfMan.getInt("debuglevel");
+	if (ConfMan.hasKey("debuglevel"))
+		gDebugLevel = ConfMan.getInt("debuglevel");
 
 	// Update the config file
 	ConfMan.set("versioninfo", gScummVMVersion, Common::ConfigManager::kApplicationDomain);





More information about the Scummvm-git-logs mailing list