changeset 11:8c7a2e7cb9e0

test
author tkaito
date Sat, 17 Jul 2010 14:12:53 +0900
parents 27d3291a7c82
children aecc2199251e
files dandy.h main.cc stage_init.cc
diffstat 3 files changed, 12 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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;
 }
 
--- 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);
 }