[Scummvm-cvs-logs] scummvm master -> 0fdab36710a3d74839c09bbaf48cbc502b898ebd
sev-
sev at scummvm.org
Sat Aug 13 21:08:10 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e58545362f FULLPIPE: Put behavior debug output to a separate channel
0fdab36710 COMMON: Introduce --debug-channels-only command line flag.
Commit: e58545362f7829ade95f7bdb5e323c3e203c9bec
https://github.com/scummvm/scummvm/commit/e58545362f7829ade95f7bdb5e323c3e203c9bec
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-13T21:07:43+02:00
Commit Message:
FULLPIPE: Put behavior debug output to a separate channel
Changed paths:
engines/fullpipe/behavior.cpp
engines/fullpipe/fullpipe.cpp
engines/fullpipe/fullpipe.h
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index 75b1c78..faef167 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -83,7 +83,7 @@ void BehaviorManager::updateBehaviors() {
if (!_isActive)
return;
- debugC(4, kDebugAnimation, "BehaviorManager::updateBehaviors()");
+ debugC(4, kDebugBehavior, "BehaviorManager::updateBehaviors()");
for (uint i = 0; i < _behaviors.size(); i++) {
BehaviorInfo *beh = _behaviors[i];
@@ -122,7 +122,7 @@ void BehaviorManager::updateBehaviors() {
}
void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *entry) {
- debugC(4, kDebugAnimation, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
+ debugC(4, kDebugBehavior, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
for (int i = 0; i < entry->_movesCount; i++) {
BehaviorMove *bhi = entry->_behaviorMoves[i];
if (!(bhi->_flags & 1)) {
@@ -144,7 +144,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *e
}
void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *bhe) {
- debugC(4, kDebugAnimation, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
+ debugC(4, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
MessageQueue *mq = 0;
@@ -236,7 +236,7 @@ void BehaviorInfo::clear() {
}
void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
- debugC(4, kDebugAnimation, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
+ debugC(4, kDebugBehavior, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
clear();
_animsCount = 1;
@@ -260,7 +260,7 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
}
void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) {
- debugC(4, kDebugAnimation, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
+ debugC(4, kDebugBehavior, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
clear();
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 5f06d8a..164c599 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -52,6 +52,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
DebugMan.addDebugChannel(kDebugDrawing, "drawing", "Drawing");
DebugMan.addDebugChannel(kDebugLoading, "loading", "Scene loading");
DebugMan.addDebugChannel(kDebugAnimation, "animation", "Animation");
+ DebugMan.addDebugChannel(kDebugBehavior, "behavior", "Behavior");
DebugMan.addDebugChannel(kDebugMemory, "memory", "Memory management");
DebugMan.addDebugChannel(kDebugEvents, "events", "Event handling");
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 1c85536..eb387bb 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -49,12 +49,13 @@ enum FullpipeGameFeatures {
};
enum AccessDebugChannels {
- kDebugPathfinding = 1 << 0,
- kDebugDrawing = 1 << 1,
- kDebugLoading = 1 << 2,
- kDebugAnimation = 1 << 3,
- kDebugMemory = 1 << 4,
- kDebugEvents = 1 << 5
+ kDebugPathfinding = 1 << 0,
+ kDebugDrawing = 1 << 1,
+ kDebugLoading = 1 << 2,
+ kDebugAnimation = 1 << 3,
+ kDebugMemory = 1 << 4,
+ kDebugEvents = 1 << 5,
+ kDebugBehavior = 1 << 6
};
class BehaviorManager;
Commit: 0fdab36710a3d74839c09bbaf48cbc502b898ebd
https://github.com/scummvm/scummvm/commit/0fdab36710a3d74839c09bbaf48cbc502b898ebd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-13T21:07:43+02:00
Commit Message:
COMMON: Introduce --debug-channels-only command line flag.
Many of our systems currently generate significant amount of debug
output on deeper levels. Now, when your engine is using Debug Channels,
you might want to show that debug information only, which is currently
not possible, as the generic output will be mixed in your output.
Alternative solution would be to implement possibility to specify
per-channel debug levels.
Changed paths:
base/commandLine.cpp
base/main.cpp
common/debug.cpp
common/debug.h
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 2c24c01..c2b4ea7 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -97,6 +97,7 @@ static const char HELP_STRING[] =
" -d, --debuglevel=NUM Set debug verbosity level\n"
" --debugflags=FLAGS Enable engine specific debug flags\n"
" (separated by commas)\n"
+ " --debug-channels-only Show only the specified debug channels\n"
" -u, --dump-scripts Enable script dumping if a directory called 'dumps'\n"
" exists in the current directory\n"
"\n"
@@ -426,6 +427,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
DO_LONG_OPTION("debugflags")
END_OPTION
+ DO_LONG_OPTION_BOOL("debug-channels-only")
+ END_OPTION
+
DO_OPTION('e', "music-driver")
END_OPTION
diff --git a/base/main.cpp b/base/main.cpp
index 349f719..1667106 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -391,6 +391,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
} else if (ConfMan.hasKey("debugflags"))
specialDebug = ConfMan.get("debugflags");
+ if (settings.contains("debug-channels-only"))
+ gDebugChannelsOnly = true;
+
+
PluginManager::instance().init();
PluginManager::instance().loadAllPlugins(); // load plugins for cached plugin manager
diff --git a/common/debug.cpp b/common/debug.cpp
index 182b28a..ce34a00 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -30,6 +30,7 @@
// TODO: Move gDebugLevel into namespace Common.
int gDebugLevel = -1;
+bool gDebugChannelsOnly = false;
namespace Common {
@@ -137,6 +138,9 @@ static void debugHelper(const char *s, va_list va, bool caret = true) {
void debug(const char *s, ...) {
va_list va;
+ if (gDebugChannelsOnly)
+ return;
+
va_start(va, s);
debugHelper(s, va);
va_end(va);
@@ -145,7 +149,7 @@ void debug(const char *s, ...) {
void debug(int level, const char *s, ...) {
va_list va;
- if (level > gDebugLevel)
+ if (level > gDebugLevel || gDebugChannelsOnly)
return;
va_start(va, s);
@@ -157,6 +161,9 @@ void debug(int level, const char *s, ...) {
void debugN(const char *s, ...) {
va_list va;
+ if (gDebugChannelsOnly)
+ return;
+
va_start(va, s);
debugHelper(s, va, false);
va_end(va);
@@ -165,7 +172,7 @@ void debugN(const char *s, ...) {
void debugN(int level, const char *s, ...) {
va_list va;
- if (level > gDebugLevel)
+ if (level > gDebugLevel || gDebugChannelsOnly)
return;
va_start(va, s);
diff --git a/common/debug.h b/common/debug.h
index b6e0679..00bad81 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -118,6 +118,15 @@ void debugCN(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
*/
extern int gDebugLevel;
+/**
+ * Specify if we want to show only the debug channels and suppress
+ * the non-channeled output.
+ *
+ * This option is useful when you want to have higher levels of channels
+ * visible without the noise from other subsystems or OSystem.
+ */
+extern bool gDebugChannelsOnly;
+
//Global constant for EventRecorder debug channel
enum GlobalDebugLevels {
kDebugLevelEventRec = 1 << 30
More information about the Scummvm-git-logs
mailing list