diff options
author | Paul Gilbert | 2019-11-02 19:33:00 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-11-11 18:20:29 -0800 |
commit | d51d3d40861446f849564bb6af07ab35cb2c3e77 (patch) | |
tree | 1a2400e0ff136186f6179268a6f13afc03ce6426 /common | |
parent | 3165d52a7b586a7b1442ba8ae7e3167d852d220f (diff) | |
download | scummvm-rg350-d51d3d40861446f849564bb6af07ab35cb2c3e77.tar.gz scummvm-rg350-d51d3d40861446f849564bb6af07ab35cb2c3e77.tar.bz2 scummvm-rg350-d51d3d40861446f849564bb6af07ab35cb2c3e77.zip |
COMMON: Allow for enabling/disabling debug channels by number
Diffstat (limited to 'common')
-rw-r--r-- | common/debug-channels.h | 20 | ||||
-rw-r--r-- | common/debug.cpp | 10 |
2 files changed, 28 insertions, 2 deletions
diff --git a/common/debug-channels.h b/common/debug-channels.h index 0fb8006803..a2df35102f 100644 --- a/common/debug-channels.h +++ b/common/debug-channels.h @@ -80,7 +80,7 @@ public: void clearAllDebugChannels(); /** - * Enables an debug channel. + * Enables a debug channel. * * @param name the name of the debug channel to enable * @return true on success, false on failure @@ -88,13 +88,29 @@ public: bool enableDebugChannel(const String &name); /** - * Disables an debug channel. + * Enables a debug channel. + * + * @param channel The debug channel + * @return true on success, false on failure + */ + bool enableDebugChannel(uint32 channel); + + /** + * Disables a debug channel. * * @param name the name of the debug channel to disable * @return true on success, false on failure */ bool disableDebugChannel(const String &name); + /** + * Disables a debug channel. + * + * @param channel The debug channel + * @return true on success, false on failure + */ + bool disableDebugChannel(uint32 channel); + typedef List<DebugChannel> DebugChannelList; /** diff --git a/common/debug.cpp b/common/debug.cpp index 5db8990db8..568d2d52cb 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -78,6 +78,11 @@ bool DebugManager::enableDebugChannel(const String &name) { } } +bool DebugManager::enableDebugChannel(uint32 channel) { + gDebugChannelsEnabled |= channel; + return true; +} + bool DebugManager::disableDebugChannel(const String &name) { DebugChannelMap::iterator i = gDebugChannels.find(name); @@ -91,6 +96,11 @@ bool DebugManager::disableDebugChannel(const String &name) { } } +bool DebugManager::disableDebugChannel(uint32 channel) { + gDebugChannelsEnabled &= ~channel; + return true; +} + DebugManager::DebugChannelList DebugManager::listDebugChannels() { DebugChannelList tmp; for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i) |