2
|
1 #include <math.h>
|
|
2 #include "SceneGraphRoot.h"
|
|
3 #include "dandy.h"
|
|
4
|
|
5 void
|
|
6 title_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
|
|
7 {
|
|
8
|
|
9 }
|
|
10
|
|
11 MainLoopPtr
|
|
12 dandy::init(Viewer *sgroot, int w, int h)
|
|
13 {
|
|
14 SceneGraphPtr back, title;
|
|
15
|
4
|
16 sgroot->createFromXMLfile("xml/mydandy.xml");
|
|
17 sgroot->createFromXMLfile("xml/title2.xml");
|
|
18 sgroot->createFromXMLfile("xml/gameover.xml");
|
|
19 sgroot->createFromXMLfile("xml/enemy_greenclab.xml");
|
|
20
|
2
|
21
|
|
22 back = sgroot->createSceneGraph();
|
|
23 title = sgroot->createSceneGraph("title001");
|
|
24 title->xyz[0] = w/2;
|
|
25 title->xyz[1] = h/2;
|
|
26 title->set_move_collision(title_idle, title_collision);
|
|
27 back->addChild(title);
|
|
28
|
|
29 sgroot->setSceneData(back);
|
|
30
|
|
31 //mydandy = sgroot->getSgid("mydandy01");
|
|
32 //enemy = sgroot->getSgid("ENEMY");
|
|
33
|
|
34 return sgroot;
|
|
35 }
|
|
36
|
|
37 extern Application *
|
|
38 application() {
|
|
39 return new dandy();
|
|
40 }
|
|
41
|
|
42 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
|
|
43
|
|
44 extern int init(TaskManager *manager, int argc, char *argv[]);
|
|
45 extern void task_initialize();
|
|
46 static void TMend(TaskManager *manager);
|
|
47
|
|
48 int
|
|
49 TMmain(TaskManager *manager, int argc, char *argv[])
|
|
50 {
|
|
51 task_initialize();
|
|
52 manager->set_TMend(TMend);
|
|
53 return init(manager, argc, argv);
|
|
54
|
|
55 }
|
|
56
|
|
57 void
|
|
58 TMend(TaskManager *manager)
|
|
59 {
|
|
60 printf("game end\n");
|
|
61 }
|