diff Renderer/Engine/SceneGraphRoot.cc @ 969:52c4353308e7 draft

add new function for dandy.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Thu, 26 Aug 2010 03:20:42 +0900
parents 564096e53d8a
children ceca625af064
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Mon Aug 09 00:09:00 2010 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Thu Aug 26 03:20:42 2010 +0900
@@ -6,7 +6,6 @@
 #include "sys.h"
 #include "TextureHash.h"
 #include "texture.h"
-//#include "SGList.h"
 #include "Application.h"
 
 static int cnt = 0;
@@ -707,6 +706,20 @@
   task->add_outData(property, size);
   task->add_param((memaddr)1);
   task->set_post(post_func, (void*)property, 0);
+  wait_game_task->wait_for(task);
+  task->spawn();
+}
+
+void
+SceneGraphRoot::set_game_task(int id, void *property, void *pad, int size, PostFunction post_func)
+{
+  HTask *task = sgroot->tmanager->create_task(id);
+  task->set_cpu(SPE_ANY);
+  task->add_inData(property, size);
+  task->add_inData(pad, sizeof(Pad));
+  task->add_outData(property, size);
+  task->set_post(post_func, (void*)property, 0);
+  wait_game_task->wait_for(task);
   task->spawn();
 }
 
@@ -717,11 +730,26 @@
   void *e  = node->propertyptr;
   int move = node->move_id;
   PostFunction post_func = node->post_func;
+
   SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_;
   sgroottmp->set_game_task(move, (void*)e, size, post_func);
 }
 
 void
+pad_task_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
+{
+  int size = node->property_size;
+  void *e  = node->propertyptr;
+  int move = node->move_id;
+  PostFunction post_func = node->post_func;
+
+  SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_;
+  void *pad = (void*)sgroottmp->getController();
+
+  sgroottmp->set_game_task(move, (void*)e, pad, size, post_func);
+}
+
+void
 SceneGraphRoot::set_move_task(SceneGraphPtr node, int move, void *property, int size, 
 			      PostFunction post_func)
 {
@@ -732,4 +760,15 @@
     node->property_size = size;
 }
 
+void
+SceneGraphRoot::set_pad_task(SceneGraphPtr node, int move, void *property, int size,
+			      PostFunction post_func)
+{
+    node->move = pad_task_move;
+    node->post_func = post_func;
+    node->move_id = move;
+    node->propertyptr = property;
+    node->property_size = size;
+}
+
 /* end */