Mercurial > hg > Members > kono > Cerium
changeset 1002:c79651141045
many changes.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 24 Oct 2010 19:00:47 +0900 |
parents | 1b018a00cd17 |
children | 295b3c79fb44 |
files | Renderer/Engine/Makefile.def Renderer/Engine/SceneGraphRoot.cc Renderer/Engine/SceneGraphRoot.h Renderer/Engine/viewer.cc Renderer/Engine/viewer.h TaskManager/Makefile.def example/hello_array/main.cc |
diffstat | 7 files changed, 63 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def Mon Oct 11 19:42:28 2010 +0900 +++ b/Renderer/Engine/Makefile.def Sun Oct 24 19:00:47 2010 +0900 @@ -5,7 +5,7 @@ ABIBIT = 32 ABI = -m$(ABIBIT) CC = g++ -OPT = -g -O9 #-DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1 +OPT = -g #-O9 -DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1 CFLAGS = -Wall $(ABI) $(OPT) # -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- a/Renderer/Engine/SceneGraphRoot.cc Mon Oct 11 19:42:28 2010 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Sun Oct 24 19:00:47 2010 +0900 @@ -8,6 +8,9 @@ #include "texture.h" #include "Application.h" +//取りあえず動かす用 本来はA pplication 側で定義した post_func で値の更新するべき +#include "../../../task_dandy/dandy.h" + static int cnt = 0; static const int SGLIST_LENGTH = 138; static int sg_src_size = SGLIST_LENGTH ; @@ -699,28 +702,57 @@ void SceneGraphRoot::set_game_task(int id, void *property, int size, PostFunction post_func) -{ +{ + game_task = game_task_array->next_task_array(id, game_task); + + game_task->set_inData(0, property, size); + game_task->set_outData(0, property, size); + + /* HTask *task = sgroot->tmanager->create_task(id); task->set_cpu(SPE_ANY); - task->add_inData(property, size); - task->add_outData(property, size); - task->add_param((memaddr)1); + task->set_inData(0, property, size); + task->set_outData(0, property, size); task->set_post(post_func, (void*)property, 0); wait_game_task->wait_for(task); task->spawn(); + */ } void SceneGraphRoot::set_game_task(int id, void *property, void *pad, int size, PostFunction post_func) { + game_task = game_task_array->next_task_array(id, game_task); + + game_task->set_inData(0, property, size); + game_task->set_inData(1, pad, sizeof(Pad)); + game_task->set_outData(0, property, size); + + /* HTask *task = sgroot->tmanager->create_task(id); task->set_cpu(SPE_ANY); - task->add_inData(property, size); - task->add_inData(pad, sizeof(Pad)); - task->add_outData(property, size); + task->set_inData(0, property, size); + task->set_inData(0, pad, sizeof(Pad)); + task->set_outData(0, property, size); task->set_post(post_func, (void*)property, 0); wait_game_task->wait_for(task); task->spawn(); + */ +} + +void +SceneGraphRoot::task_array_init(int id, int task_num, int param, int inData_num, int outData_num) +{ + game_task_array = tmanager->create_task_array(id, task_num, param, inData_num, outData_num); + game_task = 0; +} + +void +SceneGraphRoot::task_array_finish() +{ + game_task_array->spawn_task_array(game_task->next()); + game_task_array->set_cpu(SPE_ANY); + game_task_array->spawn(); } void @@ -730,8 +762,11 @@ void *e = node->propertyptr; int move = node->move_id; PostFunction post_func = node->post_func; + ObjPropertyPtr property = (ObjPropertyPtr)node->propertyptr; + property->root = node; SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_; + sgroottmp->set_game_task(move, (void*)e, size, post_func); } @@ -742,6 +777,8 @@ void *e = node->propertyptr; int move = node->move_id; PostFunction post_func = node->post_func; + ObjPropertyPtr property = (ObjPropertyPtr)node->propertyptr; + property->root = node; SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_; void *pad = (void*)sgroottmp->getController(); @@ -750,7 +787,7 @@ } void -SceneGraphRoot::set_move_task(SceneGraphPtr node, int move, void *property, int size, +SceneGraphRoot::set_move_task(SceneGraphPtr node, int move, void *property, int size, PostFunction post_func) { node->move = main_task_move;
--- a/Renderer/Engine/SceneGraphRoot.h Mon Oct 11 19:42:28 2010 +0900 +++ b/Renderer/Engine/SceneGraphRoot.h Sun Oct 24 19:00:47 2010 +0900 @@ -107,7 +107,10 @@ void OffLightSysSwitch(); /* GameTask 生成用 */ - HTaskPtr wait_game_task; + HTaskPtr game_task_array; + TaskPtr game_task; + void task_array_init(int id, int task_num, int param, int inData_num, int outData_num); + void task_array_finish(); void set_game_task(int id, void *property, int size, PostFunction post_func); void set_game_task(int id, void *property, void* pad, int size, PostFunction post_func); void set_move_task(SceneGraphPtr node, int move, void *property, int size, PostFunction post_func);
--- a/Renderer/Engine/viewer.cc Mon Oct 11 19:42:28 2010 +0900 +++ b/Renderer/Engine/viewer.cc Sun Oct 24 19:00:47 2010 +0900 @@ -99,7 +99,6 @@ sgroot = new SceneGraphRoot(this->width, this->height); sgroot->tmanager = manager; - int light_num = 4; int size = sizeof(float)*4*light_num; //xyz+alfa(4) * light_num(4) int light_size = size / sizeof(float); @@ -313,10 +312,9 @@ dev->clean_pixels(); pixels = dev->flip_screen(pixels); - /* ここでGameTaskの終了を待つTaskを生成しておく */ - sgroot->wait_game_task = manager->create_task(Dummy,0,0,0,0); sgroot->updateControllerState(); sgroot->allExecute(width, height); + sgroot->task_array_finish(); light_xyz_stock = sgroot->getLightVector(); light_switch_stock = sgroot->getLightSwitch(); light_sysswitch_stock = sgroot->getLightSysSwitch(); @@ -687,13 +685,12 @@ #else HTaskPtr task_create_pp = manager->create_task(CreatePolygonFromSceneGraph); - HTaskPtr game_task = sgroot->wait_game_task; // SceneGraph(木構造) -> PolygonPack task_create_pp->set_param(0,(memaddr)sgroot->getDrawSceneGraph()); task_create_pp->set_param(1,(memaddr)r[ppi].ppack); /* GameTaskの終了を待ってからポリゴンを作る */ - task_create_pp->wait_for(game_task); + task_create_pp->wait_for(sgroot->game_task_array); task_next->wait_for(task_create_pp); @@ -739,7 +736,6 @@ } task_create_pp->spawn(); - game_task->spawn(); } @@ -792,7 +788,7 @@ int rangey = (starty + split_screen_h - 1 > this->height) ? this->height - starty + 1 : split_screen_h; -#if 1 +#if 0 // mem_flag は spe 側で黒い部分を 0 で埋めるフラグ if(spack->info.size > 0 || mem_flag == 1) {
--- a/Renderer/Engine/viewer.h Mon Oct 11 19:42:28 2010 +0900 +++ b/Renderer/Engine/viewer.h Sun Oct 24 19:00:47 2010 +0900 @@ -104,6 +104,14 @@ // void setSceneData(SceneGraph *g); virtual void mainLoop(); + void task_array_init(int id, int task_num, int param, int inData_num, int outData_num) + { + sgroot->task_array_init(id, task_num, param, inData_num, outData_num); + } + void task_array_finish() + { + sgroot->task_array_finish(); + } void set_game_task(int id, void *property, int size, PostFunction post_func) { sgroot->set_game_task(id, property, size, post_func);