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
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: 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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 #include <stdio.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
14
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
15 extern bool padCheck(SDL_Joystick *joy);
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
16 extern bool keybord(void);
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
17
128
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
18
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
19
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
20
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
21 /* linda.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
d7e0a5c33540 *** empty log message ***
gongo
parents: 46
diff changeset
24 #else
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
25 #define linda_init() 1
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
26 #endif
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
29 {
128
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
30 // ここからループされるから、static着けないと毎回新しく宣言されるんじゃない?
124
e085768
parents: 119
diff changeset
31 static Game game;
e085768
parents: 119
diff changeset
32 static bool flg = true;
e085768
parents: 119
diff changeset
33
128
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
34 // 対線とかできないから常に1Pってなるのかな
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
35 game.play_id = linda_init();
119
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
36
124
e085768
parents: 119
diff changeset
37 /*
e085768
parents: 119
diff changeset
38 引数の数を変更したので、
e085768
parents: 119
diff changeset
39 エラーが出ないように一時的に削除
e085768
parents: 119
diff changeset
40 たぶん、後で新しく新調するはずなので・・・
e085768
parents: 119
diff changeset
41 代わりに、お試しkeybordを入れてみる。
e085768
parents: 119
diff changeset
42 */
e085768
parents: 119
diff changeset
43 //flg = padCheck();
e085768
parents: 119
diff changeset
44 flg = keybord();
128
d9e3137e70a0 xml name change
e085768
parents: 124
diff changeset
45
124
e085768
parents: 119
diff changeset
46 if (flg == false) {
e085768
parents: 119
diff changeset
47 // break;
e085768
parents: 119
diff changeset
48 }
116
ed702e49cc6c conpile
e085768
parents: 109
diff changeset
49
124
e085768
parents: 119
diff changeset
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
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
52 #ifdef LINDA
124
e085768
parents: 119
diff changeset
53 psx_sync_n();
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
54 #endif
124
e085768
parents: 119
diff changeset
55
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
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ルーチンに直す。