Mercurial > hg > Game > Cerium
diff TaskManager/Test/test_render/viewer.cc @ 421:6094dfd1f08c draft
comment
author | game@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 24 Sep 2009 12:35:32 +0900 |
parents | a3ef5c15edac |
children | 217258e3d148 |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/viewer.cc Wed Sep 23 21:29:30 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cc Thu Sep 24 12:35:32 2009 +0900 @@ -117,7 +117,7 @@ sgroot = new SceneGraphRoot(this->width, this->height); sgroot_2 = new SceneGraphRoot(this->width, this->height); //sgroot->createFromXMLFile(xml); - + // ここの switch は application->init(this, manager, sg_no); になるべき switch (sg_number) { case 0: case 1: @@ -243,8 +243,8 @@ this->keyPtr = key; // post2runLoop は旧バージョン用なので post2speRunLoop の様なものを別につくるべき - task_next->set_post(post2speRunLoop, (void*)this); // set_post(function(this->run_loop()), NULL) - task_next->spawn(); + //task_next->set_post(post2speRunLoop, (void*)this); // set_post(function(this->run_loop()), NULL) + //task_next->spawn(); // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ /* test */ @@ -314,12 +314,14 @@ update_key->add_inData(viewer->keyPtr, sizeof(key_stat)); update_key->spawn(); - HTaskPtr move_task = viewer->manager->create_task(TASK_MOVE); + /* TASK_MOVE は外から引数で取ってくるべき */ + HTaskPtr move_task = viewer->manager->create_task(viewer->move_taskid); //move_task->add_param(sgroot); HTaskPtr draw_task = viewer->manager->create_task(TASK_DRAW); HTaskPtr switch_task = viewer->manager->create_task(TASK_SWITCH); + switch_task->wait_for(move_task); switch_task->wait_for(draw_task); move_task->spawn(); @@ -338,36 +340,6 @@ viewer->run_move(task_next); } -/* -void -Viewer::spe_run_loop() -{ - - bool quit_flg; - quit_flg = quit_check(); - if (quit_flg == true) { - this_time = get_ticks(); - run_finish(); - return; - } - - clean_pixels(); - - for (int i = 1; i <= spackList_length; i++) { - spackList[i-1].reinit(i*split_screen_h); - } - - //run_move(task_next); - sgroot->updateControllerState(); - sgroot->speExecute(width, height); - //sgroot->checkRemove(); - - // ここから下は Rendering という関数にする - rendering(task_next); - -} - -*/ void Viewer::mainLoop() { @@ -375,40 +347,8 @@ task_next->set_post(&post2runLoop, (void *)this); // set_post(function(this->run_loop()), NULL) task_next->spawn(); - // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ } - -/* -static void -post2exchange_sgroot(void *viewer_) -{ - Viewer *viewer = (Viewer*)viewer_; - HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY); - viewer->exchange_sgroot(task_next); -} - -void -Viewer::exchange_sgroot(TaskManager *manager) -{ - - SceneGraphRootPtr tmp = sgroot; - sgroot = sgroot_2; - sgroot_2 = tmp; - -} -*/ - -/* -void -Viewer::spe_run_move(HTaskPtr task_next) -{ - HTaskPtr move_task = manager->create_task(MOVE_TASK); - move_task->add_param(sgroot); - task_next->wait_for(move_task); -} -*/ - static void post2runMove(void *viewer_) { @@ -600,3 +540,5 @@ delete sgroot_2; quit(); } + +/* end */