Mercurial > hg > old > magoroku_racing
annotate game.cc @ 152:9fc2d52b28c5 default
merge
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jul 2011 14:44:30 +0900 |
parents | d9e3137e70a0 |
children |
rev | line source |
---|---|
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
1 /* game.c */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
2 |
0 | 3 #include <stdio.h> |
4 #include <stdlib.h> | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
5 #include <stdbool.h> |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
6 #include "libps2.h" |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
7 #include "ps2util.h" |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
8 #include "controler.h" |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
9 //#include "linda/lindaapi.h" |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
10 #include "game.h" |
0 | 11 #include "car.h" |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
12 |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
13 #include "schedule.h" |
0 | 14 |
117 | 15 extern bool padCheck(SDL_Joystick *joy); |
16 extern bool keybord(void); | |
17 | |
128 | 18 |
19 | |
20 | |
0 | 21 /* linda.c */ |
22 #ifdef LINDA | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
23 //extern int linda_init(); |
47 | 24 #else |
117 | 25 #define linda_init() 1 |
0 | 26 #endif |
27 | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
28 void game_main() |
0 | 29 { |
128 | 30 // ここからループされるから、static着けないと毎回新しく宣言されるんじゃない? |
124 | 31 static Game game; |
32 static bool flg = true; | |
33 | |
128 | 34 // 対線とかできないから常に1Pってなるのかな |
117 | 35 game.play_id = linda_init(); |
119 | 36 |
124 | 37 /* |
38 引数の数を変更したので、 | |
39 エラーが出ないように一時的に削除 | |
40 たぶん、後で新しく新調するはずなので・・・ | |
41 代わりに、お試しkeybordを入れてみる。 | |
42 */ | |
43 //flg = padCheck(); | |
44 flg = keybord(); | |
128 | 45 |
124 | 46 if (flg == false) { |
47 // break; | |
48 } | |
116 | 49 |
124 | 50 schedule(&game); |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
51 |
0 | 52 #ifdef LINDA |
124 | 53 psx_sync_n(); |
0 | 54 #endif |
124 | 55 |
0 | 56 } |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
57 |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
58 //ceriumのmainルーチンに直す。 |