From: Holger Schemel Date: Sat, 30 Jan 2021 10:01:28 +0000 (+0100) Subject: improved debug output for level or artwork tree info dump X-Git-Tag: 4.2.3.0~39 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=36d5cb36c6f4cc188aecd157b48ff064be69afb6;p=rocksndiamonds.git improved debug output for level or artwork tree info dump --- diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 478f214f..5a1b6c7d 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1388,16 +1388,23 @@ static boolean adjustTreeSoundsForEMC(TreeInfo *node) void dumpTreeInfo(TreeInfo *node, int depth) { + char bullet_list[] = { '-', '*', 'o' }; int i; - Debug("tree", "Dumping TreeInfo:"); + if (depth == 0) + Debug("tree", "Dumping TreeInfo:"); while (node) { - for (i = 0; i < (depth + 1) * 3; i++) + char bullet = bullet_list[depth % ARRAY_SIZE(bullet_list)]; + + for (i = 0; i < depth * 2; i++) DebugContinued("", " "); - DebugContinued("tree", "'%s' / '%s'\n", node->identifier, node->name); + DebugContinued("tree", "%c '%s' ['%s] [PARENT: '%s'] %s\n", + bullet, node->name, node->identifier, + (node->node_parent ? node->node_parent->identifier : "-"), + (node->node_group ? "[GROUP]" : "")); /* // use for dumping artwork info tree