Mercurial > hg > Members > tkaito > task_dandy
annotate main.cc @ 7:c015109a6041
schedule add. 10% done.
author | tkaito |
---|---|
date | Tue, 29 Jun 2010 04:25:32 +0900 |
parents | 661ec1e92042 |
children | 7c60ef3fca5b |
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 | 2 |
3 extern void task_init(void); | |
4 | |
6 | 5 //TaskManager *manager; |
0 | 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 | 10 |
1
7dc2d920fc7c
local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
0
diff
changeset
|
11 int |
0 | 12 init(int argc, char **argv) |
13 { | |
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 | 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 | 18 //task = atoi(argv[++i]); |
0 | 19 } |
20 } | |
21 | |
22 return 0; | |
23 } | |
24 | |
2 | 25 #define ENEMY_STATUS(charano,score,hardness) {charano,score,hardness} |
6 | 26 const state status[50] = ENEMY_STATUS_TABLE; |
2 | 27 |
28 void | |
7 | 29 init_charactor(Viewer *sgroot) |
2 | 30 { |
31 sgroot->createFromXMLfile("xml/mydandy.xml"); | |
32 sgroot->createFromXMLfile("xml/gameover.xml"); | |
33 sgroot->createFromXMLfile("xml/greencrab.xml"); | |
34 sgroot->createFromXMLfile("xml/bluebullet.xml"); | |
35 sgroot->createFromXMLfile("xml/redbullet.xml"); | |
36 sgroot->createFromXMLfile("xml/title2.xml"); | |
37 | |
38 for (int i = 0; i < ENEMY_NUM; i++) { | |
7 | 39 charactor[0].root = (void*)sgroot->createSceneGraph(status[0].charano); |
40 charactor[0].score = status[0].score; | |
41 charactor[0].vital = status[0].vital; | |
4 | 42 } |
2 | 43 |
44 } | |
1
7dc2d920fc7c
local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
0
diff
changeset
|
45 |
7 | 46 ObjPropertyPtr charactor; |
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 | 51 charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjPropertyPtr)*16); |
52 init_charactor(sgroot); | |
53 create_back(sgroot, w, h); | |
4 | 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 | 67 int |
68 TMmain(TaskManager *manager,int argc, char *argv[]) | |
69 { | |
6 | 70 /* |
0 | 71 if (init(argc, argv) < 0) { |
72 return -1; | |
73 } | |
6 | 74 */ |
0 | 75 // Task Register |
76 // ppe/task_init.cc | |
77 task_init(); | |
1
7dc2d920fc7c
local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
0
diff
changeset
|
78 /* |
0 | 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 | 81 } |
1
7dc2d920fc7c
local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
0
diff
changeset
|
82 */ |
3 | 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 | 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 | 93 } |