# HG changeset patch # User Taiki TAIRA # Date 1321002473 -32400 # Node ID c41f10c1e138eeb76b18289d832378f39d6bdfec # Parent fd9b7519a17bf35575e4da55e1ff1fc3ea94d381# Parent 8bc0385299587beb714ba7fd80d972bbf60e7be5 merge diff -r 8bc038529958 -r c41f10c1e138 Renderer/Engine/SceneGraphRoot.cc --- a/Renderer/Engine/SceneGraphRoot.cc Fri Nov 11 18:01:05 2011 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Fri Nov 11 18:07:53 2011 +0900 @@ -226,6 +226,43 @@ } void +SceneGraphRoot::createFromCOLLADAfile(Taskmanager *manager, const char *xmlColladafile) +{ + /*make parse dom*/ + xmlDocPtr doc; + xmlNodePtr cur; + SceneGraphPtr tmp; + + doc = xmlParseFile(xmlColladafile); + cur = xmlDocGetRootElement(doc); + + /*エラー処理……だけど何書けばいいのか謎。とりあえず-1返してみる*/ + if(xmlStrcmp(cur-name, (xmlChar*)"COLLADA")){ + return -1; + }; + + /* node analyze */ + for(cur=cur->children; cur; cur=cur->next){ + + if(xmlStrcmp(cur->name,(xmlChar*)"library_imeges") != 0){ + + } + if(xmlStrcmp(cur->name,(xmlChar*)"library_effects") != 0){ + + } + if(xmlStrcmp(cur->name,(xmlChar*)"library_geometries") != 0){ + + } + if(xmlStrcmp(cur->name,(xmlChar*)"library_visual_scenes")!=0){ + } + + tmp = new SceneGraph(manager, cur); + registSceneGraph(tmp); + } + xmlFreeDoc(doc); +} + +void SceneGraphRoot::createFromXMLmemory(TaskManager *manager, SceneGraph *node, char *data, int len) { xmlDocPtr doc;