comparison TaskDandy.cc @ 57:978097c6427a

bug fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Sat, 29 Jan 2011 22:43:17 +0900
parents 2c33aa6a4a37
children e0018f39f7e1
comparison
equal deleted inserted replaced
56:a80422eb44a9 57:978097c6427a
29 #include "matrix_calc.h" 29 #include "matrix_calc.h"
30 #include "Character.h" 30 #include "Character.h"
31 #include "Character_state.h" 31 #include "Character_state.h"
32 #include "property.h" 32 #include "property.h"
33 #include "collision_task.h" 33 #include "collision_task.h"
34 #include "state_task.h"
34 #include "StateList.h" 35 #include "StateList.h"
35 #include "Cheat.h" 36 #include "Cheat.h"
36 #include "debug_db.h" 37 #include "debug_db.h"
37 38
38 39
106 107
107 static void print_usage(); 108 static void print_usage();
108 static int get_option(int argc, char *argv[]); 109 static int get_option(int argc, char *argv[]);
109 static int opening(int gamef); 110 static int opening(int gamef);
110 static int dandy_closing(int gamef); 111 static int dandy_closing(int gamef);
111 static int dandy_main_loop(int gamef); 112 static int dandy_main_loop(int gamef, HTaskPtr next);
112 static int dandy_main_init(int gamef); 113 static int dandy_main_init(int gamef);
113 extern int init(TaskManager *manager, int argc, char *argv[]); 114 extern int init(TaskManager *manager, int argc, char *argv[]);
114 extern void task_initialize(); 115 extern void task_initialize();
115 static void TMend(TaskManager *manager); 116 static void TMend(TaskManager *manager);
116 117
126 // printf("gamef = %d\n",gamef); 127 // printf("gamef = %d\n",gamef);
127 switch (gamef) { 128 switch (gamef) {
128 case 0: gamef= dandy_main_init(gamef); break; 129 case 0: gamef= dandy_main_init(gamef); break;
129 case 1: gamef= gamesyokika(gamef); break; 130 case 1: gamef= gamesyokika(gamef); break;
130 case 2: gamef= opening(gamef); break; 131 case 2: gamef= opening(gamef); break;
131 case 3: gamef= dandy_main_loop(gamef); break; 132 case 3: gamef= dandy_main_loop(gamef, next); break;
132 case 4: gamef= dandy_closing(gamef); break; 133 case 4: gamef= dandy_closing(gamef); break;
133 } 134 }
134 return next; 135 return next;
135 }; 136 };
136 137
320 sgroot->setSceneData(root); 321 sgroot->setSceneData(root);
321 } 322 }
322 323
323 324
324 static int 325 static int
325 dandy_main_loop(int gamef) 326 dandy_main_loop(int gamef, HTaskPtr next)
326 { 327 {
327 if ((pad[0].l1 != 0) && (pad[0].r1 != 0) && 328 if ((pad[0].l1 != 0) && (pad[0].r1 != 0) &&
328 (pad[0].l2 != 0) && (pad[0].r2 != 0)) { 329 (pad[0].l2 != 0) && (pad[0].r2 != 0)) {
329 gamef = gamesyokika(gamef); 330 gamef = gamesyokika(gamef);
330 } 331 }
351 asteroidi = 0; 352 asteroidi = 0;
352 // timeprof_begin(timeprof_move); 353 // timeprof_begin(timeprof_move);
353 outofwindow(); 354 outofwindow();
354 // timeprof_end(timeprof_move); 355 // timeprof_end(timeprof_move);
355 356
357 HTaskPtr state_next = create_next();
358
356 state_update(); 359 state_update();
357 360
358 HTaskPtr update = collision_update(); 361 HTaskPtr update = collision_update();
359 HTaskPtr reflect = collision_reflect(); 362 HTaskPtr reflect = collision_reflect();
363
360 collision_detect(); 364 collision_detect();
365
366 next->wait_for(state_next);
367 next->wait_for(reflect);
368
369 state_next->spawn();
361 update->spawn(); 370 update->spawn();
362 reflect->spawn(); 371 reflect->spawn();
363
364 372
365 //charpatern(); 373 //charpatern();
366 //bosguage(); 374 //bosguage();
367 375
368 //count++; 376 //count++;
372 //PutSprite(count, 0, 0, 48); 380 //PutSprite(count, 0, 0, 48);
373 381
374 obj_draw(); 382 obj_draw();
375 gamef = game_pause(gamef); 383 gamef = game_pause(gamef);
376 384
385 KeyAssign(runmode, t_buff, joy, pad);
386
377 filpcount++; 387 filpcount++;
378 count = 0; 388 count = 0;
379
380 KeyAssign(runmode, t_buff, joy, pad);
381 389
382 return gamef; 390 return gamef;
383 } 391 }
384 392
385 static int 393 static int