# HG changeset patch # User tkaito # Date 1278877190 -32400 # Node ID dea6d34c8e9166f8f6ca751320ae6313efa0351c # Parent 7c60ef3fca5bd9f8352d0843c4a97c416e1fa029 not move. diff -r 7c60ef3fca5b -r dea6d34c8e91 dandy.h --- 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; diff -r 7c60ef3fca5b -r dea6d34c8e91 schedule.cc --- 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); } diff -r 7c60ef3fca5b -r dea6d34c8e91 stage_init.cc --- 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); - }