changeset 514:2659376067e8

old ball_bound fix...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 20 Oct 2009 21:18:28 +0900
parents 01b64f21405e
children 27a6b07d0f44
files Renderer/Engine/viewer.cc TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/HTask.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h
diffstat 5 files changed, 34 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/viewer.cc	Mon Oct 12 21:39:57 2009 +0900
+++ b/Renderer/Engine/viewer.cc	Tue Oct 20 21:18:28 2009 +0900
@@ -12,20 +12,20 @@
 #include "Pad.h"
 #include "Application.h"
 
-static void post2runLoop(void *viewer);
-static void post2runDraw(void *viewer);
-static void post2speRendering(void *viewer);
-static void post2speDraw(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 post2runMoveDrawLoop(void *viewer);
+static void post2runLoop(SchedTask *s,void *viewer,void *s);
+static void post2runDraw(SchedTask *s,void *viewer,void *s);
+static void post2speRendering(SchedTask *s,void *viewer,void *s);
+static void post2speDraw(SchedTask *s,void *viewer,void *s);
+static void post2runMoveDrawLoop(SchedTask *s,void *viewer,void *s);
 
 /* measure for FPS (Frame Per Second) */
 int start_time;
 int this_time;
 int frames;
+// static void post2speRunLoop(void *viewer);
+//static void post2runMove(void *viewer);
+//static void post2exchange_sgroot(void *viewer);
+//static void post2speRunLoop(void *viewer);
 
 SceneGraphRootPtr sgroot;
 //SceneGraphRootPtr sgroot_2;
@@ -200,7 +200,7 @@
    
     HTaskPtr task_switch = manager->create_task(TASK_SWITCH);
     task_switch->wait_for(task_next);
-    task_switch->set_post(post2runMoveDrawLoop, (void*)this);
+    task_switch->set_post(post2runMoveDrawLoop, (void*)this, 0);
     task_switch->spawn();
 }
 
@@ -250,7 +250,7 @@
 }
 
 static void
-post2runMoveDrawLoop(void *viewer_)
+post2runMoveDrawLoop(SchedTask *m, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer*)viewer_;
     
@@ -278,14 +278,14 @@
     HTaskPtr switch_task = viewer->manager->create_task(TASK_SWITCH);
     viewer->draw_dummy = draw_dummy;
     switch_task->wait_for(draw_dummy);
-    draw_task->set_post(post2speRendering, (void*)viewer);
+    draw_task->set_post(post2speRendering, (void*)viewer, 0);
 
     switch_task->wait_for(move_task);
     switch_task->wait_for(draw_task);
     move_task->spawn();
     draw_task->spawn();
 
-    switch_task->set_post(post2runMoveDrawLoop, (void*)viewer);
+    switch_task->set_post(post2runMoveDrawLoop, (void*)viewer, 0);
     switch_task->spawn();
     
 }
@@ -305,7 +305,7 @@
 {
     HTaskPtr task_next = initLoop();
 
-    task_next->set_post(&post2runLoop, (void *)this); // set_post(function(this->run_loop()), NULL)
+    task_next->set_post(&post2runLoop, (void *)this, 0); // set_post(function(this->run_loop()), NULL)
     task_next->spawn();
 }
 
@@ -333,7 +333,7 @@
 }
 
 void
-post2rendering(void *viewer_)
+post2rendering(SchedTask *s, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer *)viewer_;
     HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
@@ -347,14 +347,14 @@
     
     // Barrier 同期
     // run_draw() を呼ぶ post2runDraw
-    task_next->set_post(post2runDraw, (void*)this); // set_post(function(this->run_draw()), NULL)
+    task_next->set_post(post2runDraw, (void*)this, 0); // set_post(function(this->run_draw()), NULL)
     task_next->spawn();
 
     // TASK_CREATE_SPAN が全て終わったら DUMMY_TASK が Viewer::run_draw() を呼ぶ
 }
 
 static void
-post2runLoop(void *viewer_)
+post2runLoop(SchedTask *s, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer*)viewer_;
     HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
@@ -389,7 +389,7 @@
 }
 
 static void 
-post2runDraw(void *viewer_)
+post2runDraw(SchedTask *s, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer*)viewer_;
     HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
@@ -402,7 +402,7 @@
 {
     common_draw(task_next);
 
-    task_next->set_post(post2runLoop, (void*)this); // set_post(function(this->run_loop()), NULL)
+    task_next->set_post(post2runLoop, (void*)this, 0); // set_post(function(this->run_loop()), NULL)
     task_next->spawn();
     // TASK_DRAW_SPAN が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ    
 
@@ -422,7 +422,7 @@
 }
 
 static void
-post2speRendering(void *viewer_)
+post2speRendering(SchedTask *s, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer*)viewer_;
     HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
@@ -435,13 +435,13 @@
     common_rendering(task_next);
 
     this->draw_dummy->wait_for(task_next);
-    task_next->set_post(post2speDraw, (void*)this);
+    task_next->set_post(post2speDraw, (void*)this, 0);
     task_next->spawn();
 
 }
 
 static void 
-post2speDraw(void *viewer_)
+post2speDraw(SchedTask *s, void *viewer_, void *arg)
 {
     Viewer *viewer = (Viewer*)viewer_;
     HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
--- a/TaskManager/kernel/ppe/HTask.cc	Mon Oct 12 21:39:57 2009 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Tue Oct 20 21:18:28 2009 +0900
@@ -38,13 +38,15 @@
 void
 HTask::set_cpu(CPU_TYPE type)
 {
-{
     mimpl->set_task_cpu(this, type);
 }
 
 void
-set_post(PostFunction func,void *read, void *write)
+HTask::set_post(PostFunction func,void *arg1, void *arg2)
+{
     this->post_func = func;
-    this->post_arg1 = read;
-    this->post_arg2 = write;
+    this->post_arg1 = arg1;
+    this->post_arg2 = arg2;
 }
+
+/* end */
--- a/TaskManager/kernel/ppe/HTask.h	Mon Oct 12 21:39:57 2009 +0900
+++ b/TaskManager/kernel/ppe/HTask.h	Tue Oct 20 21:18:28 2009 +0900
@@ -28,7 +28,7 @@
 
     TaskQueueInfo *wait_me;  // List of task waiting for me
     TaskQueueInfo *wait_i;   // List of task for which I am waiting
-    PostFunction func;
+    PostFunction post_func;
     void *post_arg1;
     void *post_arg2;
     CPU_TYPE cpu_type;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Mon Oct 12 21:39:57 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Tue Oct 20 21:18:28 2009 +0900
@@ -2,13 +2,15 @@
 #include "TaskManagerImpl.h"
 #include "types.h"
 #include "error.h"
+#include "SchedTask.h"
+#include "SchedTaskManager.h"
 #include "../sys_task/SysTask.h"
 
 static HTaskPtr systask_start;
 static HTaskPtr systask_finish;
 
-void
-noaction(SchdTask *s, void *read, void *write)
+static void
+noaction(SchedTask *s, void *read, void *write)
 {
 }
 
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h	Mon Oct 12 21:39:57 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.h	Tue Oct 20 21:18:28 2009 +0900
@@ -20,7 +20,7 @@
     TaskListInfo *taskListImpl;
     TaskQueueInfo *taskQueueImpl;
     HTaskInfo *htaskImpl;
-    SchedTask *schdTaskManager;
+    SchedTask *schedTaskManager;
 
     /* constructor */
     TaskManagerImpl(int num = 1) ;