annotate main.cc @ 8:7c60ef3fca5b

test
author tkaito
date Wed, 07 Jul 2010 03:11:52 +0900
parents c015109a6041
children 27d3291a7c82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
1 #include "dandy.h"
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
2
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
3 extern void task_init(void);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
4
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
5 //TaskManager *manager;
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
6
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
7 const char *usr_help_str = "Usage: ./twice [-length data_length] [-count task_num]\n\
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
8 -length Number of data (default DATA_NUM (Func.h))\n\
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
9 -count Number of task (default 1)\n";
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
10
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
11 int
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
12 init(int argc, char **argv)
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
13 {
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
14 for (int i = 1; argv[i]; ++i) {
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
15 if (strcmp(argv[i], "-length") == 0) {
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
16 //length = atoi(argv[++i]);
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
17 } else if (strcmp(argv[i], "-count") == 0) {
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
18 //task = atoi(argv[++i]);
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
19 }
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
20 }
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
21
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
22 return 0;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
23 }
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
24
2
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
25 #define ENEMY_STATUS(charano,score,hardness) {charano,score,hardness}
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
26 const state status[50] = ENEMY_STATUS_TABLE;
2
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
27
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
28 void
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
29 init_charactor(Viewer *sgroot)
2
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
30 {
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
31 sgroot->createFromXMLfile("xml/mydandy.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
32 sgroot->createFromXMLfile("xml/gameover.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
33 sgroot->createFromXMLfile("xml/greencrab.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
34 sgroot->createFromXMLfile("xml/bluebullet.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
35 sgroot->createFromXMLfile("xml/redbullet.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
36 sgroot->createFromXMLfile("xml/title2.xml");
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
37
8
tkaito
parents: 7
diff changeset
38 for (int i = 0; i < 2; i++) {
tkaito
parents: 7
diff changeset
39 charactor[i].root = (void*)sgroot->createSceneGraph(status[i].charano);
tkaito
parents: 7
diff changeset
40 charactor[i].score = status[i].score;
tkaito
parents: 7
diff changeset
41 charactor[i].vital = status[i].vital;
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
42 }
2
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
43
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
44 }
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
45
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
46 ObjPropertyPtr charactor;
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
47
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
48 MainLoopPtr
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
49 dandy::init(Viewer *sgroot, int w, int h)
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
50 {
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
51 charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjPropertyPtr)*16);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
52 init_charactor(sgroot);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
53 create_back(sgroot, w, h);
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
54
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
55 return sgroot;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
56 }
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
57
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
58 extern Application *
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
59 application() {
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
60 return new dandy();
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
61 }
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
62
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
63 extern int init(TaskManager *manager, int argc, char *argv[]);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
64 extern void task_initialize();
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
65 static void TMend(TaskManager *manager);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
66
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
67 int
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
68 TMmain(TaskManager *manager,int argc, char *argv[])
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
69 {
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
70 /*
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
71 if (init(argc, argv) < 0) {
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
72 return -1;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
73 }
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 4
diff changeset
74 */
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
75 // Task Register
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
76 // ppe/task_init.cc
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
77 task_init();
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
78 /*
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
79 for (int i = 0; i < task; ++i) {
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
80 twice_init(manager);
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
81 }
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
82 */
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
83 //create_title(sgroot, w, h);
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
84 task_initialize();
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
85 manager->set_TMend(TMend);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
86 return init(manager,argc, argv);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
87 }
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
88
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
89 void
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
90 TMend(TaskManager *manager)
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
91 {
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents: 0
diff changeset
92 printf("game end\n");
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
93 }