Mercurial > hg > Members > koba > t_dandy
comparison Dandy.cc @ 1:b4c797eee72a
task dandy base
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 Dec 2010 04:56:23 +0900 |
parents | 435ac1cdb64e |
children | 6382d8f6a973 |
comparison
equal
deleted
inserted
replaced
0:435ac1cdb64e | 1:b4c797eee72a |
---|---|
25 #include "trace.h" | 25 #include "trace.h" |
26 #include "LoadSprite.h" | 26 #include "LoadSprite.h" |
27 #include <SDL_mixer.h> | 27 #include <SDL_mixer.h> |
28 #include "error.h" | 28 #include "error.h" |
29 #include "matrix_calc.h" | 29 #include "matrix_calc.h" |
30 | 30 #include "task_dandy.h" |
31 #include "Character.h" | 31 #include "Character.h" |
32 #include "Character_state.h" | 32 #include "Character_state.h" |
33 | 33 |
34 int use_keybord = 0; | 34 int use_keybord = 0; |
35 int cdp[20] = { 16, 16, 16, 17, 18, 0 }; | 35 int cdp[20] = { 16, 16, 16, 17, 18, 0 }; |
71 -length Number of data (default DATA_NUM (Func.h))\n\ | 71 -length Number of data (default DATA_NUM (Func.h))\n\ |
72 -count Number of task (default 1)\n"; | 72 -count Number of task (default 1)\n"; |
73 | 73 |
74 static Viewer *sgroot; | 74 static Viewer *sgroot; |
75 | 75 |
76 TaskManager *tmanager; | |
77 | |
76 static int screen_w; | 78 static int screen_w; |
77 static int screen_h; | 79 static int screen_h; |
78 | 80 |
79 MainLoopPtr | 81 MainLoopPtr |
80 Dandy::init(Viewer *sgroot_, int w, int h) | 82 Dandy::init(Viewer *sgroot_, int w, int h) |
81 { | 83 { |
82 screen_w = w; | 84 screen_w = w; |
83 screen_h = h; | 85 screen_h = h; |
84 sgroot = sgroot_; | 86 sgroot = sgroot_; |
87 tmanager = sgroot->manager; | |
85 return sgroot; | 88 return sgroot; |
86 } | 89 } |
87 | 90 |
88 Application * | 91 Application * |
89 application() { | 92 application() { |
116 case 2: gamef= opening(gamef); break; | 119 case 2: gamef= opening(gamef); break; |
117 case 3: gamef= dandy_main_loop(gamef); break; | 120 case 3: gamef= dandy_main_loop(gamef); break; |
118 case 4: gamef= dandy_closing(gamef); break; | 121 case 4: gamef= dandy_closing(gamef); break; |
119 } | 122 } |
120 return next; | 123 return next; |
121 }; | 124 }; |
122 | 125 |
123 | 126 |
124 | 127 |
125 | 128 |
126 static void | 129 static void |
146 | 149 |
147 static int light_sysswitch = 1; | 150 static int light_sysswitch = 1; |
148 static int light_num = 4; | 151 static int light_num = 4; |
149 | 152 |
150 static void | 153 static void |
151 LightSysSwitch(Viewer *sgroot) { | 154 _LightSysSwitch(Viewer *sgroot) { |
152 if (light_sysswitch == 1) { | 155 if (light_sysswitch == 1) { |
153 sgroot->OnLightSysSwitch(); | 156 sgroot->OnLightSysSwitch(); |
154 for (int i = 0; i < light_num; i++) { | 157 for (int i = 0; i < light_num; i++) { |
155 SceneGraphPtr light = sgroot->getLight(i); | 158 SceneGraphPtr light = sgroot->getLight(i); |
156 sgroot->OnLightSwitch(i); | 159 sgroot->OnLightSwitch(i); |
178 sgroot->createFromXMLfile("xml/character.xml"); | 181 sgroot->createFromXMLfile("xml/character.xml"); |
179 sgroot->createFromXMLfile("xml/font.xml"); | 182 sgroot->createFromXMLfile("xml/font.xml"); |
180 sgroot->createFromXMLfile("xml/effect.xml"); | 183 sgroot->createFromXMLfile("xml/effect.xml"); |
181 sgroot->createFromXMLfile("xml/boss.xml"); | 184 sgroot->createFromXMLfile("xml/boss.xml"); |
182 | 185 |
183 LightSysSwitch(sgroot); | 186 _LightSysSwitch(sgroot); |
184 | 187 |
185 | 188 |
186 init_sprite(0,0,0,0); | 189 init_sprite(0,0,0,0); |
187 | 190 |
188 __debug("syokikaが呼びだされました\n"); | 191 __debug("syokikaが呼びだされました\n"); |
214 // 音楽ファイルの読み込み | 217 // 音楽ファイルの読み込み |
215 LoadSdlMixer(); | 218 LoadSdlMixer(); |
216 | 219 |
217 // ボリューム調整 | 220 // ボリューム調整 |
218 InitVolume(); | 221 InitVolume(); |
219 | 222 |
220 // 音出しテスト | 223 // 音出しテスト |
221 PlaySdlMixer(-1, BGM); | 224 PlaySdlMixer(-1, BGM); |
222 | 225 |
223 if(!(init_chara_list(1024))){ | 226 if(!(init_chara_list(1024))){ |
224 __debug("failed to init_chara_list\n"); | 227 __debug("failed to init_chara_list\n"); |
267 gamef = 4; | 270 gamef = 4; |
268 } | 271 } |
269 flip(); | 272 flip(); |
270 | 273 |
271 //SDL_FillRect(screen, NULL, background); | 274 //SDL_FillRect(screen, NULL, background); |
272 | 275 |
273 schedule(); | 276 schedule(); |
274 enemyfaste = count; | 277 enemyfaste = count; |
275 | 278 |
276 // timeprof_begin(timeprof_move); | 279 // timeprof_begin(timeprof_move); |
277 //Move(); //enemy move | 280 //Move(); //enemy move |