changeset 9:dea6d34c8e91

not move.
author tkaito
date Mon, 12 Jul 2010 04:39:50 +0900
parents 7c60ef3fca5b
children 27d3291a7c82
files dandy.h schedule.cc stage_init.cc
diffstat 3 files changed, 21 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/dandy.h	Wed Jul 07 03:11:52 2010 +0900
+++ b/dandy.h	Mon Jul 12 04:39:50 2010 +0900
@@ -54,6 +54,8 @@
 extern void create_stage(void *sgroot, int w, int h);
 extern void schedule(SceneGraphPtr node, void *sgroot_, int w, int h);
 
+//extern create_enemy(SchedTask *s, void *enemy_, void *b);
+
 typedef struct enemy_state {
   const char *charano;
   int score;
--- a/schedule.cc	Wed Jul 07 03:11:52 2010 +0900
+++ b/schedule.cc	Mon Jul 12 04:39:50 2010 +0900
@@ -10,11 +10,12 @@
 {
   SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
   Pad *pad = sgroot->getController();
+  // Title 画面
   if(back_property.flag == 0){
+    Putenemy(0, w/2, h/2, 0, 0, MOVE_00, MOVE_00, node, sgroot);
     if(pad->start.isPush()) {
       back_property.flag = 1;
       //node->children->remove();
-      sgroot->setSceneData(node);
     }
   }
 
@@ -245,13 +246,13 @@
 void
 create_enemy(SchedTask *s, void *enemy_, void *b)
 {
-  ObjPropertyPtr e = (ObjPropertyPtr)enemy_; 
+  ObjPropertyPtr ene = (ObjPropertyPtr)enemy_; 
   SceneGraphPtr back1, enemy1;
-  back1 = (SceneGraphPtr)e->parent;
-  enemy1 = (SceneGraphPtr)e->root;
+  back1 = (SceneGraphPtr)ene->parent;
+  enemy1 = (SceneGraphPtr)ene->root;
   
-  enemy1->xyz[0] = e->x;
-  enemy1->xyz[1] = e->y;
+  enemy1->xyz[0] = ene->x;
+  enemy1->xyz[1] = ene->y;
 
   back1->addChild(enemy1);
   
@@ -276,24 +277,16 @@
   e->y = y;
   e->vx = sx;
   e->vy = sy;
-  e->root = obj;
-  e->parent = node;
+  e->root = (void*)obj;
+  e->parent = (void*)node;
   e->flag = 1;
   e->vital = charactor[charano].vital;
   //e->move = move;
   e->score = charactor[charano].score;
   //e->dt1 = e->dt2 = 0;
   //e->tama = tf;
-  
-  obj->xyz[0] = x;
-  obj->xyz[1] = y;
-  obj->stack_xyz[0] = sx;
-  obj->stack_xyz[1] = sy;
 
   int size = sizeof(ObjPropertyPtr)*16;
-  //obj->set_move_collision(move, coll);
-  sgroot->set_game_task(move, e, size, create_enemy);
-  
-  //node->addChild(obj);
-  //node->setSceneData();
+  //printf("size = %d\n", size);
+  sgroot->set_move_task(obj, move, (void*)e, size, create_enemy);
 }
--- a/stage_init.cc	Wed Jul 07 03:11:52 2010 +0900
+++ b/stage_init.cc	Mon Jul 12 04:39:50 2010 +0900
@@ -3,8 +3,13 @@
 void
 back_move(SceneGraphPtr node, void *sgroot_, int w, int h)
 {
-  schedule(node, sgroot_, w, h);
+  Viewer *sgroot = (Viewer *)sgroot_;
+
+  schedule(node, sgroot, w, h);
   node->frame += 1;
+  //printf("frame = %d\n", node->frame);
+  //sgroot->setSceneData(node); // 描画し直し。
+  
 }
 
 void
@@ -34,21 +39,12 @@
 {
   Viewer *sgroot = (Viewer *)sgroot_;
   SceneGraphPtr back;
+  back_property.flag = 0;
 
   back = sgroot->createSceneGraph();
   back->set_move_collision(back_move, back_coll);
+
   sgroot->setSceneData(back);
-  back_property.flag = 0;
-
-  charactor[0].x  = w/2;
-  charactor[0].y  = h/2;
-  charactor[0].parent = (void*)back;
-  
-  int size = sizeof(ObjPropertyPtr)*16;
-
-  /* set_game_task(int id, ObjProperty property, int size, PostFunction post_func) */
-  sgroot->set_game_task(TITLE_MOVE, charactor, size, create_title);
-
 }