Mercurial > hg > Game > Cerium
changeset 762:d77fe7cfad19 draft
Test/create_task.cc work
author | hiroki@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sun, 07 Feb 2010 17:43:23 +0900 |
parents | 0a602ba186e5 |
children | 4cc05c023ff9 |
files | Renderer/Engine/SgChange.cc Renderer/Engine/spe/Property.cc Renderer/Test/create_task.cc |
diffstat | 3 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/SgChange.cc Thu Feb 04 14:50:01 2010 +0900 +++ b/Renderer/Engine/SgChange.cc Sun Feb 07 17:43:23 2010 +0900 @@ -26,7 +26,7 @@ /* Data Pack sent to Other CPUs (ex. SPE) */ extern SceneGraphPack *sgpack; -extern PolygonPack *ppack; +//extern PolygonPack *ppack; extern SpanPackPtr spackList; extern SpanPackPtr *spackList_ptr; @@ -123,6 +123,7 @@ /* application 側で sgroot に task を生成登録する 引数を渡したりは後でやる。 + 登録された関数を実行して task を生成登録する。 */ sgroot_A->regist_execute(); @@ -135,12 +136,14 @@ /* TTaskPtr move_finish = manager->create_task(Dummy); loop_task->wait_for(move_finish); - move_finish は app の move_task の post_func で実行させてやる */ + /* + 描画終了確認用のダミータスク + 描画の最後で spwan させる + */ HTaskPtr dummy_task = manager->create_task(Dummy); - draw_finish = dummy_task; loop_task->wait_for(draw_finish);
--- a/Renderer/Engine/spe/Property.cc Thu Feb 04 14:50:01 2010 +0900 +++ b/Renderer/Engine/spe/Property.cc Sun Feb 07 17:43:23 2010 +0900 @@ -18,13 +18,12 @@ { PropertyPtr property = (PropertyPtr)s->get_input(rbuf, 0); PropertyPtr update_property = (PropertyPtr)s->get_output(wbuf, 0); - int *move_finish_flag = (int *)s->get_param(0); property->xyz[0] += 1.0f; property->xyz[1] += 1.0f; property->xyz[2] += 1.0f; memcpy((void*)update_property, (void*)property, sizeof(Property)); - *move_finish_flag = 1; + return 0; }
--- a/Renderer/Test/create_task.cc Thu Feb 04 14:50:01 2010 +0900 +++ b/Renderer/Test/create_task.cc Sun Feb 07 17:43:23 2010 +0900 @@ -5,6 +5,7 @@ #include "create_task.h" #include "types.h" #include "Func.h" +#include "sys.h" #include "SgChange.h" Property *property, *update_property; @@ -30,7 +31,6 @@ //property_task->add_inData((Property *)node->property, sizeof(Property)); //property_task->add_outData((Property *)node->update_property, sizeof(Property)); - //property_task->set_param(0, (memaddr)sgroot->move_finish_flag); property_task->set_cpu(SPE_ANY); property_task->set_post(createSceneGraphFromProperty, (void *)sgroot, 0); @@ -50,12 +50,18 @@ SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; SceneGraphPtr node; + // ここが allExecute の tree をたどって clone して行くところに相当する node = sgroot->createSceneGraph(update_property->name); //node = sgroot->createSceneGraph("Ball"); node->set_move_collision(move, collision); node->xyz[0] = update_property->xyz[0]; node->xyz[1] = update_property->xyz[1]; node->xyz[2] = update_property->xyz[2]; + + // get matrix + get_matrix(node->matrix, node->angle, node->xyz, sgroot->camera->matrix); + get_matrix(node->real_matrix, node->angle, node->xyz, sgroot->camera->real_matrix); + sgroot->setSceneData(node); Property *tmp = property; @@ -115,6 +121,7 @@ // SgChange を使うための2行 SgChange *sgroot = new SgChange(viewer); sgroot->run_init(); + // 上で書いた regist_task() を登録 sgroot->sgroot_A->appTaskRegist(regist_task); property = (Property *)sgroot->manager->allocate(sizeof(Property));