diff options
-rw-r--r-- | base/main.cpp | 4 | ||||
-rw-r--r-- | common/debug.cpp | 31 | ||||
-rw-r--r-- | common/debug.h | 20 | ||||
-rw-r--r-- | engines/agi/agi.cpp | 20 | ||||
-rw-r--r-- | engines/agi/preagi.cpp | 20 | ||||
-rw-r--r-- | engines/cine/cine.cpp | 8 | ||||
-rw-r--r-- | engines/cruise/cruise.cpp | 4 | ||||
-rw-r--r-- | engines/draci/draci.cpp | 16 | ||||
-rw-r--r-- | engines/gob/gob.cpp | 24 | ||||
-rw-r--r-- | engines/groovie/debug.cpp | 2 | ||||
-rw-r--r-- | engines/groovie/groovie.cpp | 22 | ||||
-rw-r--r-- | engines/groovie/script.cpp | 8 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/kyra_lok.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 22 | ||||
-rw-r--r-- | engines/lure/lure.cpp | 14 | ||||
-rw-r--r-- | engines/m4/m4.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst.cpp | 20 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 20 | ||||
-rw-r--r-- | engines/sci/decompressor.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 50 | ||||
-rw-r--r-- | engines/scumm/debugger.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | engines/tinsel/tinsel.cpp | 8 | ||||
-rw-r--r-- | engines/touche/touche.cpp | 12 | ||||
-rw-r--r-- | gui/debugger.cpp | 8 |
28 files changed, 194 insertions, 179 deletions
diff --git a/base/main.cpp b/base/main.cpp index fb456f38a2..b78f1be154 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -198,7 +198,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const 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 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const system.engineDone(); // We clear all debug levels again even though the engine should do it - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); // Free up memory delete engine; diff --git a/common/debug.cpp b/common/debug.cpp index 86371f4091..30f4534f56 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -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 @@ bool addDebugChannel(uint32 channel, const String &name, const String &descripti 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 enableDebugChannel(const String &name) { } } -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 @@ bool disableDebugChannel(const String &name) { } -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 @@ DebugChannelList listDebugChannels() { 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 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) { // 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 @@ void debugCN(int level, uint32 debugChannels, const char *s, ...) { // 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 @@ void debugC(uint32 debugChannels, const char *s, ...) { // 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 @@ void debugCN(uint32 debugChannels, const char *s, ...) { // 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); diff --git a/common/debug.h b/common/debug.h index d1c89ebd9c..ffb674e40d 100644 --- a/common/debug.h +++ b/common/debug.h @@ -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 @@ DebugChannelList listDebugChannels(); 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. */ diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index c7b45871b7..2a67b5a16f 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -515,16 +515,16 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas _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)); diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index d455bc9dc4..76fe901705 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -46,16 +46,16 @@ PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : _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)); diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 0d684ba715..ee4bccf3fb 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -51,9 +51,9 @@ Common::SaveFileManager *g_saveFileMan; 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 @@ CineEngine::~CineEngine() { if (g_cine->getGameType() == Cine::GType_OS) { freeErrmessDat(); } - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); } Common::Error CineEngine::run() { diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 569f5bbf02..0f6421ff3c 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -53,8 +53,8 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc _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, diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 882b845f08..40659589b6 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -82,13 +82,13 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) //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 @@ DraciEngine::~DraciEngine() { delete _dubbingArchive; // Remove all of our debug levels here - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); } Common::Error DraciEngine::run() { diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 024728a1d1..ca6266e321 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -130,18 +130,18 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) { _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"); } diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 00eb5c994c..2a4eaf4894 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -46,7 +46,7 @@ Debugger::Debugger(GroovieEngine *vm) : } Debugger::~Debugger() { - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); } int Debugger::getNumber(const char *arg) { diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 5b42df143a..35aa4721e7 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -46,17 +46,17 @@ GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : 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() { diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index ea211a62f2..2ff14f2706 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -45,8 +45,8 @@ static void debugScript(int level, bool nl, const char *s, ...) { 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 Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { 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); diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 75c42ef174..a8aba47ec6 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -54,8 +54,8 @@ void VDXPlayer::setOrigin(int16 x, int16 y) { } 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 @@ bool VDXPlayer::playFrameInternal() { // 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 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { 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); } } diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index 7cfa7bd29e..4f2246d264 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -111,7 +111,7 @@ KyraEngine_LoK::~KyraEngine_LoK() { _emc->unload(&_scriptClickData); } - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); delete _screen; delete _sprites; diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 4c87ff4173..e43c4381b8 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -73,17 +73,17 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) _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"); } diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index 7ab9a0be60..f74f5f818a 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -42,12 +42,12 @@ static LureEngine *int_engine = NULL; 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 @@ Common::Error LureEngine::init() { LureEngine::~LureEngine() { // Remove all of our debug levels here - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); if (_initialised) { // Delete and deinitialise subsystems diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 0e6dd48e17..4411a808ca 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -114,8 +114,8 @@ MadsM4Engine::MadsM4Engine(OSystem *syst, const M4GameDescription *gameDesc) : 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; diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index f935e576b7..849440774b 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -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; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index edfd14e6c7..885c01fccc 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -60,16 +60,16 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam 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"); } diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index 3d978eb94b..6ceb4c4f54 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -870,7 +870,7 @@ int DecompressorDCL::unpackDCL(byte* dest) { 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"); diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index e2c9ef2444..9746bbada1 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1351,7 +1351,7 @@ static reg_t output_path(PathfindingState *p, EngineState *s) { // 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 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) { 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 @@ reg_t kIntersections(EngineState *s, int argc, reg_t *argv) { 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 @@ reg_t kIntersections(EngineState *s, int argc, reg_t *argv) { if (curIndex == doneIndex) { // End of polyline/polygon reached - if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) { + if (DebugMan.isDebugChannelEnabled(kDebugLevelAvoidPath)) { debug(";"); debugN(-1, "Found %i intersections", outCount); diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 6934a6f481..d32b2babc5 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1680,7 +1680,7 @@ static EngineState *_game_run(EngineState *&s) { EngineState *successor = NULL; int game_is_finished = 0; - if (Common::isDebugChannelEnabled(kDebugLevelOnStartup)) + if (DebugMan.isDebugChannelEnabled(kDebugLevelOnStartup)) g_sci->getSciDebugger()->attach(); do { diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 28bc003478..87f156bc67 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -69,30 +69,30 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc) _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(OSystem *syst, const ADGameDescription *desc) SciEngine::~SciEngine() { // Remove all of our debug levels here - Common::clearAllDebugChannels(); + DebugMan.clearAllDebugChannels(); delete _audio; delete _kernel; diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 0adc05d662..035f97350f 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -47,7 +47,7 @@ void debugC(int channel, const char *s, ...) { // 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_Object(int argc, const char **argv) { } 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 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) { // 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) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 5555d961b2..d858b6c1e5 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -547,14 +547,14 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) // 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; diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index f3e52c929d..559c2ee3eb 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -823,10 +823,10 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) _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")); diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 3289afe00f..185ad34753 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -68,17 +68,17 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) _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; } diff --git a/gui/debugger.cpp b/gui/debugger.cpp index fa1c12f28e..24c908716f 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -471,7 +471,7 @@ bool Debugger::Cmd_Help(int argc, const char **argv) { } 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 @@ bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) { 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 @@ bool Debugger::Cmd_DebugFlagEnable(int argc, const char **argv) { 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 @@ bool Debugger::Cmd_DebugFlagDisable(int argc, const char **argv) { 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]); |