# HG changeset patch # User tkaito # Date 1279343573 -32400 # Node ID 8c7a2e7cb9e0de68e39cb0e349078784ee191c08 # Parent 27d3291a7c8235bfb628a445120ef0fc62b08d6e test diff -r 27d3291a7c82 -r 8c7a2e7cb9e0 dandy.h --- a/dandy.h Tue Jul 13 18:09:25 2010 +0900 +++ b/dandy.h Sat Jul 17 14:12:53 2010 +0900 @@ -50,7 +50,7 @@ //extern void title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree); //extern void dandy_move(SceneGraphPtr node, void *sgroot_, int w, int h); //extern void dandy_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree); -extern void create_title_back(void *sgroot, int w, int h); +extern void create_title_back(Viewer *sgroot, int w, int h); extern void create_stage(void *sgroot, int w, int h); extern void schedule(SceneGraphPtr node, void *sgroot_, int w, int h); diff -r 27d3291a7c82 -r 8c7a2e7cb9e0 main.cc --- a/main.cc Tue Jul 13 18:09:25 2010 +0900 +++ b/main.cc Sat Jul 17 14:12:53 2010 +0900 @@ -26,7 +26,7 @@ const state status[50] = ENEMY_STATUS_TABLE; void -init_charactor(Viewer *sgroot) +init_charactor(Viewer *sgroot, int w, int h) { sgroot->createFromXMLfile("xml/mydandy.xml"); sgroot->createFromXMLfile("xml/gameover.xml"); @@ -40,7 +40,7 @@ charactor[i].score = status[i].score; charactor[i].vital = status[i].vital; } - + create_title_back(sgroot, w, h); } ObjPropertyPtr charactor; @@ -49,9 +49,7 @@ dandy::init(Viewer *sgroot, int w, int h) { charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjPropertyPtr)*16); - init_charactor(sgroot); - create_title_back(sgroot, w, h); - + init_charactor(sgroot, w, h); return sgroot; } diff -r 27d3291a7c82 -r 8c7a2e7cb9e0 stage_init.cc --- a/stage_init.cc Tue Jul 13 18:09:25 2010 +0900 +++ b/stage_init.cc Sat Jul 17 14:12:53 2010 +0900 @@ -15,41 +15,27 @@ back1->addChild(title); } -/* -void -title_move(SceneGraphPtr node, void *sgroot_, int w, int h) -{ - sgroot->set_move_task(obj, TITLE_MOVE, (void*)property, size, create_title); -} - -void -title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) -{ -} -*/ ObjProperty back_property; void -create_title_back(void *sgroot_, int w, int h) +create_title_back(Viewer *sgroot_, int w, int h) { - Viewer *sgroot = (Viewer *)sgroot_; + Viewer *sgroot = sgroot_; SceneGraphPtr back; back_property.flag = 0; back = sgroot->createSceneGraph(); - //back->set_move_collision(back_move, back_coll); sgroot->setSceneData(back); SceneGraphPtr title = (SceneGraphPtr)charactor[0].root; - ObjPropertyPtr titlep; - titlep->x = w/2; - titlep->y = h/2; - titlep->root = (void*)title; - titlep->parent = (void*)back; + ObjProperty titlep; + titlep.x = w/2; + titlep.y = h/2; + titlep.root = (void*)title; + titlep.parent = (void*)back; int size = sizeof(ObjProperty)*16; - //sgroot->set_move_property(title, title_move, (void*)property, size); - sgroot->set_move_task(title, TITLE_MOVE, (void*)titlep, size, create_title); + sgroot->set_move_task(title, TITLE_MOVE, (void*)&titlep, size, create_title); }