changeset 10:27d3291a7c82

fix
author tkaito
date Tue, 13 Jul 2010 18:09:25 +0900
parents dea6d34c8e91
children 8c7a2e7cb9e0
files dandy.h main.cc schedule.cc stage_init.cc
diffstat 4 files changed, 33 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/dandy.h	Mon Jul 12 04:39:50 2010 +0900
+++ b/dandy.h	Tue Jul 13 18:09:25 2010 +0900
@@ -46,11 +46,11 @@
 static const float shot_speed = 30.0f;
 static const float shot_radius = 42.4f;
 
-extern void title_move(SceneGraphPtr node, void *sgroot_, int w, int h);
-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_back(void *sgroot, int w, int h);
+//extern void title_move(SceneGraphPtr node, void *sgroot_, int w, int h);
+//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_stage(void *sgroot, int w, int h);
 extern void schedule(SceneGraphPtr node, void *sgroot_, int w, int h);
 
--- a/main.cc	Mon Jul 12 04:39:50 2010 +0900
+++ b/main.cc	Tue Jul 13 18:09:25 2010 +0900
@@ -50,7 +50,7 @@
 {
   charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjPropertyPtr)*16);
   init_charactor(sgroot);
-  create_back(sgroot, w, h);
+  create_title_back(sgroot, w, h);
 
   return sgroot;
 }
--- a/schedule.cc	Mon Jul 12 04:39:50 2010 +0900
+++ b/schedule.cc	Tue Jul 13 18:09:25 2010 +0900
@@ -11,6 +11,7 @@
   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()) {
@@ -18,6 +19,7 @@
       //node->children->remove();
     }
   }
+  */
 
   if(back_property.flag == 1) {
   switch (node->frame) {
@@ -286,7 +288,7 @@
   //e->dt1 = e->dt2 = 0;
   //e->tama = tf;
 
-  int size = sizeof(ObjPropertyPtr)*16;
+  int size = sizeof(ObjProperty)*16;
   //printf("size = %d\n", size);
   sgroot->set_move_task(obj, move, (void*)e, size, create_enemy);
 }
--- a/stage_init.cc	Mon Jul 12 04:39:50 2010 +0900
+++ b/stage_init.cc	Tue Jul 13 18:09:25 2010 +0900
@@ -1,21 +1,5 @@
 #include "dandy.h"
 
-void
-back_move(SceneGraphPtr node, void *sgroot_, int w, int h)
-{
-  Viewer *sgroot = (Viewer *)sgroot_;
-
-  schedule(node, sgroot, w, h);
-  node->frame += 1;
-  //printf("frame = %d\n", node->frame);
-  //sgroot->setSceneData(node); // 描画し直し。
-  
-}
-
-void
-back_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree)
-{
-}
 
 void
 create_title(SchedTask *s, void *charactor_, void *b)
@@ -31,20 +15,41 @@
   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_back(void *sgroot_, int w, int h) 
+create_title_back(void *sgroot_, int w, int h) 
 {
   Viewer *sgroot = (Viewer *)sgroot_;
   SceneGraphPtr back;
   back_property.flag = 0;
 
   back = sgroot->createSceneGraph();
-  back->set_move_collision(back_move, back_coll);
+  //back->set_move_collision(back_move, back_coll);
+  sgroot->setSceneData(back);
 
-  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;
+  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);
 }