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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Apr 27 23:40:52 CEST 2010


Revision: 48821
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48821&view=rev
Author:   fingolfin
Date:     2010-04-27 21:40:52 +0000 (Tue, 27 Apr 2010)

Log Message:
-----------
COMMON: Move DebugChannel stuff into a new DebugMan singleton

Modified Paths:
--------------
    scummvm/trunk/base/main.cpp
    scummvm/trunk/common/debug.cpp
    scummvm/trunk/common/debug.h
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/preagi.cpp
    scummvm/trunk/engines/cine/cine.cpp
    scummvm/trunk/engines/cruise/cruise.cpp
    scummvm/trunk/engines/draci/draci.cpp
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/groovie/debug.cpp
    scummvm/trunk/engines/groovie/groovie.cpp
    scummvm/trunk/engines/groovie/script.cpp
    scummvm/trunk/engines/groovie/vdx.cpp
    scummvm/trunk/engines/kyra/kyra_lok.cpp
    scummvm/trunk/engines/kyra/kyra_v1.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/m4/m4.cpp
    scummvm/trunk/engines/mohawk/myst.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/sci/decompressor.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/scumm/debugger.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/tinsel/tinsel.cpp
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/gui/debugger.cpp

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/base/main.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -198,7 +198,7 @@
 	Common::StringTokenizer tokenizer(edebuglevels, " ,");
 	while (!tokenizer.empty()) {
 		Common::String token = tokenizer.nextToken();
-		if (!enableDebugChannel(token))
+		if (!DebugMan.enableDebugChannel(token))
 			warning("Engine does not support debug level '%s'", token.c_str());
 	}
 
@@ -212,7 +212,7 @@
 	system.engineDone();
 
 	// We clear all debug levels again even though the engine should do it
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 
 	// Free up memory
 	delete engine;

Modified: scummvm/trunk/common/debug.cpp
===================================================================
--- scummvm/trunk/common/debug.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/common/debug.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -24,8 +24,6 @@
 
 #include "common/debug.h"
 #include "common/util.h"
-#include "common/hashmap.h"
-#include "common/hash-str.h"
 
 #include <stdarg.h>	// For va_list etc.
 
@@ -48,24 +46,21 @@
 // TODO: Move gDebugLevel into namespace Common.
 int gDebugLevel = -1;
 
+DECLARE_SINGLETON(Common::DebugManager)
+
 namespace Common {
 
 namespace {
 
-typedef HashMap<String, DebugChannel, IgnoreCase_Hash, IgnoreCase_EqualTo> DebugChannelMap;
-
-static DebugChannelMap gDebugChannels;
-static uint32 gDebugChannelsEnabled = 0;
-
 struct DebugLevelComperator {
-	bool operator()(const DebugChannel &l, const DebugChannel &r) {
+	bool operator()(const DebugManager::DebugChannel &l, const DebugManager::DebugChannel &r) {
 		return (l.name.compareToIgnoreCase(r.name) < 0);
 	}
 };
 
 } // end of anonymous namespace
 
-bool addDebugChannel(uint32 channel, const String &name, const String &description) {
+bool DebugManager::addDebugChannel(uint32 channel, const String &name, const String &description) {
 	if (gDebugChannels.contains(name))
 		warning("Duplicate declaration of engine debug channel '%s'", name.c_str());
 
@@ -74,12 +69,12 @@
 	return true;
 }
 
-void clearAllDebugChannels() {
+void DebugManager::clearAllDebugChannels() {
 	gDebugChannelsEnabled = 0;
 	gDebugChannels.clear();
 }
 
-bool enableDebugChannel(const String &name) {
+bool DebugManager::enableDebugChannel(const String &name) {
 	DebugChannelMap::iterator i = gDebugChannels.find(name);
 
 	if (i != gDebugChannels.end()) {
@@ -92,7 +87,7 @@
 	}
 }
 
-bool disableDebugChannel(const String &name) {
+bool DebugManager::disableDebugChannel(const String &name) {
 	DebugChannelMap::iterator i = gDebugChannels.find(name);
 
 	if (i != gDebugChannels.end()) {
@@ -106,7 +101,7 @@
 }
 
 
-DebugChannelList listDebugChannels() {
+DebugManager::DebugChannelList DebugManager::listDebugChannels() {
 	DebugChannelList tmp;
 	for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i)
 		tmp.push_back(i->_value);
@@ -115,7 +110,7 @@
 	return tmp;
 }
 
-bool isDebugChannelEnabled(uint32 channel) {
+bool DebugManager::isDebugChannelEnabled(uint32 channel) {
 	// Debug level 11 turns on all special debug level messages
 	if (gDebugLevel == 11)
 		return true;
@@ -206,7 +201,7 @@
 
 	// Debug level 11 turns on all special debug level messages
 	if (gDebugLevel != 11)
-		if (level > gDebugLevel || !(Common::gDebugChannelsEnabled & debugChannels))
+		if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels)))
 			return;
 
 	va_start(va, s);
@@ -219,7 +214,7 @@
 
 	// Debug level 11 turns on all special debug level messages
 	if (gDebugLevel != 11)
-		if (level > gDebugLevel || !(Common::gDebugChannelsEnabled & debugChannels))
+		if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels)))
 			return;
 
 	va_start(va, s);
@@ -232,7 +227,7 @@
 
 	// Debug level 11 turns on all special debug level messages
 	if (gDebugLevel != 11)
-		if (!(Common::gDebugChannelsEnabled & debugChannels))
+		if (!(DebugMan.isDebugChannelEnabled(debugChannels)))
 			return;
 
 	va_start(va, s);
@@ -245,7 +240,7 @@
 
 	// Debug level 11 turns on all special debug level messages
 	if (gDebugLevel != 11)
-		if (!(Common::gDebugChannelsEnabled & debugChannels))
+		if (!(DebugMan.isDebugChannelEnabled(debugChannels)))
 			return;
 
 	va_start(va, s);

Modified: scummvm/trunk/common/debug.h
===================================================================
--- scummvm/trunk/common/debug.h	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/common/debug.h	2010-04-27 21:40:52 UTC (rev 48821)
@@ -26,13 +26,20 @@
 #define COMMON_DEBUG_H
 
 #include "common/scummsys.h"
+#include "common/singleton.h"
 #include "common/textconsole.h"
 #include "common/list.h"
 #include "common/str.h"
 
+#include "common/hashmap.h"
+#include "common/hash-str.h"
 
+
 namespace Common {
 
+// TODO: Find a better name for this
+class DebugManager : public Singleton<DebugManager> {
+public:
 
 struct DebugChannel {
 	DebugChannel() : channel(0), enabled(false) {}
@@ -109,6 +116,19 @@
 bool isDebugChannelEnabled(uint32 channel);
 
 
+private:
+	typedef HashMap<String, DebugChannel, IgnoreCase_Hash, IgnoreCase_EqualTo> DebugChannelMap;
+
+	DebugChannelMap gDebugChannels;
+	uint32 gDebugChannelsEnabled;
+
+	friend class Singleton<SingletonBaseType>;
+	DebugManager() : gDebugChannelsEnabled(0) {}
+};
+
+/** Shortcut for accessing the debug manager. */
+#define DebugMan		Common::DebugManager::instance()
+
 /**
  * Set the output formatter used by debug() and related functions.
  */

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/agi/agi.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -515,16 +515,16 @@
 	_rnd = new Common::RandomSource();
 	g_eventRec.registerRandomSource(*_rnd, "agi");
 
-	Common::addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
-	Common::addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging");
-	Common::addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging");
-	Common::addDebugChannel(kDebugLevelInventory, "Inventory", "Inventory debugging");
-	Common::addDebugChannel(kDebugLevelInput, "Input", "Input events debugging");
-	Common::addDebugChannel(kDebugLevelMenu, "Menu", "Menu debugging");
-	Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Scripts debugging");
-	Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
-	Common::addDebugChannel(kDebugLevelText, "Text", "Text output debugging");
-	Common::addDebugChannel(kDebugLevelSavegame, "Savegame", "Saving & restoring game debugging");
+	DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
+	DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging");
+	DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging");
+	DebugMan.addDebugChannel(kDebugLevelInventory, "Inventory", "Inventory debugging");
+	DebugMan.addDebugChannel(kDebugLevelInput, "Input", "Input events debugging");
+	DebugMan.addDebugChannel(kDebugLevelMenu, "Menu", "Menu debugging");
+	DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Scripts debugging");
+	DebugMan.addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
+	DebugMan.addDebugChannel(kDebugLevelText, "Text", "Text output debugging");
+	DebugMan.addDebugChannel(kDebugLevelSavegame, "Savegame", "Saving & restoring game debugging");
 
 
 	memset(&_game, 0, sizeof(struct AgiGame));

Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/agi/preagi.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -46,16 +46,16 @@
 
 	_rnd = new Common::RandomSource();
 
-	Common::addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
-	Common::addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging");
-	Common::addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging");
-	Common::addDebugChannel(kDebugLevelInventory, "Inventory", "Inventory debugging");
-	Common::addDebugChannel(kDebugLevelInput, "Input", "Input events debugging");
-	Common::addDebugChannel(kDebugLevelMenu, "Menu", "Menu debugging");
-	Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Scripts debugging");
-	Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
-	Common::addDebugChannel(kDebugLevelText, "Text", "Text output debugging");
-	Common::addDebugChannel(kDebugLevelSavegame, "Savegame", "Saving & restoring game debugging");
+	DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
+	DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging");
+	DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging");
+	DebugMan.addDebugChannel(kDebugLevelInventory, "Inventory", "Inventory debugging");
+	DebugMan.addDebugChannel(kDebugLevelInput, "Input", "Input events debugging");
+	DebugMan.addDebugChannel(kDebugLevelMenu, "Menu", "Menu debugging");
+	DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Scripts debugging");
+	DebugMan.addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
+	DebugMan.addDebugChannel(kDebugLevelText, "Text", "Text output debugging");
+	DebugMan.addDebugChannel(kDebugLevelSavegame, "Savegame", "Saving & restoring game debugging");
 
 	memset(&_game, 0, sizeof(struct AgiGame));
 	memset(&_debug, 0, sizeof(struct AgiDebug));

Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/cine/cine.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -51,9 +51,9 @@
 CineEngine *g_cine;
 
 CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
-	Common::addDebugChannel(kCineDebugScript, "Script", "Script debug level");
-	Common::addDebugChannel(kCineDebugPart,   "Part",   "Part debug level");
-	Common::addDebugChannel(kCineDebugSound,  "Sound",  "Sound debug level");
+	DebugMan.addDebugChannel(kCineDebugScript, "Script", "Script debug level");
+	DebugMan.addDebugChannel(kCineDebugPart,   "Part",   "Part debug level");
+	DebugMan.addDebugChannel(kCineDebugSound,  "Sound",  "Sound debug level");
 
 	// Setup mixer
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
@@ -72,7 +72,7 @@
 	if (g_cine->getGameType() == Cine::GType_OS) {
 		freeErrmessDat();
 	}
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 }
 
 Common::Error CineEngine::run() {

Modified: scummvm/trunk/engines/cruise/cruise.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/cruise/cruise.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -53,8 +53,8 @@
 	_currentVolumeFile = new Common::File();
 #endif
 
-	Common::addDebugChannel(kCruiseDebugScript, "scripts", "Scripts debug level");
-	Common::addDebugChannel(kCruiseDebugSound, "sound", "Sound debug level");
+	DebugMan.addDebugChannel(kCruiseDebugScript, "scripts", "Scripts debug level");
+	DebugMan.addDebugChannel(kCruiseDebugSound, "sound", "Sound debug level");
 
 	// Setup mixer
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType,

Modified: scummvm/trunk/engines/draci/draci.cpp
===================================================================
--- scummvm/trunk/engines/draci/draci.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/draci/draci.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -82,13 +82,13 @@
 	//SearchMan.addSubDirectoryMatching(_gameDataDir, "sound");
 
 	// Here is the right place to set up the engine specific debug levels
-	Common::addDebugChannel(kDraciGeneralDebugLevel, "general", "Draci general debug info");
-	Common::addDebugChannel(kDraciBytecodeDebugLevel, "bytecode", "GPL bytecode instructions");
-	Common::addDebugChannel(kDraciArchiverDebugLevel, "archiver", "BAR archiver debug info");
-	Common::addDebugChannel(kDraciLogicDebugLevel, "logic", "Game logic debug info");
-	Common::addDebugChannel(kDraciAnimationDebugLevel, "animation", "Animation debug info");
-	Common::addDebugChannel(kDraciSoundDebugLevel, "sound", "Sound debug info");
-	Common::addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");
+	DebugMan.addDebugChannel(kDraciGeneralDebugLevel, "general", "Draci general debug info");
+	DebugMan.addDebugChannel(kDraciBytecodeDebugLevel, "bytecode", "GPL bytecode instructions");
+	DebugMan.addDebugChannel(kDraciArchiverDebugLevel, "archiver", "BAR archiver debug info");
+	DebugMan.addDebugChannel(kDraciLogicDebugLevel, "logic", "Game logic debug info");
+	DebugMan.addDebugChannel(kDraciAnimationDebugLevel, "animation", "Animation debug info");
+	DebugMan.addDebugChannel(kDraciSoundDebugLevel, "sound", "Sound debug info");
+	DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");
 
 	// Don't forget to register your random source
 	g_eventRec.registerRandomSource(_rnd, "draci");
@@ -349,7 +349,7 @@
 	delete _dubbingArchive;
 
 	// Remove all of our debug levels here
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 }
 
 Common::Error DraciEngine::run() {

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/gob/gob.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -130,18 +130,18 @@
 
 	_copyProtection = ConfMan.getBool("copy_protection");
 
-	Common::addDebugChannel(kDebugFuncOp, "FuncOpcodes", "Script FuncOpcodes debug level");
-	Common::addDebugChannel(kDebugDrawOp, "DrawOpcodes", "Script DrawOpcodes debug level");
-	Common::addDebugChannel(kDebugGobOp, "GoblinOpcodes", "Script GoblinOpcodes debug level");
-	Common::addDebugChannel(kDebugSound, "Sound", "Sound output debug level");
-	Common::addDebugChannel(kDebugExpression, "Expression", "Expression parser debug level");
-	Common::addDebugChannel(kDebugGameFlow, "Gameflow", "Gameflow debug level");
-	Common::addDebugChannel(kDebugFileIO, "FileIO", "File Input/Output debug level");
-	Common::addDebugChannel(kDebugSaveLoad, "SaveLoad", "Saving/Loading debug level");
-	Common::addDebugChannel(kDebugGraphics, "Graphics", "Graphics debug level");
-	Common::addDebugChannel(kDebugVideo, "Video", "IMD/VMD video debug level");
-	Common::addDebugChannel(kDebugHotspots, "Hotspots", "Hotspots debug level");
-	Common::addDebugChannel(kDebugDemo, "Demo", "Demo script debug level");
+	DebugMan.addDebugChannel(kDebugFuncOp, "FuncOpcodes", "Script FuncOpcodes debug level");
+	DebugMan.addDebugChannel(kDebugDrawOp, "DrawOpcodes", "Script DrawOpcodes debug level");
+	DebugMan.addDebugChannel(kDebugGobOp, "GoblinOpcodes", "Script GoblinOpcodes debug level");
+	DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound output debug level");
+	DebugMan.addDebugChannel(kDebugExpression, "Expression", "Expression parser debug level");
+	DebugMan.addDebugChannel(kDebugGameFlow, "Gameflow", "Gameflow debug level");
+	DebugMan.addDebugChannel(kDebugFileIO, "FileIO", "File Input/Output debug level");
+	DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Saving/Loading debug level");
+	DebugMan.addDebugChannel(kDebugGraphics, "Graphics", "Graphics debug level");
+	DebugMan.addDebugChannel(kDebugVideo, "Video", "IMD/VMD video debug level");
+	DebugMan.addDebugChannel(kDebugHotspots, "Hotspots", "Hotspots debug level");
+	DebugMan.addDebugChannel(kDebugDemo, "Demo", "Demo script debug level");
 
 	g_eventRec.registerRandomSource(_rnd, "gob");
 }

Modified: scummvm/trunk/engines/groovie/debug.cpp
===================================================================
--- scummvm/trunk/engines/groovie/debug.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/groovie/debug.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -46,7 +46,7 @@
 }
 
 Debugger::~Debugger() {
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 }
 
 int Debugger::getNumber(const char *arg) {

Modified: scummvm/trunk/engines/groovie/groovie.cpp
===================================================================
--- scummvm/trunk/engines/groovie/groovie.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/groovie/groovie.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -46,17 +46,17 @@
 	SearchMan.addSubDirectoryMatching(_gameDataDir, "system");
 
 	// Initialize the custom debug levels
-	Common::addDebugChannel(kGroovieDebugAll, "All", "Debug everything");
-	Common::addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback");
-	Common::addDebugChannel(kGroovieDebugResource, "Resource", "Debug resouce management");
-	Common::addDebugChannel(kGroovieDebugScript, "Script", "Debug the scripts");
-	Common::addDebugChannel(kGroovieDebugUnknown, "Unknown", "Report values of unknown data in files");
-	Common::addDebugChannel(kGroovieDebugHotspots, "Hotspots", "Show the hotspots");
-	Common::addDebugChannel(kGroovieDebugCursor, "Cursor", "Debug cursor decompression / switching");
-	Common::addDebugChannel(kGroovieDebugMIDI, "MIDI", "Debug MIDI / XMIDI files");
-	Common::addDebugChannel(kGroovieDebugScriptvars, "Scriptvars", "Print out any change to script variables");
-	Common::addDebugChannel(kGroovieDebugCell, "Cell", "Debug the cell game (in the microscope)");
-	Common::addDebugChannel(kGroovieDebugFast, "Fast", "Play videos quickly, with no sound (unstable)");
+	DebugMan.addDebugChannel(kGroovieDebugAll, "All", "Debug everything");
+	DebugMan.addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback");
+	DebugMan.addDebugChannel(kGroovieDebugResource, "Resource", "Debug resouce management");
+	DebugMan.addDebugChannel(kGroovieDebugScript, "Script", "Debug the scripts");
+	DebugMan.addDebugChannel(kGroovieDebugUnknown, "Unknown", "Report values of unknown data in files");
+	DebugMan.addDebugChannel(kGroovieDebugHotspots, "Hotspots", "Show the hotspots");
+	DebugMan.addDebugChannel(kGroovieDebugCursor, "Cursor", "Debug cursor decompression / switching");
+	DebugMan.addDebugChannel(kGroovieDebugMIDI, "MIDI", "Debug MIDI / XMIDI files");
+	DebugMan.addDebugChannel(kGroovieDebugScriptvars, "Scriptvars", "Print out any change to script variables");
+	DebugMan.addDebugChannel(kGroovieDebugCell, "Cell", "Debug the cell game (in the microscope)");
+	DebugMan.addDebugChannel(kGroovieDebugFast, "Fast", "Play videos quickly, with no sound (unstable)");
 }
 
 GroovieEngine::~GroovieEngine() {

Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/groovie/script.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -45,8 +45,8 @@
 	char buf[STRINGBUFLEN];
 	va_list va;
 
-	if (!Common::isDebugChannelEnabled(kGroovieDebugScript) &&
-	    !Common::isDebugChannelEnabled(kGroovieDebugAll))
+	if (!DebugMan.isDebugChannelEnabled(kGroovieDebugScript) &&
+	    !DebugMan.isDebugChannelEnabled(kGroovieDebugAll))
 		return;
 
 	va_start(va, s);
@@ -357,8 +357,8 @@
 	bool contained = rect.contains(mousepos);
 
 	// Show hotspots when debugging
-	if (Common::isDebugChannelEnabled(kGroovieDebugHotspots) ||
-	    Common::isDebugChannelEnabled(kGroovieDebugAll)) {
+	if (DebugMan.isDebugChannelEnabled(kGroovieDebugHotspots) ||
+	    DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) {
 		rect.translate(0, -80);
 		_vm->_graphicsMan->_foreground.frameRect(rect, 250);
 		_vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320);

Modified: scummvm/trunk/engines/groovie/vdx.cpp
===================================================================
--- scummvm/trunk/engines/groovie/vdx.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/groovie/vdx.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -54,8 +54,8 @@
 }
 
 uint16 VDXPlayer::loadInternal() {
-	if (Common::isDebugChannelEnabled(kGroovieDebugVideo) ||
-	    Common::isDebugChannelEnabled(kGroovieDebugAll)) {
+	if (DebugMan.isDebugChannelEnabled(kGroovieDebugVideo) ||
+	    DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) {
 		int8 i;
 		debugN(1, "Groovie::VDX: New VDX: bitflags are ");
 		for (i = 15; i >= 0; i--) {
@@ -175,7 +175,7 @@
 
 	// Wait until the current frame can be shown
 
-	if (!Common::isDebugChannelEnabled(kGroovieDebugFast)) {
+	if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) {
 		waitFrame();
 	}
 	// TODO: Move it to a better place
@@ -506,7 +506,7 @@
 
 	byte *data = (byte *)malloc(60000);
 	int chunksize = in->read(data, 60000);
-	if (!Common::isDebugChannelEnabled(kGroovieDebugFast)) {
+	if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) {
 		_audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
 	}
 }

Modified: scummvm/trunk/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/kyra/kyra_lok.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -111,7 +111,7 @@
 		_emc->unload(&_scriptClickData);
 	}
 
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 
 	delete _screen;
 	delete _sprites;

Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -73,17 +73,17 @@
 	_mouseX = _mouseY = 0;
 
 	// sets up all engine specific debug levels
-	Common::addDebugChannel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
-	Common::addDebugChannel(kDebugLevelScript, "Script", "Script interpreter debug level");
-	Common::addDebugChannel(kDebugLevelSprites, "Sprites", "Sprite debug level");
-	Common::addDebugChannel(kDebugLevelScreen, "Screen", "Screen debug level");
-	Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debug level");
-	Common::addDebugChannel(kDebugLevelAnimator, "Animator", "Animator debug level");
-	Common::addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
-	Common::addDebugChannel(kDebugLevelGUI, "GUI", "GUI debug level");
-	Common::addDebugChannel(kDebugLevelSequence, "Sequence", "Sequence debug level");
-	Common::addDebugChannel(kDebugLevelMovie, "Movie", "Movie debug level");
-	Common::addDebugChannel(kDebugLevelTimer, "Timer", "Timer debug level");
+	DebugMan.addDebugChannel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
+	DebugMan.addDebugChannel(kDebugLevelScript, "Script", "Script interpreter debug level");
+	DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprite debug level");
+	DebugMan.addDebugChannel(kDebugLevelScreen, "Screen", "Screen debug level");
+	DebugMan.addDebugChannel(kDebugLevelSound, "Sound", "Sound debug level");
+	DebugMan.addDebugChannel(kDebugLevelAnimator, "Animator", "Animator debug level");
+	DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
+	DebugMan.addDebugChannel(kDebugLevelGUI, "GUI", "GUI debug level");
+	DebugMan.addDebugChannel(kDebugLevelSequence, "Sequence", "Sequence debug level");
+	DebugMan.addDebugChannel(kDebugLevelMovie, "Movie", "Movie debug level");
+	DebugMan.addDebugChannel(kDebugLevelTimer, "Timer", "Timer debug level");
 
 	g_eventRec.registerRandomSource(_rnd, "kyra");
 }

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/lure/lure.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -42,12 +42,12 @@
 LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): Engine(system), _gameDescription(gameDesc) {
 	g_eventRec.registerRandomSource(_rnd, "lure");
 
-	Common::addDebugChannel(kLureDebugScripts, "scripts", "Scripts debugging");
-	Common::addDebugChannel(kLureDebugAnimations, "animations", "Animations debugging");
-	Common::addDebugChannel(kLureDebugHotspots, "hotspots", "Hotspots debugging");
-	Common::addDebugChannel(kLureDebugFights, "fights", "Fights debugging");
-	Common::addDebugChannel(kLureDebugSounds, "sounds", "Sounds debugging");
-	Common::addDebugChannel(kLureDebugStrings, "strings", "Strings debugging");
+	DebugMan.addDebugChannel(kLureDebugScripts, "scripts", "Scripts debugging");
+	DebugMan.addDebugChannel(kLureDebugAnimations, "animations", "Animations debugging");
+	DebugMan.addDebugChannel(kLureDebugHotspots, "hotspots", "Hotspots debugging");
+	DebugMan.addDebugChannel(kLureDebugFights, "fights", "Fights debugging");
+	DebugMan.addDebugChannel(kLureDebugSounds, "sounds", "Sounds debugging");
+	DebugMan.addDebugChannel(kLureDebugStrings, "strings", "Strings debugging");
 }
 
 Common::Error LureEngine::init() {
@@ -97,7 +97,7 @@
 
 LureEngine::~LureEngine() {
 	// Remove all of our debug levels here
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 
 	if (_initialised) {
 		// Delete and deinitialise subsystems

Modified: scummvm/trunk/engines/m4/m4.cpp
===================================================================
--- scummvm/trunk/engines/m4/m4.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/m4/m4.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -114,8 +114,8 @@
 	SearchMan.addSubDirectoryMatching(_gameDataDir, "goodstuf");
 	SearchMan.addSubDirectoryMatching(_gameDataDir, "resource");
 
-	Common::addDebugChannel(kDebugScript, "script", "Script debug level");
-	Common::addDebugChannel(kDebugConversations, "conversations", "Conversations debugging");
+	DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level");
+	DebugMan.addDebugChannel(kDebugConversations, "conversations", "Conversations debugging");
 
 	_resourceManager = NULL;
 	_globals = NULL;

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -37,16 +37,16 @@
 namespace Mohawk {
 
 MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) {
-	Common::addDebugChannel(kDebugVariable, "Variable", "Track Variable Accesses");
-	Common::addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function");
-	Common::addDebugChannel(kDebugView, "View", "Track Card File (VIEW) Parsing");
-	Common::addDebugChannel(kDebugHint, "Hint", "Track Cursor Hints (HINT) Parsing");
-	Common::addDebugChannel(kDebugResource, "Resource", "Track Resource (RLST) Parsing");
-	Common::addDebugChannel(kDebugINIT, "Init", "Track Card Init Script (INIT) Parsing");
-	Common::addDebugChannel(kDebugEXIT, "Exit", "Track Card Exit Script (EXIT) Parsing");
-	Common::addDebugChannel(kDebugScript, "Script", "Track Script Execution");
-	Common::addDebugChannel(kDebugHelp, "Help", "Track Help File (HELP) Parsing");
-	Common::addDebugChannel(kDebugCache, "Cache", "Track Resource Cache Accesses");
+	DebugMan.addDebugChannel(kDebugVariable, "Variable", "Track Variable Accesses");
+	DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function");
+	DebugMan.addDebugChannel(kDebugView, "View", "Track Card File (VIEW) Parsing");
+	DebugMan.addDebugChannel(kDebugHint, "Hint", "Track Cursor Hints (HINT) Parsing");
+	DebugMan.addDebugChannel(kDebugResource, "Resource", "Track Resource (RLST) Parsing");
+	DebugMan.addDebugChannel(kDebugINIT, "Init", "Track Card Init Script (INIT) Parsing");
+	DebugMan.addDebugChannel(kDebugEXIT, "Exit", "Track Card Exit Script (EXIT) Parsing");
+	DebugMan.addDebugChannel(kDebugScript, "Script", "Track Script Execution");
+	DebugMan.addDebugChannel(kDebugHelp, "Help", "Track Help File (HELP) Parsing");
+	DebugMan.addDebugChannel(kDebugCache, "Cache", "Track Resource Cache Accesses");
 
 	_zipMode = false;
 	_transitionsEnabled = false;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -60,16 +60,16 @@
 	Engine(syst), _gameDescription(gameDesc), _location(getGameType()) {
 
 	_vm = this;
-	Common::addDebugChannel(kDebugDialogue, "dialogue", "Dialogues debug level");
-	Common::addDebugChannel(kDebugParser, "parser", "Parser debug level");
-	Common::addDebugChannel(kDebugDisk, "disk", "Disk debug level");
-	Common::addDebugChannel(kDebugWalk, "walk", "Walk debug level");
-	Common::addDebugChannel(kDebugGraphics, "gfx", "Gfx debug level");
-	Common::addDebugChannel(kDebugExec, "exec", "Execution debug level");
-	Common::addDebugChannel(kDebugInput, "input", "Input debug level");
-	Common::addDebugChannel(kDebugAudio, "audio", "Audio debug level");
-	Common::addDebugChannel(kDebugMenu, "menu", "Menu debug level");
-	Common::addDebugChannel(kDebugInventory, "inventory", "Inventory debug level");
+	DebugMan.addDebugChannel(kDebugDialogue, "dialogue", "Dialogues debug level");
+	DebugMan.addDebugChannel(kDebugParser, "parser", "Parser debug level");
+	DebugMan.addDebugChannel(kDebugDisk, "disk", "Disk debug level");
+	DebugMan.addDebugChannel(kDebugWalk, "walk", "Walk debug level");
+	DebugMan.addDebugChannel(kDebugGraphics, "gfx", "Gfx debug level");
+	DebugMan.addDebugChannel(kDebugExec, "exec", "Execution debug level");
+	DebugMan.addDebugChannel(kDebugInput, "input", "Input debug level");
+	DebugMan.addDebugChannel(kDebugAudio, "audio", "Audio debug level");
+	DebugMan.addDebugChannel(kDebugMenu, "menu", "Menu debug level");
+	DebugMan.addDebugChannel(kDebugInventory, "inventory", "Inventory debug level");
 
 	g_eventRec.registerRandomSource(_rnd, "parallaction");
 }

Modified: scummvm/trunk/engines/sci/decompressor.cpp
===================================================================
--- scummvm/trunk/engines/sci/decompressor.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/sci/decompressor.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -870,7 +870,7 @@
 				for (uint32 i = 0; i < copy_length; i++)
 					putByte(dest[pos + i]);
 
-				if (Common::isDebugChannelEnabled(kDebugLevelDclInflate)) {
+				if (DebugMan.isDebugChannelEnabled(kDebugLevelDclInflate)) {
 					for (uint32 i = 0; i < copy_length; i++)
 						debugC(kDebugLevelDclInflate, "\33[32;31m%02x\33[37;37m ", dest[pos + i]);
 					debugC(kDebugLevelDclInflate, "\n");

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -1351,7 +1351,7 @@
 	// Sentinel
 	writePoint(arrayRef, offset, Common::Point(POLY_LAST_POINT, POLY_LAST_POINT));
 
-	if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) {
+	if (DebugMan.isDebugChannelEnabled(kDebugLevelAvoidPath)) {
 		debug("\nReturning path:");
 		for (int i = 0; i < offset; i++) {
 			Common::Point pt = read_point(s->_segMan, output, i);
@@ -1407,7 +1407,7 @@
 				opt = argv[6].toUint16();
 		}
 
-		if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) {
+		if (DebugMan.isDebugChannelEnabled(kDebugLevelAvoidPath)) {
 			debug("[avoidpath] Pathfinding input:");
 			draw_point(s, start, 1, width, height);
 			draw_point(s, end, 0, width, height);
@@ -1578,7 +1578,7 @@
 		int32 pDestX = inpBuf[curIndex].toSint16() & 0x1ff;
 		int32 pDestY = inpBuf[curIndex + 1].toSint16();
 
-		if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) {
+		if (DebugMan.isDebugChannelEnabled(kDebugLevelAvoidPath)) {
 			draw_line(s, Common::Point(pSourceX, pSourceY),
 				Common::Point(pDestX, pDestY), 2, 320, 190);
 			debugN(-1, " (%i, %i)[%i]", pDestX, pDestY, curIndex);
@@ -1657,7 +1657,7 @@
 
 		if (curIndex == doneIndex) {
 			// End of polyline/polygon reached
-			if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) {
+			if (DebugMan.isDebugChannelEnabled(kDebugLevelAvoidPath)) {
 				debug(";");
 				debugN(-1, "Found %i intersections", outCount);
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -1680,7 +1680,7 @@
 	EngineState *successor = NULL;
 	int game_is_finished = 0;
 
-	if (Common::isDebugChannelEnabled(kDebugLevelOnStartup))
+	if (DebugMan.isDebugChannelEnabled(kDebugLevelOnStartup))
 		g_sci->getSciDebugger()->attach();
 
 	do {

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -69,30 +69,30 @@
 	_features = 0;
 
 	// Set up the engine specific debug levels
-	Common::addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
-	Common::addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
-	Common::addDebugChannel(kDebugLevelGraphics, "Graphics", "Graphics debugging");
-	Common::addDebugChannel(kDebugLevelStrings, "Strings", "Strings debugging");
-	Common::addDebugChannel(kDebugLevelMemory, "Memory", "Memory debugging");
-	Common::addDebugChannel(kDebugLevelFuncCheck, "Func", "Function parameter debugging");
-	Common::addDebugChannel(kDebugLevelBresen, "Bresenham", "Bresenham algorithms debugging");
-	Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
-	Common::addDebugChannel(kDebugLevelGfxDriver, "Gfxdriver", "Gfx driver debugging");
-	Common::addDebugChannel(kDebugLevelBaseSetter, "Base", "Base Setter debugging");
-	Common::addDebugChannel(kDebugLevelParser, "Parser", "Parser debugging");
-	Common::addDebugChannel(kDebugLevelMenu, "Menu", "Menu handling debugging");
-	Common::addDebugChannel(kDebugLevelSaid, "Said", "Said specs debugging");
-	Common::addDebugChannel(kDebugLevelFile, "File", "File I/O debugging");
-	Common::addDebugChannel(kDebugLevelTime, "Time", "Time debugging");
-	Common::addDebugChannel(kDebugLevelRoom, "Room", "Room number debugging");
-	Common::addDebugChannel(kDebugLevelAvoidPath, "Pathfinding", "Pathfinding debugging");
-	Common::addDebugChannel(kDebugLevelDclInflate, "DCL", "DCL inflate debugging");
-	Common::addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
-	Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
-	Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
-	Common::addDebugChannel(kDebugLevelSci0Pic, "Sci0Pic", "SCI0 pic drawing debugging");
-	Common::addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
-	Common::addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
+	DebugMan.addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
+	DebugMan.addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
+	DebugMan.addDebugChannel(kDebugLevelGraphics, "Graphics", "Graphics debugging");
+	DebugMan.addDebugChannel(kDebugLevelStrings, "Strings", "Strings debugging");
+	DebugMan.addDebugChannel(kDebugLevelMemory, "Memory", "Memory debugging");
+	DebugMan.addDebugChannel(kDebugLevelFuncCheck, "Func", "Function parameter debugging");
+	DebugMan.addDebugChannel(kDebugLevelBresen, "Bresenham", "Bresenham algorithms debugging");
+	DebugMan.addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
+	DebugMan.addDebugChannel(kDebugLevelGfxDriver, "Gfxdriver", "Gfx driver debugging");
+	DebugMan.addDebugChannel(kDebugLevelBaseSetter, "Base", "Base Setter debugging");
+	DebugMan.addDebugChannel(kDebugLevelParser, "Parser", "Parser debugging");
+	DebugMan.addDebugChannel(kDebugLevelMenu, "Menu", "Menu handling debugging");
+	DebugMan.addDebugChannel(kDebugLevelSaid, "Said", "Said specs debugging");
+	DebugMan.addDebugChannel(kDebugLevelFile, "File", "File I/O debugging");
+	DebugMan.addDebugChannel(kDebugLevelTime, "Time", "Time debugging");
+	DebugMan.addDebugChannel(kDebugLevelRoom, "Room", "Room number debugging");
+	DebugMan.addDebugChannel(kDebugLevelAvoidPath, "Pathfinding", "Pathfinding debugging");
+	DebugMan.addDebugChannel(kDebugLevelDclInflate, "DCL", "DCL inflate debugging");
+	DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
+	DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
+	DebugMan.addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
+	DebugMan.addDebugChannel(kDebugLevelSci0Pic, "Sci0Pic", "SCI0 pic drawing debugging");
+	DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
+	DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
 
 	_gamestate = 0;
 
@@ -112,7 +112,7 @@
 
 SciEngine::~SciEngine() {
 	// Remove all of our debug levels here
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 
 	delete _audio;
 	delete _kernel;

Modified: scummvm/trunk/engines/scumm/debugger.cpp
===================================================================
--- scummvm/trunk/engines/scumm/debugger.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/scumm/debugger.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -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::isDebugChannelEnabled(channel) && (gDebugLevel < 9))
+	if (!DebugMan.isDebugChannelEnabled(channel) && (gDebugLevel < 9))
 		return;
 
 	va_start(va, s);
@@ -505,12 +505,12 @@
 }
 
 bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
-	const Common::DebugChannelList &lvls = Common::listDebugChannels();
+	const Common::DebugManager::DebugChannelList &lvls = DebugMan.listDebugChannels();
 
 	// No parameters given: Print out a list of all channels and their status
 	if (argc <= 1) {
 		DebugPrintf("Available debug channels:\n");
-		for (Common::DebugChannelList::const_iterator i = lvls.begin(); i != lvls.end(); ++i) {
+		for (Common::DebugManager::DebugChannelList::const_iterator i = lvls.begin(); i != lvls.end(); ++i) {
 			DebugPrintf("%c%s - %s (%s)\n", i->enabled ? '+' : ' ',
 					i->name.c_str(), i->description.c_str(),
 					i->enabled ? "enabled" : "disabled");
@@ -521,9 +521,9 @@
 	// Enable or disable channel?
 	bool result = false;
 	if (argv[1][0] == '+') {
-		result = Common::enableDebugChannel(argv[1] + 1);
+		result = DebugMan.enableDebugChannel(argv[1] + 1);
 	} else if (argv[1][0] == '-') {
-		result = Common::disableDebugChannel(argv[1] + 1);
+		result = DebugMan.disableDebugChannel(argv[1] + 1);
 	}
 
 	if (result) {

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -547,14 +547,14 @@
 
 	// Add debug levels
 	for (int i = 0; i < ARRAYSIZE(debugChannels); ++i)
-		Common::addDebugChannel(debugChannels[i].flag,  debugChannels[i].channel, debugChannels[i].desc);
+		DebugMan.addDebugChannel(debugChannels[i].flag,  debugChannels[i].channel, debugChannels[i].desc);
 
 	g_eventRec.registerRandomSource(_rnd, "scumm");
 }
 
 
 ScummEngine::~ScummEngine() {
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 
 	delete _musicEngine;
 

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -823,10 +823,10 @@
 	_config = new Config(this);
 
 	// Register debug flags
-	Common::addDebugChannel(kTinselDebugAnimations, "animations", "Animations debugging");
-	Common::addDebugChannel(kTinselDebugActions, "actions", "Actions debugging");
-	Common::addDebugChannel(kTinselDebugSound, "sound", "Sound debugging");
-	Common::addDebugChannel(kTinselDebugMusic, "music", "Music debugging");
+	DebugMan.addDebugChannel(kTinselDebugAnimations, "animations", "Animations debugging");
+	DebugMan.addDebugChannel(kTinselDebugActions, "actions", "Actions debugging");
+	DebugMan.addDebugChannel(kTinselDebugSound, "sound", "Sound debugging");
+	DebugMan.addDebugChannel(kTinselDebugMusic, "music", "Music debugging");
 
 	// Setup mixer
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/engines/touche/touche.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -68,17 +68,17 @@
 	_menuRedrawCounter = 0;
 	memset(_paletteBuffer, 0, sizeof(_paletteBuffer));
 
-	Common::addDebugChannel(kDebugEngine,   "Engine",   "Engine debug level");
-	Common::addDebugChannel(kDebugGraphics, "Graphics", "Graphics debug level");
-	Common::addDebugChannel(kDebugResource, "Resource", "Resource debug level");
-	Common::addDebugChannel(kDebugOpcodes,  "Opcodes",  "Opcodes debug level");
-	Common::addDebugChannel(kDebugMenu,     "Menu",     "Menu debug level");
+	DebugMan.addDebugChannel(kDebugEngine,   "Engine",   "Engine debug level");
+	DebugMan.addDebugChannel(kDebugGraphics, "Graphics", "Graphics debug level");
+	DebugMan.addDebugChannel(kDebugResource, "Resource", "Resource debug level");
+	DebugMan.addDebugChannel(kDebugOpcodes,  "Opcodes",  "Opcodes debug level");
+	DebugMan.addDebugChannel(kDebugMenu,     "Menu",     "Menu debug level");
 
 	g_eventRec.registerRandomSource(_rnd, "touche");
 }
 
 ToucheEngine::~ToucheEngine() {
-	Common::clearAllDebugChannels();
+	DebugMan.clearAllDebugChannels();
 	delete _midiPlayer;
 }
 

Modified: scummvm/trunk/gui/debugger.cpp
===================================================================
--- scummvm/trunk/gui/debugger.cpp	2010-04-27 21:39:43 UTC (rev 48820)
+++ scummvm/trunk/gui/debugger.cpp	2010-04-27 21:40:52 UTC (rev 48821)
@@ -471,7 +471,7 @@
 }
 
 bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) {
-	const Common::DebugChannelList &debugLevels = Common::listDebugChannels();
+	const Common::DebugManager::DebugChannelList &debugLevels = DebugMan.listDebugChannels();
 
 	DebugPrintf("Engine debug levels:\n");
 	DebugPrintf("--------------------\n");
@@ -479,7 +479,7 @@
 		DebugPrintf("No engine debug levels\n");
 		return true;
 	}
-	for (Common::DebugChannelList::const_iterator i = debugLevels.begin(); i != debugLevels.end(); ++i) {
+	for (Common::DebugManager::DebugChannelList::const_iterator i = debugLevels.begin(); i != debugLevels.end(); ++i) {
 		DebugPrintf("%c%s - %s (%s)\n", i->enabled ? '+' : ' ',
 				i->name.c_str(), i->description.c_str(),
 				i->enabled ? "enabled" : "disabled");
@@ -492,7 +492,7 @@
 	if (argc < 2) {
 		DebugPrintf("debugflag_enable <flag>\n");
 	} else {
-		if (Common::enableDebugChannel(argv[1])) {
+		if (DebugMan.enableDebugChannel(argv[1])) {
 			DebugPrintf("Enabled debug flag '%s'\n", argv[1]);
 		} else {
 			DebugPrintf("Failed to enable debug flag '%s'\n", argv[1]);
@@ -505,7 +505,7 @@
 	if (argc < 2) {
 		DebugPrintf("debugflag_disable <flag>\n");
 	} else {
-		if (Common::disableDebugChannel(argv[1])) {
+		if (DebugMan.disableDebugChannel(argv[1])) {
 			DebugPrintf("Disabled debug flag '%s'\n", argv[1]);
 		} else {
 			DebugPrintf("Failed to disable debug flag '%s'\n", argv[1]);


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