added dumpNodeTree() for debugging
This commit is contained in:
parent
6715b06b44
commit
c218c8956f
@ -15,10 +15,29 @@ using namespace std;
|
||||
|
||||
typedef vector< refptr<Node> >::const_iterator Node_Iterator;
|
||||
|
||||
#ifdef NODE_TREE_DEBUG
|
||||
static void dumpNodeTree(refptr<Node> 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> scope = new Scope();
|
||||
refptr<Node> node = parse(filename, scope);
|
||||
#ifdef NODE_TREE_DEBUG
|
||||
dumpNodeTree(node);
|
||||
#endif
|
||||
if ( ! node.isNull() )
|
||||
{
|
||||
/* evaluate any scripting nodes in the node tree */
|
||||
|
Loading…
x
Reference in New Issue
Block a user