# HG changeset patch # User e065725@yutaka.st.ie.u-ryukyu.ac.jp # Date 1246102971 -32400 # Node ID be8f785a82e909c1ef97a2fecf1cead23ad0c0e3 # Parent 2964ed8fd3213ca98bf8946e896485c5c9e4d546 change api setSceneDate diff -r 2964ed8fd321 -r be8f785a82e9 TaskManager/Test/test_render/SceneGraphRoot.cpp --- a/TaskManager/Test/test_render/SceneGraphRoot.cpp Sat Jun 27 20:30:26 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraphRoot.cpp Sat Jun 27 20:42:51 2009 +0900 @@ -184,38 +184,41 @@ camera->children = NULL; camera->lastChild = NULL; - while (t) { - SceneGraphPtr c = t->clone(); + /*まずは全部動作させる*/ + while (list) { - addNext(c); - cur_parent->addChild(c); - c->frame = t->frame; + list->move_execute(screen_w, screen_h); + list->collision_check(screen_w, screen_h, list); + + list->frame++; + list = list->next; - c->move_execute(screen_w, screen_h); - c->collision_check(screen_w, screen_h, list); + } - if (c->isRemoved()) { - sg_exec_tree = c->realRemoveFromTree(cur_parent); - sg_available_list = c->realRemoveFromList(sg_available_list); - delete c; - cnt--; - t->children = NULL; - t->parent = cur_parent; - } else { - c->frame++; - get_matrix(c->matrix, c->angle, c->xyz, c->parent->matrix); - } + if(sg_exec_tree != NULL) { + return; + } - if (t->children != NULL) { + /*removeのflagをもとにtreeを形成*/ + while (t) { + SceneGraphPtr c = NULL; + if (!t->isRemoved()) { + c = t->clone(); + addNext(c); + cur_parent->addChild(c); + c->frame = t->frame; + /*親の回転、座標から、子の回転、座標を算出*/ + get_matrix(c->matrix, c->angle, c->xyz, cur_parent->matrix); + } + + if (t->children != NULL && c != NULL) { cur_parent = c; t = t->children; } else if (t->brother != NULL) { - cur_parent = c->parent; t = t->brother; } else { while (t) { if (t->brother != NULL) { - cur_parent = t->parent; t = t->brother; break; } else { @@ -223,15 +226,25 @@ t = NULL; break; } else { - t = t->parent; + cur_parent = cur_parent->parent; + t = t->parent; + } } - } + } } } + + // 現在、allExecute が終わった時点では // camera->children が User SceneGraph の root になる + + /** + * NULL じゃなかったら、setSceneData が呼ばれてるから + * そっちを次の Scene にする + */ + sg_exec_tree = camera->children; }