# HG changeset patch # User gongo # Date 1162628926 0 # Node ID f60cb9a39d7ac955b70df75a1dccffc75c2e119a # Parent f7a5aeed1292a066847220e9edff12284636ebdd *** empty log message *** diff -r f7a5aeed1292 -r f60cb9a39d7a game.h --- a/game.h Sat Nov 04 08:15:16 2006 +0000 +++ b/game.h Sat Nov 04 08:28:46 2006 +0000 @@ -18,12 +18,12 @@ typedef struct game { GAME_STATE state; + void (*exec)(); CarPtr jiki; int course_id; // コースID int car_id; // 自機ID int camera_type; // カメラのタイプ int select; // 選択用変数?いらないか - int demo_flg; // (demo_flg == 0) ? 通常モード : デモモード int play_id; int rap; } Game, *GamePtr; diff -r f7a5aeed1292 -r f60cb9a39d7a schedule.c --- a/schedule.c Sat Nov 04 08:15:16 2006 +0000 +++ b/schedule.c Sat Nov 04 08:28:46 2006 +0000 @@ -116,6 +116,9 @@ game_env_init(); graphic_init(); camera_init(); + + game.state = GAME_SELECT_CAR; + game.exec = sche_game_opening; } void @@ -131,6 +134,7 @@ if (pad.st == 1) { game.state = GAME_SELECT_CAR; + game.exec = sche_game_select_car; } /* @@ -169,6 +173,7 @@ } if (pad.circle == 1) { game.state = GAME_SELECT_COURSE; + game.exec = sche_game_select_course; } } @@ -191,6 +196,7 @@ } if (pad.circle == 1) { game.state = GAME_READY; + game.exec = sche_game_ready; } } @@ -211,9 +217,11 @@ if (pad.st > 0) { game.state = GAME_MAIN_INIT; + game.exec = sche_game_main_init; } if (pad.cross > 0) { game.state = GAME_SELECT_CAR; + game.exec = sche_game_select_car; } } @@ -224,6 +232,7 @@ play_init(); RUNNIG=0; game.state = GAME_MAIN; + game.exec = sche_game_main; } void @@ -264,6 +273,7 @@ wait_init(); ranking = 1; game.state = GAME_GOAL; + game.exec = sche_game_main_goal; } gFont_SetStringInt((int)(100.0*game.jiki->speed), 380, 350); @@ -285,6 +295,7 @@ } if (pad.st == 1) { game.state = GAME_PAUSE; + game.exec = sche_game_main_pause; } } @@ -307,12 +318,15 @@ if (pad.circle == 1) { if (game.select == 0) { game.state = GAME_MAIN; + game.exec = sche_game_main; } else { game.state = GAME_FINISH; + game.exec = sche_game_main_finish; } } if (pad.st == 1) { game.state = GAME_MAIN; + game.exec = sche_game_main; } if (pad.up == 1 || pad.down == 1) { game.select = !game.select; @@ -346,6 +360,7 @@ camera_update(game.jiki->body->transfer); if (pad.st == 1) { game.state = GAME_FINISH; + game.exec = sche_game_main_finish; } } @@ -362,6 +377,7 @@ } if (pad.st == 1) { game.state = GAME_OPENING; + game.exec = sche_game_opening; } } @@ -369,41 +385,7 @@ void schedule() { - switch (game.state) { - case GAME_INIT: - sche_game_init(); - break; - case GAME_OPENING: - sche_game_opening(); - break; - case GAME_SELECT_CAR: - sche_game_select_car(); - break; - case GAME_SELECT_COURSE: - sche_game_select_course(); - break; - case GAME_READY: - sche_game_ready(); - break; - case GAME_MAIN_INIT: - sche_game_main_init(); - break; - case GAME_MAIN: - sche_game_main(); - break; - case GAME_PAUSE: - sche_game_main_pause(); - break; - case GAME_GOAL: - sche_game_main_goal(); - break; - case GAME_FINISH: - sche_game_main_finish(); - break; - default: - game.state = GAME_OPENING; - break; - } + game.exec(); wait_sync(); swap_dbuff();