diff TaskManager/Test/test_render/SceneGraph.cpp @ 142:ff3fb47c2553

add xml
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Sat, 29 Nov 2008 02:39:43 +0900
parents fc314f28b66e
children 9642aeef298d
line wrap: on
line diff
--- a/TaskManager/Test/test_render/SceneGraph.cpp	Sat Nov 29 01:18:32 2008 +0900
+++ b/TaskManager/Test/test_render/SceneGraph.cpp	Sat Nov 29 02:39:43 2008 +0900
@@ -55,6 +55,8 @@
     texture_id = -1;
     move = no_move;
     collision = no_collision;
+
+    frame = 0;
 }
 
 /* construct polygon from xmlNode.  */
@@ -133,10 +135,10 @@
 {
     SceneGraph *tmp;
 
-    /* childrenのリストの最後に加える */
+    /* childrenのリストの最後に加える (brother として)*/
     if (this->lastChild != NULL) {
 	tmp = this->lastChild;
-	tmp->children = child;
+	tmp->brother = child;
     }
 
     this->lastChild = child;
@@ -392,6 +394,8 @@
 	t->move_execute(screen_w, screen_h);
 	t->collision_check(screen_w, screen_h, top);
 
+	t->frame++;
+
 	if (t->parent != NULL) {
 	    get_matrix(t->matrix, t->angle, t->xyz, t->parent->matrix);
 	} else {
@@ -429,6 +433,14 @@
 }
 
 void
+SceneGraph::set_move_collision(move_func new_move,
+			       collision_func new_collision)
+{
+    this->move = new_move;
+    this->collision = new_collision;
+}
+
+void
 SceneGraph::add_next(SceneGraphPtr next)
 {
     /* next のリストの最後に加える */