| 392 | } |
| 393 | |
| 394 | static void _dump_scene(wf::scene::node_ptr root, int depth = 0) |
| 395 | { |
| 396 | using namespace wf::scene; |
| 397 | |
| 398 | // root |
| 399 | // |-child |
| 400 | // | |-nested |
| 401 | // | | |-nested2 |
| 402 | // |
| 403 | std::ostringstream node_line; |
| 404 | for (int i = 0; i < depth; i++) |
| 405 | { |
| 406 | node_line << "|"; |
| 407 | if (i < depth - 1) |
| 408 | { |
| 409 | node_line << " "; |
| 410 | } else |
| 411 | { |
| 412 | node_line << "-"; |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | node_line << root->stringify(); |
| 417 | node_line << " [" + fmt_pointer(root.get()) + "]"; |
| 418 | node_line << " geometry=" << root->get_bounding_box(); |
| 419 | |
| 420 | const int greyed_flags = (int)node_flags::DISABLED; |
| 421 | if (root->flags() & greyed_flags) |
| 422 | { |
| 423 | color_debug_log(GREY_COLOR, node_line.str()); |
| 424 | } else |
| 425 | { |
| 426 | color_debug_log(CLEAR_COLOR, node_line.str()); |
| 427 | } |
| 428 | |
| 429 | for (auto& ch : root->get_children()) |
| 430 | { |
| 431 | _dump_scene(ch, depth + 1); |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | void wf::dump_scene(scene::node_ptr root) |
| 436 | { |
no test coverage detected