2
|
1 #include "dandy.h"
|
|
2
|
7
|
3
|
|
4 void
|
|
5 create_title(SchedTask *s, void *charactor_, void *b)
|
3
|
6 {
|
5
|
7 ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_;
|
|
8 SceneGraphPtr back1, title;
|
|
9 back1 = (SceneGraphPtr)charactor[0].parent;
|
|
10 title = (SceneGraphPtr)charactor[0].root;
|
4
|
11
|
5
|
12 title->xyz[0] = charactor[0].x;
|
|
13 title->xyz[1] = charactor[0].y;
|
|
14
|
|
15 back1->addChild(title);
|
|
16
|
4
|
17 }
|
10
|
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 */
|
4
|
30
|
8
|
31 ObjProperty back_property;
|
|
32
|
3
|
33 void
|
10
|
34 create_title_back(void *sgroot_, int w, int h)
|
2
|
35 {
|
|
36 Viewer *sgroot = (Viewer *)sgroot_;
|
7
|
37 SceneGraphPtr back;
|
9
|
38 back_property.flag = 0;
|
3
|
39
|
7
|
40 back = sgroot->createSceneGraph();
|
10
|
41 //back->set_move_collision(back_move, back_coll);
|
|
42 sgroot->setSceneData(back);
|
9
|
43
|
10
|
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);
|
3
|
53 }
|
2
|
54
|
7
|
55
|
2
|
56 void
|
4
|
57 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)
|
2
|
58 {
|
|
59 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
60
|
|
61 SceneGraphPtr stage = sgroot->createSceneGraph();
|
|
62 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
|
|
63
|
7
|
64 //mydandy->set_move_collision(dandy_move, dandy_coll);
|
|
65 //stage->set_move_collision(stage_move, stage_coll);
|
2
|
66
|
|
67 mydandy->xyz[0] = w/2;
|
|
68 mydandy->xyz[1] = h*0.9;
|
|
69 mydandy->xyz[2] = 0.0f;
|
|
70
|
|
71 stage->addChild(mydandy);
|
|
72 sgroot->setSceneData(stage);
|
|
73 }
|
|
74
|