annotate schedule.cc @ 125:c62fec1dd2f8

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