Mercurial > hg > old > magoroku_racing
annotate game.cc @ 122:5219bf3d5e71
title_draw
author | e085768 |
---|---|
date | Mon, 27 Jun 2011 19:44:46 +0900 |
parents | f2e2460b4011 |
children | 6ef3b0efdeaf |
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 | |
0 | 18 /* linda.c */ |
19 #ifdef LINDA | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
65
diff
changeset
|
20 //extern int linda_init(); |
47 | 21 #else |
117 | 22 #define linda_init() 1 |
0 | 23 #endif |
24 | |
117 | 25 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
26 void game_main() |
0 | 27 { |
98 | 28 Game game; |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
29 bool flg = true; |
117 | 30 //#ifdef LINDA |
31 game.play_id = linda_init(); | |
32 //#endif | |
119 | 33 |
34 // ここのwhile文を外したらウィンドウがウマく描画された | |
35 // 何故でしょうか?:miyahira | |
36 // while (1) { | |
108
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
37 /* |
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
38 引数の数を変更したので、 |
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
39 エラーが出ないように一時的に削除 |
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
40 たぶん、後で新しく新調するはずなので・・・ |
109
165b4d902ca4
Error is corrected game.h and car.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
108
diff
changeset
|
41 代わりに、お試しkeybordを入れてみる。 |
108
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
42 */ |
68e6cc686f48
delete error of controler.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
43 //flg = padCheck(); |
109
165b4d902ca4
Error is corrected game.h and car.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
108
diff
changeset
|
44 flg = keybord(); |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
45 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
46 if (flg == false) { |
119 | 47 // break; |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
48 } |
116 | 49 |
98 | 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 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
90
diff
changeset
|
53 psx_sync_n(); |
0 | 54 #endif |
119 | 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ルーチンに直す。 |