Mercurial > hg > Members > kono > tree_dandy2
comparison Dandy.cc @ 8:5c405fb3b164
main routine for Cerium
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 23:13:25 +0900 |
parents | 972a7f233b23 |
children | c88a4f98b5ef |
comparison
equal
deleted
inserted
replaced
7:972a7f233b23 | 8:5c405fb3b164 |
---|---|
7 | 7 |
8 | 8 |
9 MainLoopPtr | 9 MainLoopPtr |
10 Dandy::init(Viewer *sgroot, int w, int h) | 10 Dandy::init(Viewer *sgroot, int w, int h) |
11 { | 11 { |
12 init_charactor(sgroot, w, h); | |
13 init_game(sgroot, w, h); | |
14 | |
15 return sgroot; | 12 return sgroot; |
16 } | 13 } |
17 | 14 |
18 extern Application * | 15 Application * |
19 Dandy::application() { | 16 Dandy::application() { |
20 return new Dandy(); | 17 return new Dandy(); |
21 } | 18 } |
22 | 19 |
23 Viewer *sg_root; | 20 Viewer *sgroot; |
24 | 21 |
25 static int dandy_closing(int gamef); | 22 static int dandy_closing(int gamef); |
26 static int dandy_main_lop(int gamef); | 23 static int dandy_main_loop(int gamef); |
27 static int dandy_main_init(int gamef); | 24 static int dandy_main_init(int gamef); |
28 | 25 |
29 extern bool | 26 bool |
30 Dandy::app_main(Viewer *viewer){ | 27 Dandy::app_main(Viewer *viewer){ |
31 sg_root = viewer; | 28 sgroot = viewer; |
32 // don't use allExecute | 29 // don't use allExecute |
33 return 0; | 30 return 0; |
34 }; | 31 }; |
35 | 32 |
36 exern HTaskPtr | 33 HTaskPtr |
37 Dandy::application_task(HTaskPtr next, Viewer* viewer){ | 34 Dandy::application_task(HTaskPtr next, Viewer* viewer){ |
38 int gamef = 0; | 35 int gamef = 0; |
39 | 36 |
40 switch (gamef) { | 37 switch (gamef) { |
41 case 0: gamef= danday_opening(gamef); break; | 38 case 0: gamef= dandy_main_init(gamef); break; |
42 case 1: gamef= danday_main_loop(gamef); break; | 39 case 1: gamef= dandy_main_loop(gamef); break; |
43 case 2: gamef= danday_closing(gamef); break; | 40 case 2: gamef= dandy_closing(gamef); break; |
44 } | 41 } |
45 return next; | 42 return next; |
46 }; | 43 }; |
47 | 44 |
48 | 45 |
213 | 210 |
214 return 1; | 211 return 1; |
215 } | 212 } |
216 | 213 |
217 static int | 214 static int |
218 dandy_main_lop(int gamef) | 215 dandy_main_loop(int gamef) |
219 { | 216 { |
220 viewer->sgroot->flip(); | 217 viewer->sgroot->flip(); |
221 viewer->sgroot->lightCalc(); | 218 viewer->sgroot->lightCalc(); |
222 | 219 |
223 | 220 |