aboutsummaryrefslogtreecommitdiff
path: root/common/debug.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-19 09:38:25 +0200
committerEugene Sandulenko2016-08-19 09:55:22 +0200
commit0ab903a9e2416f329439d094bc6b6864a3454e37 (patch)
treeb68cad1e8c1c97cab404465b6a5fda22b12b8459 /common/debug.cpp
parent2074fad2cf48e901d3cacccad200d13e88487f82 (diff)
downloadscummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.tar.gz
scummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.tar.bz2
scummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.zip
COMMON: Added checkers for debug channels.
Sometimes there is a need to add debug execution and enable it from the command line. Now it is possible, both with debug levels and channels
Diffstat (limited to 'common/debug.cpp')
-rw-r--r--common/debug.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/debug.cpp b/common/debug.cpp
index ce34a00445..c61fc63dea 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -120,6 +120,18 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel) {
} // End of namespace Common
+bool debugLevelSet(int level) {
+ return level <= gDebugLevel;
+}
+
+bool debugChannelSet(int level, uint32 debugChannels) {
+ if (gDebugLevel != 11)
+ if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels)))
+ return false;
+
+ return true;
+}
+
#ifndef DISABLE_TEXT_CONSOLE