# HG changeset patch # User game@henri.cr.ie.u-ryukyu.ac.jp # Date 1253684318 -32400 # Node ID edfde944672ac375346bb3189da73e047dc6626c # Parent 2bf71fc10ed1f8af40b952693670037e3aa72396 add Move, Draw, ChainMove diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/Func.h --- a/TaskManager/Test/test_render/Func.h Wed Sep 23 13:01:32 2009 +0900 +++ b/TaskManager/Test/test_render/Func.h Wed Sep 23 14:38:38 2009 +0900 @@ -27,8 +27,11 @@ CHAININIT_TASK, RUN_FINISH, + TASK_SWITCH, SHOW_TIME, SEND_KEY, + + CHAIN_MOVE, }; #define DATA_ID 0 diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/ChainMove.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/ChainMove.cc Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,13 @@ +#include +#include +#include "ChainMove.h" +#include "viewer_types.h" + +SchedDefineTask(ChainMove); + +int +ChainMove::run(void *rbuf, void *wbuf) +{ + + return 0; +} diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/ChainMove.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/ChainMove.h Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,13 @@ +#ifndef INCLUDED_TASK_CHAIN_MOVE +#define INCLUDED_TASK_CHAIN_MOVE + +#include "SchedTask.h" + +class ChainMove : public SchedTask { +public: + SchedConstructor(ChainMove); + + int run(void *rbuf, void *wbuf); +}; + +#endif diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/Draw.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/Draw.cc Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,13 @@ +#include +#include +#include "Draw.h" +#include "viewer_types.h" + +SchedDefineTask(Draw); + +int +Draw::run(void *rbuf, void *wbuf) +{ + + return 0; +} diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/Draw.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/Draw.h Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,14 @@ +#ifndef INCLUDED_TASK_DRAW +#define INCLUDED_TASK_DRAW + +#include "SchedTask.h" + +class Draw : public SchedTask { +public: + SchedConstructor(Draw); + + int run(void *rbuf, void *wbuf); + +}; + +#endif diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/Move.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/Move.cc Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,15 @@ +#include +#include +#include "Move.h" +#include "viewer_types.h" + +SchedDefineTask(Move); + +int +Move::run(void *rbuf, void *wbuf) +{ + //sgroot->updateControllerState(); + //sgroot->speExecute(width, height); + + return 0; +} diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/Move.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/Move.h Wed Sep 23 14:38:38 2009 +0900 @@ -0,0 +1,14 @@ +#ifndef INCLUDED_TASK_MOVE +#define INCLUDED_TASK_MOVE + +#include "SchedTask.h" + +class Move : public SchedTask { +public: + SchedConstructor(Move); + + int run(void *rbuf, void *wbuf); + +}; + +#endif diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/task/task_init.cc --- a/TaskManager/Test/test_render/task/task_init.cc Wed Sep 23 13:01:32 2009 +0900 +++ b/TaskManager/Test/test_render/task/task_init.cc Wed Sep 23 14:38:38 2009 +0900 @@ -14,13 +14,14 @@ SchedExternTask(LoadTexture); SchedExternTask(SetTexture); -// SchedExternTask(Move); -// SchedExternTask(Draw); +SchedExternTask(Move); +SchedExternTask(Draw); SchedExternTask(Dummy); SchedExternTask(ShowTime); SchedExternTask(SendKey); +SchedExternTask(ChainMove); /** @@ -42,11 +43,14 @@ SchedRegisterTask(TASK_INIT_TEXTURE, LoadTexture); SchedRegisterTask(TASK_SET_TEXTURE, SetTexture); -// SchedRegisterTask(TASK_MOVE, Move); -// SchedRegisterTask(TASK_DRAW, Draw); + SchedRegisterTask(TASK_MOVE, Move); + SchedRegisterTask(TASK_DRAW, Draw); SchedRegisterTask(TASK_DUMMY, Dummy); SchedRegisterTask(SHOW_TIME, ShowTime); SchedRegisterTask(SEND_KEY, SendKey); + + // usr + SchedRegisterTask(CHAIN_MOVE, ChainMove); } diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/viewer.cc --- a/TaskManager/Test/test_render/viewer.cc Wed Sep 23 13:01:32 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cc Wed Sep 23 14:38:38 2009 +0900 @@ -11,13 +11,13 @@ #include #include "Pad.h" -static void post2runLoop(void *viewer_); -static void post2runDraw(void *viewer_); -static void post2speRunLoop(void *viewer_); +static void post2runLoop(void *viewer); +static void post2runDraw(void *viewer); +static void post2speRunLoop(void *viewer); //static void post2runMove(void *viewer); //static void post2exchange_sgroot(void *viewer); -static void post2speRunLoop(void *viewer_); - +static void post2speRunLoop(void *viewer); +static void post2runMoveDrawLoop(void *viewer); /* measure for FPS (Frame Per Second) */ int start_time; @@ -249,12 +249,12 @@ HTaskPtr send_key_task = viewer->manager->create_task(SEND_KEY); - HTaskPtr move_task = viewer->manager->create_task(MOVE_TASK); - move_task->add_param(sgroot); + HTaskPtr move_task = viewer->manager->create_task(TASK_MOVE); + //move_task->add_param(sgroot); - HTaskPtr draw_task = viewer->manager->create_task(DRAW_TASK); + HTaskPtr draw_task = viewer->manager->create_task(TASK_DRAW); - HTaskPtr switch_task = viewer->manager->create_task(SWITCH_TASK); + HTaskPtr switch_task = viewer->manager->create_task(TASK_SWITCH); switch_task->wait_for(move_task); switch_task->wait_for(draw_task); send_key_task->spawn(); @@ -269,11 +269,12 @@ static void post2speRunLoop(void *viewer_) { - Viewer *viewer = viewer_; + Viewer *viewer = (Viewer *)viewer_; HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY); viewer->run_move(task_next); } +/* void Viewer::spe_run_loop() { @@ -301,6 +302,7 @@ rendering(task_next); } +*/ void Viewer::mainLoop() diff -r 2bf71fc10ed1 -r edfde944672a TaskManager/Test/test_render/viewer.h --- a/TaskManager/Test/test_render/viewer.h Wed Sep 23 13:01:32 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.h Wed Sep 23 14:38:38 2009 +0900 @@ -44,6 +44,8 @@ virtual void run_collision(); virtual void rendering(HTaskPtr task_next); //virtual void exchange_sgroot(TaskManager *manager); + + void get_send_controll(); private: HTaskPtr initLoop(); void mainLoop();