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 }
|
|
18
|
8
|
19 ObjProperty back_property;
|
|
20
|
3
|
21 void
|
11
|
22 create_title_back(Viewer *sgroot_, int w, int h)
|
2
|
23 {
|
11
|
24 Viewer *sgroot = sgroot_;
|
7
|
25 SceneGraphPtr back;
|
9
|
26 back_property.flag = 0;
|
3
|
27
|
7
|
28 back = sgroot->createSceneGraph();
|
10
|
29 sgroot->setSceneData(back);
|
9
|
30
|
10
|
31 SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
|
11
|
32 ObjProperty titlep;
|
|
33 titlep.x = w/2;
|
|
34 titlep.y = h/2;
|
|
35 titlep.root = (void*)title;
|
|
36 titlep.parent = (void*)back;
|
10
|
37 int size = sizeof(ObjProperty)*16;
|
11
|
38 sgroot->set_move_task(title, TITLE_MOVE, (void*)&titlep, size, create_title);
|
3
|
39 }
|
2
|
40
|
7
|
41
|
2
|
42 void
|
4
|
43 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)
|
2
|
44 {
|
|
45 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
46
|
|
47 SceneGraphPtr stage = sgroot->createSceneGraph();
|
|
48 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
|
|
49
|
7
|
50 //mydandy->set_move_collision(dandy_move, dandy_coll);
|
|
51 //stage->set_move_collision(stage_move, stage_coll);
|
2
|
52
|
|
53 mydandy->xyz[0] = w/2;
|
|
54 mydandy->xyz[1] = h*0.9;
|
|
55 mydandy->xyz[2] = 0.0f;
|
|
56
|
|
57 stage->addChild(mydandy);
|
|
58 sgroot->setSceneData(stage);
|
|
59 }
|
|
60
|