2
|
1 #include "dandy.h"
|
|
2
|
|
3 void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h);
|
|
4 void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree);
|
|
5
|
|
6 void
|
3
|
7 createSceneGraphFromProperty(SchedTask *s, void *charactor_, void *b)
|
|
8 {
|
|
9 ObjPropertyPtr charactor1 = (ObjPropertyPtr)charactor;
|
|
10 printf("charactor.x = %f\n", charactor1[0].x);
|
|
11 }
|
|
12
|
|
13
|
|
14 void
|
2
|
15 create_title(void *sgroot_, int w, int h)
|
|
16 {
|
3
|
17 TaskManager *manager;
|
2
|
18 Viewer *sgroot = (Viewer *)sgroot_;
|
3
|
19 SceneGraphPtr back1; //title;
|
|
20
|
|
21 back1 = sgroot->createSceneGraph();
|
|
22 //back->set_move_collision(back_move, back_coll);
|
|
23 sgroot->setSceneData(back1);
|
|
24
|
|
25 /* createPropertyFromSceneGraph */
|
|
26 charactor[0].x = back1->xyz[0];
|
|
27 charactor[0].y = back1->xyz[1];
|
|
28 charactor[0].vx = back1->stack_xyz[0];
|
|
29 charactor[0].vy = back1->stack_xyz[1];
|
|
30 charactor[0].frame = back1->frame;
|
2
|
31
|
3
|
32 /* set_game_task */
|
|
33 HTask *back;
|
|
34 back = manager->create_task(TITLE_MOVE);
|
|
35 back->set_cpu(SPE_ANY);
|
|
36 back->add_inData((char*)charactor, sizeof(ObjProperty));
|
|
37 back->add_outData(charactor, sizeof(ObjProperty));
|
|
38 back->add_param((memaddr)1);
|
|
39 back->set_post(createSceneGraphFromProperty, (void*)charactor, 0);
|
|
40 //back->set_post(test, (void*)charactor, 0);
|
|
41 back->spawn();
|
|
42 }
|
2
|
43
|
3
|
44 //createSceneGraphFromProperty(ObjProperty charactor);
|
|
45
|
|
46
|
|
47 //title = sgroot->createSceneGraph("title001");
|
|
48 //title->xyz[0] = w/2;
|
|
49 //title->xyz[1] = h/2;
|
|
50 //back->addChild(title);
|
|
51
|
|
52
|
|
53 //title->set_move_collision(title_move, title_coll);
|
|
54
|
|
55
|
|
56
|
2
|
57
|
|
58 void
|
|
59 create_stage(void *sgroot_, int w, int h)
|
|
60 {
|
|
61 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
62
|
|
63 SceneGraphPtr stage = sgroot->createSceneGraph();
|
|
64 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
|
|
65
|
|
66 mydandy->set_move_collision(dandy_move, dandy_coll);
|
|
67 stage->set_move_collision(stage_move, stage_coll);
|
|
68
|
|
69 mydandy->xyz[0] = w/2;
|
|
70 mydandy->xyz[1] = h*0.9;
|
|
71 mydandy->xyz[2] = 0.0f;
|
|
72
|
|
73 stage->addChild(mydandy);
|
|
74 sgroot->setSceneData(stage);
|
|
75 }
|
|
76
|
|
77 void
|
|
78 stage_move(SceneGraphPtr node, void *sgroot_, int w, int h)
|
|
79 {
|
|
80
|
|
81 //stage_plan(node, sgroot_, w, h);
|
|
82 node->frame += 1;
|
|
83
|
|
84 }
|
|
85
|
|
86 void
|
|
87 stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree)
|
|
88 {
|
|
89 }
|
|
90
|
|
91
|