diff --git a/main/Scene-load.cc b/main/Scene-load.cc index f492270..16f4a27 100644 --- a/main/Scene-load.cc +++ b/main/Scene-load.cc @@ -15,10 +15,29 @@ using namespace std; typedef vector< refptr >::const_iterator Node_Iterator; +#ifdef NODE_TREE_DEBUG +static void dumpNodeTree(refptr node) +{ + static int depth = 0; + for (int i = 0; i < depth; i++) + cerr << ' '; + cerr << typeid(*node).name() << endl; + depth++; + for (Node_Iterator it = node->getChildren().begin(); it != node->getChildren().end(); it++) + { + dumpNodeTree(*it); + } + depth--; +} +#endif + void Scene::load(const char * filename) { refptr scope = new Scope(); refptr node = parse(filename, scope); +#ifdef NODE_TREE_DEBUG + dumpNodeTree(node); +#endif if ( ! node.isNull() ) { /* evaluate any scripting nodes in the node tree */