Mercurial > hg > Members > tkaito > task_dandy
diff stage_init.cc @ 7:c015109a6041
schedule add. 10% done.
author | tkaito |
---|---|
date | Tue, 29 Jun 2010 04:25:32 +0900 |
parents | 661ec1e92042 |
children | 7c60ef3fca5b |
line wrap: on
line diff
--- a/stage_init.cc Sun Jun 27 22:58:57 2010 +0900 +++ b/stage_init.cc Tue Jun 29 04:25:32 2010 +0900 @@ -1,53 +1,54 @@ #include "dandy.h" -void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h); -void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree); +void +back_move(SceneGraphPtr node, void *sgroot_, int w, int h) +{ + schedule(node, sgroot_, w, h); + node->frame += 1; +} void -createSceneGraphFromProperty(SchedTask *s, void *charactor_, void *b) +back_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) +{ +} + +void +create_title(SchedTask *s, void *charactor_, void *b) { ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; SceneGraphPtr back1, title; back1 = (SceneGraphPtr)charactor[0].parent; title = (SceneGraphPtr)charactor[0].root; - title->xyz[0] = charactor[0].x; title->xyz[1] = charactor[0].y; - title->stack_xyz[0] = charactor[0].vx; - title->stack_xyz[1] = charactor[0].vy; back1->addChild(title); } void -create_title(void *sgroot_, int w, int h, ObjPropertyPtr charactor) +create_back(void *sgroot_, int w, int h) { Viewer *sgroot = (Viewer *)sgroot_; - SceneGraphPtr back1, title; + SceneGraphPtr back; - back1 = sgroot->createSceneGraph(); - sgroot->setSceneData(back1); - - /* createPropertyFromSceneGraph */ - title = sgroot->createSceneGraph("title001"); + back = sgroot->createSceneGraph(); + back->set_move_collision(back_move, back_coll); + sgroot->setSceneData(back); charactor[0].x = w/2; charactor[0].y = h/2; - charactor[0].vx = back1->stack_xyz[0]; - charactor[0].vy = back1->stack_xyz[1]; - //charactor[0].frame = back1->frame; - charactor[0].parent = (void*)back1; - charactor[0].root = (void*)title; + charactor[0].parent = (void*)back; int size = sizeof(ObjPropertyPtr)*16; /* set_game_task(int id, ObjProperty property, int size, PostFunction post_func) */ - /* DataSegment の List を渡すようにする*/ - sgroot->set_game_task(TITLE_MOVE, charactor, size, createSceneGraphFromProperty); + sgroot->set_game_task(TITLE_MOVE, charactor, size, create_title); + } + void create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor) { @@ -56,8 +57,8 @@ SceneGraphPtr stage = sgroot->createSceneGraph(); SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy"); - mydandy->set_move_collision(dandy_move, dandy_coll); - stage->set_move_collision(stage_move, stage_coll); + //mydandy->set_move_collision(dandy_move, dandy_coll); + //stage->set_move_collision(stage_move, stage_coll); mydandy->xyz[0] = w/2; mydandy->xyz[1] = h*0.9; @@ -67,18 +68,3 @@ sgroot->setSceneData(stage); } -void -stage_move(SceneGraphPtr node, void *sgroot_, int w, int h) -{ - - //stage_plan(node, sgroot_, w, h); - node->frame += 1; - -} - -void -stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree) -{ -} - -