Mercurial > hg > Game > Cerium
changeset 1097:185f025f7ce5 draft
not yet done
author | yutaka@localhost.localdomain |
---|---|
date | Sat, 25 Dec 2010 23:12:18 +0900 |
parents | d18b605e431f |
children | 1ef561eb1ef5 |
files | Renderer/Engine/task/task_init.cc Renderer/Engine/viewer.cc |
diffstat | 2 files changed, 19 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/task/task_init.cc Sat Dec 25 19:10:50 2010 +0900 +++ b/Renderer/Engine/task/task_init.cc Sat Dec 25 23:12:18 2010 +0900 @@ -15,6 +15,10 @@ SchedExternTask(DrawSpanRenew); SchedExternTask(DrawBack); +SchedExternTask(RUN_LOOP_TASK); +SchedExternTask(RUN_DRAW_TASK); +SchedExternTask(RENDERING_TASK); + SchedExternTask(LoadTexture); // SchedExternTask(Move); @@ -55,6 +59,10 @@ SchedRegister( DrawSpan); SchedRegister( DrawBack); + SchedRegister(RUN_LOOP_TASK); + SchedRegister(RUN_DRAW_TASK); + SchedRegister(RENDERING_TASK); + SchedRegister( LoadTexture); // SchedRegister( Move);
--- a/Renderer/Engine/viewer.cc Sat Dec 25 19:10:50 2010 +0900 +++ b/Renderer/Engine/viewer.cc Sat Dec 25 23:12:18 2010 +0900 @@ -12,6 +12,7 @@ #include "Pad.h" #include "Application.h" #include "lindaapi.h" +#include "SchedTask.h" /* measure for FPS (Frame Per Second) */ static int start_time; @@ -181,7 +182,7 @@ } task_next = manager->create_task(RUN_LOOP_TASK,0,0,0,0); - task_next->set_param(0, (void*)viewer); + task_next->set_param(0, (void*)this); // ここは、Iterator を用意するべきだよね for (int j = 0; j < spe_num; j++) { @@ -194,7 +195,7 @@ task_next->spawn(); - return task_next; + return 0; } @@ -247,10 +248,7 @@ void Viewer::mainLoop() { - HTaskPtr task_next = initLoop(); - - - task_next->spawn(); + initLoop(); } void @@ -302,7 +300,7 @@ { Viewer *viewer = (Viewer*)smanager->get_param(0); - HTaskPtr task_next = smanager->create_task(RUN_DRAW_TASK, 0, 0, 0, 0); + HTaskPtr task_next = smanager->create_task(RENDERING_TASK, 0, 0, 0, 0); task_next->set_param(0, (void*)viewer); viewer->run_loop(task_next); @@ -318,13 +316,6 @@ { } -void -post2rendering(SchedTask *s, void *viewer_, void *arg) -{ - Viewer *viewer = (Viewer *)viewer_; - HTaskPtr task_next = viewer->manager->create_task(Dummy,0,0,0,0); - viewer->rendering(task_next); -} void Viewer::rendering(HTaskPtr task_next) @@ -344,10 +335,10 @@ rendering_task(SchedTask* smanager, void* rbuf, void* wbuf) { - Viewer* viewer = smanager->get_param(0); - HTaskPtr task_next = smanager->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); + Viewer* viewer = (Viewer*)smanager->get_param(0); + HTaskPtr task_next = smanager->create_task(RUN_DRAW_TASK, 0, 0, 0, 0); task_next->set_param(0, (void*)viewer); - viewer->common_rendering(task_next); + viewer->run_draw(task_next); return 0; @@ -372,10 +363,10 @@ { Viewer* viewer = (Viewer*)smanager->get_param(0); - HTaskPtr task_next = smanger->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); + HTaskPtr task_next = smanager->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); task_next->set_param(0, (void*)viewer); - viewer->common_draw(task_next); - viewer->frames++; + viewer->run_loop(task_next); + frames++; return 0;