changeset 1356:58a02f491f51 draft

regist to use collada file
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Thu, 19 Jan 2012 17:55:16 +0900
parents 157e0100d42f
children d532204d76c1
files Renderer/Engine/SceneGraphRoot.cc
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Thu Jan 19 17:14:32 2012 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Thu Jan 19 17:55:16 2012 +0900
@@ -485,7 +485,8 @@
         pcont = pickup_float(pcont, s->pcount+i);
     }
 }
-void
+
+SceneGraph*
 decode_points(xmlNodePtr cur, collada_state *s, TaskManager *manager){
     printf("start decode points\n");
     int vertexp[s->vcsum];
@@ -548,9 +549,9 @@
     
     for (int i = 0;i < sg->pp_num; i++ ){
         PolygonPackPtr pp = sg->pp;
-	TrianglePackPtr tri =  pp[i].tri;
-	// TrianglePack の size のチェック
-	int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ;
+	    TrianglePackPtr tri =  pp[i].tri;
+	    // TrianglePack の size のチェック
+	    int tri_size = (count < MAX_SIZE_TRIANGLE) ? count : MAX_SIZE_TRIANGLE ;
 	pp[i].info.size = tri_size;
 	int k = 0;
 	int m = 0;
@@ -599,6 +600,7 @@
         printf("vertexp = %d\n", vertexp[i]);
         //printf("vertex_table= %f\n", s->vertex_table[i]);
     } 
+
     int tex_id = 0;
     sgid_hash.sg_hash_regist(s->name, tex_id);
     //get_texpic(s->tex_picname, sg, cur , manager);
@@ -613,6 +615,7 @@
 
     /* got out of polylist */
     s->polylist = 0;
+    return sg;
 }
 
 static void 
@@ -703,7 +706,7 @@
         init_list(&list);
         xml_walk(cur,&s,&list,this);
     }
-    decode_points(cur,&s,this);
+    registSceneGraph(decode_points(cur,&s,manager));
     //xmlFreeDoc(doc);
 }