/*! * Dump node and all descendants recursively. * * \param node The top-level node to be dumped. * \param level current recursion depth * * \ingroup node */ void lib3ds_node_dump(Lib3dsNode *node, Lib3dsIntd level) { Lib3dsNode *p; char l[128]; ASSERT(node); memset(l, ' ', 2*level); l[2*level]=0; if (node->type==LIB3DS_OBJECT_NODE) { printf("%s%s [%s] (%s)\n", l, node->name, node->data.object.instance, node_names_table[node->type] ); } else { printf("%s%s (%s)\n", l, node->name, node_names_table[node->type] ); } for (p=node->childs; p!=0; p=p->next) { lib3ds_node_dump(p, level+1); } }
/*! * \ingroup file */ void lib3ds_file_dump_nodes(Lib3dsFile *file) { Lib3dsNode *p; ASSERT(file); for (p=file->nodes; p!=0; p=p->next) { lib3ds_node_dump(p,1); } }