# HG changeset patch # User Taiki TAIRA # Date 1322750458 -32400 # Node ID 6fc9fd03a4fd606fe5426ca5e61ef2664182ac83 # Parent fe598e9b7f0e34d751f0b45d614ca64d70ef46a0 can read collada file of float_array. diff -r fe598e9b7f0e -r 6fc9fd03a4fd Renderer/Engine/SceneGraphRoot.cc --- a/Renderer/Engine/SceneGraphRoot.cc Fri Nov 25 18:43:21 2011 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Thu Dec 01 23:40:58 2011 +0900 @@ -1,4 +1,4 @@ -#include + #include #include #include "SceneGraphRoot.h" @@ -241,7 +241,7 @@ xmlFreeDoc(doc); } -static const char* +/*static const char* get_property(const char *name, xmlNodePtr cur){ xmlAttr *p=cur->properties; if (p==0) return ""; @@ -255,20 +255,28 @@ } } return ""; -} +}*/ static void xml_walk( SceneGraphRoot* self, xmlNodePtr cur) { + /*get float array.*/ printf("name = %s\n", cur->name); - if(xmlStrcmp(cur->name,(xmlChar*)"float_array") != 0){ - const char *id = get_property("id", cur); - int count = atoi(get_property("count", cur)); - printf("id:%s count:%d\n", id, count); + if (!xmlStrcmp(cur->name, (xmlChar*)"float_array")) { + + char *cont =(char*)xmlNodeGetContent(cur); + //const char *id = get_property("id", cur); + + char *id = (char*)xmlGetProp(cur, (xmlChar*)"id"); + //int count = atoi(get_property("count", cur)); + + int count = atoi((char*)xmlGetProp(cur, (xmlChar*)"count")); + + printf("id:%s count:%d cont:%s\n", id, count, cont); } for (cur=cur->children; cur; cur=cur->next){ - xml_walk(self, cur); + xml_walk(self, cur); } } @@ -277,8 +285,9 @@ { /*make parse dom*/ xmlDocPtr doc; - xmlNodePtr cur,cur_images,cur_effects,cur_geometries,cur_visual_scenes; - SceneGraphPtr tmp; + xmlNodePtr cur; + //,cur_images,cur_effects,cur_geometries,cur_visual_scenes; + //SceneGraphPtr tmp; doc = xmlParseFile(xmlColladafile); cur = xmlDocGetRootElement(doc);