changeset 14:e95c5c280f47

task_dandy test version.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 06 Aug 2010 22:47:05 +0900
parents 401cd8a186e9
children 813485a28b6f
files dandy.h ppe/TitleMove.cc stage_init.cc
diffstat 3 files changed, 20 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/dandy.h	Wed Aug 04 03:36:10 2010 +0900
+++ b/dandy.h	Fri Aug 06 22:47:05 2010 +0900
@@ -23,6 +23,7 @@
   const char *chara;
   int vital; //4
   int score; //4
+  int a;
   void *parent; 
   void *root;
   int flag;
--- a/ppe/TitleMove.cc	Wed Aug 04 03:36:10 2010 +0900
+++ b/ppe/TitleMove.cc	Fri Aug 06 22:47:05 2010 +0900
@@ -14,11 +14,13 @@
 
   i_obj = (ObjPropertyPtr)s->get_input(rbuf, 0);
   o_obj = (ObjPropertyPtr)s->get_output(wbuf, 0);
-  
-  o_obj[0] = i_obj[0];
+
+  i_obj[0].x += i_obj[0].vx;
 
-  //printf("x = %f\n", i_obj[0].x);
-  //printf("y = %f\n", i_obj[0].y);
+  printf("indata_x = %f\n", i_obj[0].x);
+  printf("indata_y = %f\n", i_obj[0].y);
+
+  s->swap();
 
   return 0;
 }
--- a/stage_init.cc	Wed Aug 04 03:36:10 2010 +0900
+++ b/stage_init.cc	Fri Aug 06 22:47:05 2010 +0900
@@ -4,7 +4,7 @@
 void
 create_title(SchedTask *s, void *charactor_, void *b)
 {
-  ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; 
+  ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_;
   SceneGraphPtr back1, title;
   back1 = (SceneGraphPtr)charactor[0].parent;
   title = (SceneGraphPtr)charactor[0].root;
@@ -12,8 +12,8 @@
   title->xyz[0] = charactor[0].x;
   title->xyz[1] = charactor[0].y;
 
-  back1->addChild(title);
-
+  printf("title_x = %f\n", title->xyz[0]);
+  printf("title_y = %f\n", title->xyz[1]);
 }
 
 ObjProperty back_property;
@@ -27,15 +27,21 @@
   back_property.flag = 0;
 
   back = sgroot->createSceneGraph();
-  sgroot->setSceneData(back);
-
-  SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
   charactor[0].x = w/2;
   charactor[0].y = h/2;
-  charactor[0].root = (void*)title;
+  charactor[0].vx = 1.0;
+  charactor[0].vy = 1.0;
   charactor[0].parent = (void*)back;
+
+  SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
+  title->xyz[0] = charactor[0].x;
+  title->xyz[1] = charactor[0].y;
+  
   int size = sizeof(ObjProperty);
   //printf("size = %d\n", size);
+  
+  back->addChild(title);
+  sgroot->setSceneData(back);
   sgroot->set_move_task(title, TITLE_MOVE, (void*)&charactor[0], size, create_title);
 }