Mercurial > hg > Members > kono > Cerium
changeset 326:e299bd5e6c85
add test_render/{spe, task}/ShowTime.cpp but incomplete
author | aaa |
---|---|
date | Thu, 11 Jun 2009 22:47:00 +0900 |
parents | a664dbe0b870 |
children | bd3690d8cd7c |
files | TaskManager/Test/test_render/Camera.cpp TaskManager/Test/test_render/Func.h TaskManager/Test/test_render/show_time.cpp TaskManager/Test/test_render/show_time.h TaskManager/Test/test_render/spe/ShowTime.cpp TaskManager/Test/test_render/spe/ShowTime.h TaskManager/Test/test_render/spe/spe-main.cpp TaskManager/Test/test_render/task/ShowTime.cpp TaskManager/Test/test_render/task/ShowTime.h TaskManager/Test/test_render/task/task_init.cpp |
diffstat | 10 files changed, 84 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Camera.cpp Thu Jun 11 13:47:37 2009 +0900 +++ b/TaskManager/Test/test_render/Camera.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -3,6 +3,7 @@ #include "Camera.h" #include "sys.h" #include "Scheduler.h" +#include "show_time.h" static void camera_move(SceneGraphPtr _node, int screen_w, int screen_h) @@ -28,10 +29,9 @@ * ここに show_dma_wait 表示をいれようか */ - /*if (pad->r1.isPush()) { - Scheduler *scheduler; - scheduler->show_dma_wait(); - }*/ + if (pad->r1.isPush()) { + show_time(); + } if (pad->r1.isPush() || pad->r1.isHold()) { node->xyz[2] += 10.0f; @@ -166,7 +166,6 @@ m_view[ 5] = cy[1]; m_view[ 6] = cz[1]; m_view[ 7] = 0.0f; - m_view[ 8] = cx[2]; m_view[ 9] = cy[2]; m_view[10] = cz[2];
--- a/TaskManager/Test/test_render/Func.h Thu Jun 11 13:47:37 2009 +0900 +++ b/TaskManager/Test/test_render/Func.h Thu Jun 11 22:47:00 2009 +0900 @@ -20,4 +20,6 @@ TASK_DRAW_BACK, TASK_SET_TEXTURE, TASK_DUMMY, + + SHOW_TIME, };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/show_time.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,14 @@ +#include <stdio.h> +#include "TaskManager.h" +#include "Func.h" + +void +show_time() +{ + HTaskPtr show; + + show = manager->create_task(SHOW_TIME); + show->set_cpu(SPE_ANY); + show->spawn(); + printf("testですよ\n"); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/show_time.h Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,1 @@ +void show_time();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/spe/ShowTime.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,14 @@ +#include "ShowTime.h" +#include "stdio.h" + +SchedDefineTask(ShowTime); + +int +ShowTime::run(void *rbuf, void *wbuf) +{ + /* + * ここで show_dma_wait() を呼びたい + */ + printf("Show Time !\n"); +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/spe/ShowTime.h Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,13 @@ +#ifndef INCLUDED_TASK_SHOW_TIME +#define INCLUDED_TASK_SHOW_TIME + +#include "SchedTask.h" + +class ShowTime : public SchedTask { +public: + SchedConstructor(ShowTime); + + int run(void *r, void *w); +}; + +#endif
--- a/TaskManager/Test/test_render/spe/spe-main.cpp Thu Jun 11 13:47:37 2009 +0900 +++ b/TaskManager/Test/test_render/spe/spe-main.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -10,6 +10,8 @@ SchedExternTask(CreateSpan); //SchedExternTask(CreatePolygon); +SchedExternTask(ShowTime); + void task_init(void) { @@ -21,4 +23,6 @@ SchedRegisterTask(TASK_CREATE_SPAN, CreateSpan); //SchedRegisterTask(TASK_CREATE_PP, CreatePolygon); + + SchedRegisterTask(SHOW_TIME, ShowTime); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/ShowTime.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,16 @@ +#include "ShowTime.h" +#include "stdio.h" + +SchedDefineTask(ShowTime); + +int +ShowTime::run(void *rbuf, void *wbuf) +{ + /* + * ここで show_dma_wait() を呼びたい + */ + printf("Show Time !\n"); + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/task/ShowTime.h Thu Jun 11 22:47:00 2009 +0900 @@ -0,0 +1,13 @@ +#ifndef INCLUDED_TASK_SHOW_TIME +#define INCLUDED_TASK_SHOW_TIME + +#include "SchedTask.h" + +class ShowTime : public SchedTask { +public: + SchedConstructor(ShowTime); + + int run(void *r, void *w); +}; + +#endif
--- a/TaskManager/Test/test_render/task/task_init.cpp Thu Jun 11 13:47:37 2009 +0900 +++ b/TaskManager/Test/test_render/task/task_init.cpp Thu Jun 11 22:47:00 2009 +0900 @@ -16,6 +16,8 @@ SchedExternTask(Dummy); +SchedExternTask(ShowTime); + /** * set_cpu(CPU_PPE) で動作する task */ @@ -36,4 +38,5 @@ SchedRegisterTask(TASK_SET_TEXTURE, SetTexture); SchedRegisterTask(TASK_DUMMY, Dummy); + SchedRegisterTask(SHOW_TIME, ShowTime); }