comparison stage_init.cc @ 10:27d3291a7c82

fix
author tkaito
date Tue, 13 Jul 2010 18:09:25 +0900
parents dea6d34c8e91
children 8c7a2e7cb9e0
comparison
equal deleted inserted replaced
9:dea6d34c8e91 10:27d3291a7c82
1 #include "dandy.h" 1 #include "dandy.h"
2 2
3 void
4 back_move(SceneGraphPtr node, void *sgroot_, int w, int h)
5 {
6 Viewer *sgroot = (Viewer *)sgroot_;
7
8 schedule(node, sgroot, w, h);
9 node->frame += 1;
10 //printf("frame = %d\n", node->frame);
11 //sgroot->setSceneData(node); // 描画し直し。
12
13 }
14
15 void
16 back_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree)
17 {
18 }
19 3
20 void 4 void
21 create_title(SchedTask *s, void *charactor_, void *b) 5 create_title(SchedTask *s, void *charactor_, void *b)
22 { 6 {
23 ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; 7 ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_;
29 title->xyz[1] = charactor[0].y; 13 title->xyz[1] = charactor[0].y;
30 14
31 back1->addChild(title); 15 back1->addChild(title);
32 16
33 } 17 }
18 /*
19 void
20 title_move(SceneGraphPtr node, void *sgroot_, int w, int h)
21 {
22 sgroot->set_move_task(obj, TITLE_MOVE, (void*)property, size, create_title);
23 }
24
25 void
26 title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree)
27 {
28 }
29 */
34 30
35 ObjProperty back_property; 31 ObjProperty back_property;
36 32
37 void 33 void
38 create_back(void *sgroot_, int w, int h) 34 create_title_back(void *sgroot_, int w, int h)
39 { 35 {
40 Viewer *sgroot = (Viewer *)sgroot_; 36 Viewer *sgroot = (Viewer *)sgroot_;
41 SceneGraphPtr back; 37 SceneGraphPtr back;
42 back_property.flag = 0; 38 back_property.flag = 0;
43 39
44 back = sgroot->createSceneGraph(); 40 back = sgroot->createSceneGraph();
45 back->set_move_collision(back_move, back_coll); 41 //back->set_move_collision(back_move, back_coll);
42 sgroot->setSceneData(back);
46 43
47 sgroot->setSceneData(back); 44 SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
45 ObjPropertyPtr titlep;
46 titlep->x = w/2;
47 titlep->y = h/2;
48 titlep->root = (void*)title;
49 titlep->parent = (void*)back;
50 int size = sizeof(ObjProperty)*16;
51 //sgroot->set_move_property(title, title_move, (void*)property, size);
52 sgroot->set_move_task(title, TITLE_MOVE, (void*)titlep, size, create_title);
48 } 53 }
49 54
50 55
51 void 56 void
52 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor) 57 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)