Mercurial > hg > Members > kono > Cerium
diff Renderer/Engine/viewer.cc @ 1018:736a833db108
sg_drawable_num add. CreatePolygonFromSceneGraph not done.
author | tkaito |
---|---|
date | Sun, 07 Nov 2010 02:53:05 +0900 |
parents | 34a9ba655fbe |
children | 360f8eba78f1 |
line wrap: on
line diff
--- a/Renderer/Engine/viewer.cc Fri Nov 05 22:28:20 2010 +0900 +++ b/Renderer/Engine/viewer.cc Sun Nov 07 02:53:05 2010 +0900 @@ -627,21 +627,89 @@ } +/* flag_drawable な Scenegraph の総数を求める */ +int +sg_drawable_num(SceneGraphPtr sg) +{ + int sg_count = 0; + while (sg) { + if (sg->flag_drawable) { + sg_count++; + } + if (sg->children != NULL) { + sg = sg->children; + } else if (sg->brother != NULL) { + sg = sg->brother; + } else { + while (sg) { + if (sg->brother != NULL) { + sg = sg->brother; + break; + } else { + if (sg->parent == NULL) { + sg = NULL; + break; + } else { + sg = sg->parent; + } + } + } + } + } + return sg_count; +} + void create_pp_task(SceneGraphPtr sg, TaskManager *manager, int spe_num, HTaskPtr task_next) { - MatrixListInfo *matrix_info = (MatrixListInfo*)manager->allocate(sizeof(MatrixListInfo)); - collect_matrix(sg, matrix_info, manager); - /* * SceneGraph を辿って coord_xyz, coord_tex, normal, matrix, real_matrix 及び、 * PolygonPack の TrianglePack (空) を送る。pp->info.size の計算もここで。 * */ + //int spe_num = 6; + + HTask **task_array = (HTask**)manager->allocate(sizeof(HTask*)*spe_num); + Task **pp = (Task**)manager->allocate(sizeof(Task*)*spe_num); + + int sg_num = sg_drawable_num(sg); + + for (int k = 0; k < spe_num; k++) { + task_array[k] = manager->create_task_array(CreatePolygonFromSceneGraph,sg_num,4,6,1); + pp[k] = 0; + } + + while (sg) { + if (sg->flag_drawable) { + + } + if (sg->children != NULL) { + sg = sg->children; + } else if (sg->brother != NULL) { + sg = sg->brother; + } else { + while (sg) { + if (sg->brother != NULL) { + sg = sg->brother; + break; + } else { + if (sg->parent == NULL) { + sg = NULL; + break; + } else { + sg = sg->parent; + } + } + } + } + } + + //MatrixListInfo *matrix_info = (MatrixListInfo*)manager->allocate(sizeof(MatrixListInfo)); + //collect_matrix(sg, matrix_info, manager); //HTaskPtr phase_wait = manager->create_task(Dummy); - + /* for (MatrixListInfo* t = matrix_info; t != NULL; t = t->next) { printf("list_length %d \n", t->list_length); @@ -679,7 +747,7 @@ printf("-----------------------\n"); //return create_pp_wait; - + */ } void @@ -699,7 +767,8 @@ #else - + //SceneGraphPtr sg = sgroot->getDrawSceneGraph(); + //printf("sg->size = %lld\n", sg->size); HTaskPtr task_create_pp = manager->create_task(CreatePolygonFromSceneGraph); // SceneGraph(木構造) -> PolygonPack