annotate schedule.c @ 97:afddacdf30dd

compile on Mac OS X -no Warning
author Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
date Thu, 02 Jun 2011 16:15:00 +0900
parents 0b65ca27f113
children 1033fece71ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
1 /* schedule.c */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
2
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 #include <stdio.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
4 #include <stdlib.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
5 #include <string.h>
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
6 #include <stdbool.h>
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
7 #include "libps2.h"
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
8 #include "ps2util.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
9 #include "field.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
10 #include "car.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
11 #include "gSprite.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
12 #include "gFont.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
13 #include "game.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
14 #include "controler.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
15 #include "camera.h"
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
16 #include "carNode.h"
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
17 #include "light.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
18 #include "title_scene.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
19 #include "game_time.h"
45
d7520785d8a6 *** empty log message ***
gongo
parents: 44
diff changeset
20 #include "schedule.h"
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
21 #include "game.h"
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
22
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
23 #include "mytype.h"
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
24 #include "linda.h"
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
25
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
26 #include "sjoy.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
27
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
28 #ifdef LINDA
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
29 bool linda_update(int p, Game *game);
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
30 #else
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
31 #define linda_update(change_state, game) true
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
32 #endif
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
33
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
34 #define MAXCAR 3 // 選択可能機体
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
35 #define MAXFIELD 2 // 選択可能コース
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
36 #define MAXRAP 3 // ラップ数
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
37 #define SP_SEL_CAR 50
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
38 #define SP_SEL_COURSE 80
4
d214fd22ef16 *** empty log message ***
gongo
parents: 3
diff changeset
39
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
40 // controler.cより
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
41 extern SGO_PAD pad;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
42
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
43
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
44 static void set_schedule(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
45 static void sche_game_init(Game *game);
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
46 //static void sche_game_wait(Game *game); //プロトタイプも消しといた
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
47 //static void sche_game_wait_ready(Game *game);
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
48 static void sche_game_opening(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
49 static void sche_game_select_car(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
50 static void sche_game_select_course(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
51 static void sche_game_ready(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
52 static void sche_game_main_init(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
53 static void sche_game_main_ready(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
54 static void sche_game_main(Game *game);
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
55 static void sche_game_main_pause(Game *game);
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
56 static void sche_game_main_goal(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
57 static void sche_game_main_finish(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
58 static void sche_game_main_finish2(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
59
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
60
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
61
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
62 /* timer */
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
63 static int start_time,time_count;
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
64 static int RUNNIG=0;
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
65 char raptime[10];
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
66
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
67 static int ranking = 0;
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
68 static LIGHT l;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
69 static int i=0;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
70
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
71 static void (*sche_func_assumption)();
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
72 static void (*sche_func)() = &sche_game_init;
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
73 static int change_state = 0;
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
74
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
75 // schedule.cで使用してる
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
76 void linda_env_init( void );
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
77
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
78 static void
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
79 set_schedule_assumption(void *_func)
11
41d3037c34c8 *** empty log message ***
gongo
parents: 8
diff changeset
80 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
81 sche_func_assumption = _func;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
82 change_state = 1;
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
83 }
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
84
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
85 static void
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
86 unset_schedule()
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
87 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
88 change_state = 0;
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
89 }
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
90
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
91 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
92 set_schedule(Game *game)
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
93 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
94 sche_func = sche_func_assumption;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
95 change_state = 0;
11
41d3037c34c8 *** empty log message ***
gongo
parents: 8
diff changeset
96 }
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
97
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
98 static void
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
99 graphic_init()
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
100 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
101 gSprite_Init(); // グラフィック関連の初期化
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
102 gFont_Init(); // フォント関連の初期化
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
103 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
104
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
105 static void
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
106 play_init( Game *game )
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
107 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
108 game->jiki = car_init(game->car_id);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
109 carNode_append(game->jiki);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
110 field_init(game->course_id);
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
111 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
112
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
113 // 適当に自作 :miya
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
114 void linda_env_init( void )
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
115 {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
116 printf("hogehoge");
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
117 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
118
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
119 static void game_env_init ( Game *game )
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
120 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
121 game->car_id = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
122 game->course_id = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
123 game->camera_type = 0;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
124 game->rap = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
125 game->jiki = NULL;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
126
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
127 ranking = 0;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
128
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
129 wait_init();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
130 linda_env_init();
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
131 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
132
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
133
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
134
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
135 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
136 sche_game_init(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
137 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
138 game_env_init(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
139 graphic_init();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
140 camera_init();
8
f60cb9a39d7a *** empty log message ***
gongo
parents: 5
diff changeset
141
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
142 #ifdef LINDA
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
143 //sche_func = &sche_game_wait;
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
144 //set_schedule_assumption(sche_game_wait);
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
145 #else
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
146 set_schedule_assumption(sche_game_opening);
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
147 #endif
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
148 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
149
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
150 /**
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
151 * 通信対戦専用
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
152 * 全ユーザが接続するまで待つ
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
153 * ・・・だったんだけど、現在 linda を切っているため worning が出る。
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
154 * ので cut する。
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
155 */
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
156
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
157 /* linda を使用しないのでカットした
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
158 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
159 sche_game_wait(Game *game)
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
160 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
161 gFont_SetString("WAITING...", 200, 100);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
162 set_schedule_assumption(sche_game_wait_ready);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
163 }
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
164 */
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
165
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
166
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
167 /**
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
168 * 通信対戦専用
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
169 * 全ユーザの接続を確認したら呼び出す
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
170 * こいつも、linda がないので cut
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
171 */
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
172 /*
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
173 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
174 sche_game_wait_ready(Game *game)
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
175 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
176 gFont_SetString("CONNECT OK!!", 170, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
177 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
178 gFont_SetString(" PUSH START ", 170, 400);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
179 if (pad.st != 1) { goto WAIT_READY; }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
180 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
181
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
182 set_schedule_assumption(sche_game_opening);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
183
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
184 WAIT_READY:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
185 return;
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
186 }
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
187 */
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
188
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
189
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
190 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
191 sche_game_opening(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
192 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
193 static int blink_count = 0;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
194 if (game->play_id==1){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
195 if (blink_count < 35) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
196 gFont_SetString("PUSH START !!", 170, 380);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
197 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
198 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
199
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
200 if (pad.st != 1) { goto OPENING; }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
201 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
202
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
203
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
204 set_schedule_assumption(sche_game_select_car);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
205
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
206 OPENING:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
207 return;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
208
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
209
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
210 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
211 if (title_scene() < 0){
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
212 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
213 } else if (game->play_id == 2) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
214 if (i==0){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
215 title_init_call();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
216 i=1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
217 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
218 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
219
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
220
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
221 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
222
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
223 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
224 sche_game_select_car(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
225 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
226 if (i==1){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
227 title_finish_call();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
228 i=2;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
229 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
230 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
231 gSprite_PutSprite(24, 460, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
232 gSprite_PutSprite(25, 120, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
233 gFont_SetString("SELECT CAR", 180, 50);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
234
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
235 if (pad.right == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
236 game->car_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
237 (game->car_id > MAXCAR-1) ? 1 : game->car_id + 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
238 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
239 if (pad.left == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
240 game->car_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
241 (game->car_id < 2) ? MAXCAR : game->car_id - 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
242 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
243
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
244 if (game->play_id == 1)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
245 if (pad.circle != 1) { goto SELECT_CAR; }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
246
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
247
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
248 set_schedule_assumption(sche_game_select_course);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
249
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
250 SELECT_CAR:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
251 return;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
252 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
253
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
254 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
255 sche_game_select_course(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
256 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
257 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
258 gSprite_PutSprite(24, 460, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
259 gSprite_PutSprite(25, 120, 300);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
260
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
261 gFont_SetString("SELECT COURSE", 150, 50);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
262
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
263 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
264 if (pad.right == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
265 game->course_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
266 (game->course_id > MAXFIELD-1) ? 1 : game->course_id + 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
267 goto SELECT_COURSE;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
268 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
269 if (pad.left == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
270 game->course_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
271 (game->course_id < 2) ? MAXFIELD : game->course_id - 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
272 goto SELECT_COURSE;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
273 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
274
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
275 if (pad.circle != 1) { goto SELECT_COURSE; }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
276 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
277
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
278 set_schedule_assumption(sche_game_ready);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
279
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
280 SELECT_COURSE:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
281 return;
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
282
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
283 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
284
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
285 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
286 sche_game_ready(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
287 {
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
288 static int blink_count = 0;//
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
289
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
290 gSprite_PutSprite(27+game->play_id,265,10);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
291 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
292 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
293
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
294 /* 点滅 */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
295 if (blink_count < 35) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
296 gFont_SetString("GAME START !!", 170, 380);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
297 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
298 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
299
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
300 set_schedule_assumption(sche_game_main_init);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
301
52
c875add6256e *** empty log message ***
gongo
parents: 46
diff changeset
302
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
303 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
304 set_schedule_assumption(sche_game_main_init);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
305 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
306 if (pad.cross > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
307 set_schedule_assumption(sche_game_select_car);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
308 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
309
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
310 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
311
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
312 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
313 sche_game_main_init(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
314 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
315 if (!game->jiki)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
316 play_init(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
317 RUNNIG=0;
52
c875add6256e *** empty log message ***
gongo
parents: 46
diff changeset
318
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
319 set_schedule_assumption(sche_game_main_ready);
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
320 }
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
321
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
322 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
323 sche_game_main_ready(Game *game)
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
324 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
325 gFont_SetString("Loading....", 180, 100);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
326 set_schedule_assumption(sche_game_main);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
327 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
328
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
329 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
330 sche_game_main(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
331 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
332 /** begin: dispaly RAP TIME **/
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
333 if(RUNNIG==0){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
334 start_time = game_time_get_msec();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
335 RUNNIG=1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
336 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
337
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
338 time_count = game_time_get_msec() - start_time;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
339 game_time_set_raptime(raptime,time_count);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
340 gFont_SetString("TIME",300,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
341 gFont_SetString(raptime,400,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
342 /** end: dispaly RAP TIME **/
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
343
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
344 // light_init と init_lightの書き間違え?
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
345 init_light(&l);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
346 set_light(&l);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
347
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
348 car_id_update(game, game->jiki);
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
349
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
350 field_update(game->jiki);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
351 camera_update(game,game->jiki->body->transfer);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
352 carNode_draw();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
353
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
354 gFont_SetStringInt(game->rap, 50, 100);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
355
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
356 /* スピードメーター */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
357 gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
358 gSprite_PutSprite(23, 400, 400);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
359 /* km/h */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
360 gSprite_PutSprite(26, 470, 350);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
361 /* Rap */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
362 gSprite_PutSprite(27, 80, 100);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
363
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
364 if (game->rap > MAXRAP) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
365 ranking = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
366 set_schedule_assumption(sche_game_main_goal);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
367 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
368
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
369 gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350);
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
370
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
371
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
372 if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
373 car_swerve(game->jiki, 1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
374 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
375 if ((pad.left > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
376 car_swerve(game->jiki, -1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
377 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
378 if (pad.circle > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
379 car_accelerate(game->jiki, 1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
380 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
381 if (pad.cross > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
382 car_accelerate(game->jiki, -1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
383 }
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
384
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
385 if (pad.r1 == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
386 game->camera_type = !game->camera_type;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
387 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
388 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
389 set_schedule_assumption(sche_game_main_pause);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
390 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
391
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
392 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
393
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
394
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
395 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
396 sche_game_main_pause(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
397 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
398 static int select = 0;
26
4447fd650f60 *** empty log message ***
gongo
parents: 20
diff changeset
399
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
400 field_update(game->jiki);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
401 carNode_draw();
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
402
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
403 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
404 // 選択マーク
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
405 gSprite_PutSprite(17, 100, 190+select*100);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
406
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
407 gFont_SetString("BACK TO GAME", 200, 200);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
408 gFont_SetString("GO TO TITLE", 200, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
409 } else {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
410 gFont_SetString("Pause ...", 200, 200);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
411 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
412
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
413
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
414 if (pad.circle == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
415 if (select == 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
416 set_schedule_assumption(sche_game_main);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
417 } else {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
418 set_schedule_assumption(sche_game_main_finish);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
419 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
420 } else if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
421 set_schedule_assumption(sche_game_main);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
422 } else if (pad.up == 1 || pad.down == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
423 select = !select;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
424 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
425
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
426 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
427
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
428
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
429 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
430 sche_game_main_goal(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
431 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
432 /** dispaly TOTAL TIME **/
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
433 game_time_set_raptime(raptime,time_count);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
434
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
435 gFont_SetString("TOTAL TIME",150,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
436 gFont_SetString(raptime,400,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
437 gFont_SetString("GOAL !!", 220, 150);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
438
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
439 #ifdef LINDA
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
440 if (ranking == 1)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
441 gFont_SetString("You WIN!!", 200, 250);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
442 else
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
443 gFont_SetString("You Lose...", 200, 250);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
444 #endif
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
445
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
446
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
447 // 宣言では引数が二つだったから、第一引数に game を入れてみた
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
448 car_update(game, game->jiki);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
449 field_update(game->jiki);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
450 carNode_draw();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
451 camera_update(game,game->jiki->body->transfer);
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
452
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
453 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
454 set_schedule_assumption(sche_game_main_finish);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
455 }
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
456
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
457 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
458
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
459 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
460 sche_game_main_finish(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
461 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
462 field_destroy();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
463 carNode_destroy();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
464 game_env_init(game);
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
465
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
466 set_schedule_assumption(sche_game_main_finish2);
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
467 }
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
468
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
469 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
470 sche_game_main_finish2(Game *game)
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
471 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
472 gFont_SetString("GAME OVER ...", 200, 200);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
473
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
474
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
475 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
476 set_schedule_assumption(sche_game_opening);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
477 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
478
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
479 }
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
480
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
481 // 適当に作りました
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
482 void wait_sync(Game *game)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
483 {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
484 printf("wait_sync\n");
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
485 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
486
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
487 // 適当に
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
488 void swap_dbuff()
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
489 {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
490 printf("swap_dbuff()\n");
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
491 }
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
492
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
493 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
494 schedule(Game *game)
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
495 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
496 sche_func(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
497
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
498 if (linda_update(change_state, game) == true){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
499 set_schedule(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
500 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
501 else{
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
502 unset_schedule();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
503 }
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
504
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
505 wait_sync(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
506 swap_dbuff();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
507 sjoy_poll();
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
508
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
509 ps2util_sprite_Draw();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
510 gSprite_Draw_Reset();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
511 gFont_Draw_Reset();
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
512 }