[Scummvm-cvs-logs] SF.net SVN: scummvm:[39054] scummvm/trunk/common
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Mar 1 22:47:57 CET 2009
Revision: 39054
http://scummvm.svn.sourceforge.net/scummvm/?rev=39054&view=rev
Author: fingolfin
Date: 2009-03-01 21:47:57 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
COMMON: added a debugC variant which only takes a debug channel mask
Modified Paths:
--------------
scummvm/trunk/common/debug.cpp
scummvm/trunk/common/debug.h
Modified: scummvm/trunk/common/debug.cpp
===================================================================
--- scummvm/trunk/common/debug.cpp 2009-03-01 21:23:44 UTC (rev 39053)
+++ scummvm/trunk/common/debug.cpp 2009-03-01 21:47:57 UTC (rev 39054)
@@ -214,12 +214,12 @@
va_end(va);
}
-void debugC(int level, uint32 engine_level, const char *s, ...) {
+void debugC(int level, uint32 debugChannels, const char *s, ...) {
va_list va;
// FIXME: Seems gDebugLevel 11 has a special meaning? Document that!
if (gDebugLevel != 11)
- if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & engine_level))
+ if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & debugChannels))
return;
va_start(va, s);
@@ -227,4 +227,17 @@
va_end(va);
}
+void debugC(uint32 debugChannels, const char *s, ...) {
+ va_list va;
+
+ // FIXME: Seems gDebugLevel 11 has a special meaning? Document that!
+ if (gDebugLevel != 11)
+ if (!(Common::gDebugLevelsEnabled & debugChannels))
+ return;
+
+ va_start(va, s);
+ debugHelper(s, va);
+ va_end(va);
+}
+
#endif
Modified: scummvm/trunk/common/debug.h
===================================================================
--- scummvm/trunk/common/debug.h 2009-03-01 21:23:44 UTC (rev 39053)
+++ scummvm/trunk/common/debug.h 2009-03-01 21:47:57 UTC (rev 39054)
@@ -105,6 +105,7 @@
inline void debug(int level, const char *s, ...) {}
inline void debugN(int level, const char *s, ...) {}
inline void debugC(int level, uint32 engine_level, const char *s, ...) {}
+inline void debugC(uint32 engine_level, const char *s, ...) {}
#else
@@ -141,9 +142,18 @@
*
* @see enableDebugChannel
*/
-void debugC(int level, uint32 engine_level, const char *s, ...) GCC_PRINTF(3, 4);
+void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4);
+/**
+ * Print a debug message to the text console (stderr), but only if
+ * the specified special debug level is active.
+ * Automatically appends a newline.
+ *
+ * @see enableDebugChannel
+ */
+void debugC(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
+
#endif
/**
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