[Scummvm-cvs-logs] SF.net SVN: scummvm:[36140] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Jan 30 05:52:54 CET 2009


Revision: 36140
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36140&view=rev
Author:   fingolfin
Date:     2009-01-30 04:52:53 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
Some more 'special debug levels' tweaks

Modified Paths:
--------------
    scummvm/trunk/base/main.cpp
    scummvm/trunk/common/debug.cpp
    scummvm/trunk/common/debug.h
    scummvm/trunk/engines/groovie/script.cpp
    scummvm/trunk/engines/groovie/vdx.cpp
    scummvm/trunk/engines/scumm/debugger.cpp

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/base/main.cpp	2009-01-30 04:52:53 UTC (rev 36140)
@@ -175,9 +175,14 @@
 		SearchMan.addDirectory(dir.getPath(), dir);
 	}
 
-	// On creation the engine should've set up all debug levels so we can use
+	// On creation the engine should have set up all debug levels so we can use
 	// the command line arugments here
-	Common::enableSpecialDebugLevelList(edebuglevels);
+	Common::StringTokenizer tokenizer(edebuglevels, " ,");
+	while (!tokenizer.empty()) {
+		Common::String token = tokenizer.nextToken();
+		if (!enableSpecialDebugLevel(token))
+			warning("Engine does not support debug level '%s'", token.c_str());
+	}
 
 	// Inform backend that the engine is about to be run
 	system.engineInit();

Modified: scummvm/trunk/common/debug.cpp
===================================================================
--- scummvm/trunk/common/debug.cpp	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/common/debug.cpp	2009-01-30 04:52:53 UTC (rev 36140)
@@ -57,8 +57,8 @@
 
 namespace {
 
-SpecialDebugLevelList gDebugLevels;
-uint32 gDebugLevelsEnabled = 0;
+static SpecialDebugLevelList gDebugLevels;
+static uint32 gDebugLevelsEnabled = 0;
 
 struct DebugLevelSort {
 	bool operator()(const SpecialDebugLevel &l, const SpecialDebugLevel &r) {
@@ -110,17 +110,6 @@
 	}
 }
 
-void enableSpecialDebugLevelList(const String &names) {
-	StringTokenizer tokenizer(names, " ,");
-	String token;
-
-	while (!tokenizer.empty()) {
-		token = tokenizer.nextToken();
-		if (!enableSpecialDebugLevel(token))
-			warning("Engine does not support debug level '%s'", token.c_str());
-	}
-}
-
 bool disableSpecialDebugLevel(const String &option) {
 	SpecialDebugLevelList::iterator i = find_if(gDebugLevels.begin(), gDebugLevels.end(), DebugLevelSearch(option));
 
@@ -138,10 +127,6 @@
 	return gDebugLevels;
 }
 
-uint32 getEnabledSpecialDebugLevels() {
-	return gDebugLevelsEnabled;
-}
-
 bool isSpecialDebugLevelEnabled(uint32 level) {
 	// FIXME: Seems gDebugLevel 11 has a special meaning? Document that!
 	if (gDebugLevel == 11)

Modified: scummvm/trunk/common/debug.h
===================================================================
--- scummvm/trunk/common/debug.h	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/common/debug.h	2009-01-30 04:52:53 UTC (rev 36140)
@@ -49,7 +49,7 @@
  * Adds a engine debug level.
  * @param level the level flag (should be OR-able i.e. first one should be 1 than 2,4,...)
  * @param name the option name which is used in the debugger/on the command line to enable
- *               this special debug level, the option will be compared case !insentiv! later
+ *               this special debug level (case will be ignored)
  * @param description the description which shows up in the debugger
  * @return true on success false on failure
  */
@@ -68,19 +68,14 @@
 bool enableSpecialDebugLevel(const String &name);
 
 /**
- * Enables a list of engine debug levels, given as a comma-separated list
- * of level names.
- * @param name the list of names of debug levels to enable
- */
-void enableSpecialDebugLevelList(const String &names);
-
-/**
  * Disables an engine debug level
  * @param name the name of the debug level to disable
  * @return true on success, false on failure
  */
 bool disableSpecialDebugLevel(const String &name);
 
+
+
 typedef List<SpecialDebugLevel> SpecialDebugLevelList;
 
 /**
@@ -89,13 +84,7 @@
  */
 const SpecialDebugLevelList &listSpecialDebugLevels();
 
-/**
- * Return the active debug flag mask (i.e. all active debug flags ORed
- * together into a single uint32).
- */
-uint32 getEnabledSpecialDebugLevels();
 
-
 /**
  * Test whether the given debug level is enabled.
  */

Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/engines/groovie/script.cpp	2009-01-30 04:52:53 UTC (rev 36140)
@@ -42,7 +42,8 @@
 	char buf[STRINGBUFLEN];
 	va_list va;
 
-	if (!Common::isSpecialDebugLevelEnabled(kGroovieDebugScript | kGroovieDebugAll))
+	if (!Common::isSpecialDebugLevelEnabled(kGroovieDebugScript) &&
+	    !Common::isSpecialDebugLevelEnabled(kGroovieDebugAll))
 		return;
 
 	va_start(va, s);
@@ -329,7 +330,8 @@
 	bool contained = rect.contains(mousepos);
 
 	// Show hotspots when debugging
-	if (Common::getEnabledSpecialDebugLevels() & (kGroovieDebugHotspots | kGroovieDebugAll)) {
+	if (Common::isSpecialDebugLevelEnabled(kGroovieDebugHotspots) ||
+	    Common::isSpecialDebugLevelEnabled(kGroovieDebugAll)) {
 		rect.translate(0, -80);
 		_vm->_graphicsMan->_foreground.frameRect(rect, 250);
 		_vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), 640, 0, 80, 640, 320);

Modified: scummvm/trunk/engines/groovie/vdx.cpp
===================================================================
--- scummvm/trunk/engines/groovie/vdx.cpp	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/engines/groovie/vdx.cpp	2009-01-30 04:52:53 UTC (rev 36140)
@@ -49,7 +49,8 @@
 }
 
 uint16 VDXPlayer::loadInternal() {
-	if (Common::isSpecialDebugLevelEnabled(kGroovieDebugVideo | kGroovieDebugAll)) {
+	if (Common::isSpecialDebugLevelEnabled(kGroovieDebugVideo) ||
+	    Common::isSpecialDebugLevelEnabled(kGroovieDebugAll)) {
 		int8 i;
 		debugN(1, "Groovie::VDX: New VDX: bitflags are ");
 		for (i = 15; i >= 0; i--) {
@@ -161,7 +162,7 @@
 
 	// Wait until the current frame can be shown
 
-	if (!(Common::getEnabledSpecialDebugLevels() & kGroovieDebugFast)) {
+	if (!Common::isSpecialDebugLevelEnabled(kGroovieDebugFast)) {
 		waitFrame();
 	}
 	// TODO: Move it to a better place
@@ -492,7 +493,7 @@
 
 	byte *data = new byte[60000];
 	int chunksize = in->read(data, 60000);
-	if (!(Common::getEnabledSpecialDebugLevels() & kGroovieDebugFast)) {
+	if (!Common::isSpecialDebugLevelEnabled(kGroovieDebugFast)) {
 		_audioStream->queueBuffer(data, chunksize);
 	}
 }

Modified: scummvm/trunk/engines/scumm/debugger.cpp
===================================================================
--- scummvm/trunk/engines/scumm/debugger.cpp	2009-01-30 04:42:30 UTC (rev 36139)
+++ scummvm/trunk/engines/scumm/debugger.cpp	2009-01-30 04:52:53 UTC (rev 36140)
@@ -47,7 +47,7 @@
 
 	// FIXME: Still spew all debug at -d9, for crashes in startup etc.
 	//	  Add setting from commandline ( / abstract channel interface)
-	if (!(Common::getEnabledSpecialDebugLevels() & channel) && (gDebugLevel < 9))
+	if (!Common::isSpecialDebugLevelEnabled(channel) && (gDebugLevel < 9))
 		return;
 
 	va_start(va, s);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list