annotate game.c @ 0:0fae5658fb0b

Initial revision
author gongo
date Thu, 02 Nov 2006 08:55:19 +0000
parents
children b6a1385f19be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
1 /*
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
2 * $Id$
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
4
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
5 #include <stdio.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
6 #include <stdlib.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
7 #include "libps2.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
8 #include "ps2util.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
9
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
10 #include "camera.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
11 #include "controler.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
12 #include "lindaapi.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
13 #include "col.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
14 #include "field.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
15 #include "car.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
16 #include "game.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
17 #include "gSprite.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
18 #include "gFont.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
19
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
20 /* schedule.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
21 extern void schedule();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
22 /* controler.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
23 extern Bool padCheck();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
24 /* linda.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
25 #ifdef LINDA
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
26 extern int linda_init();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
27 #else
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
28 #define linda_init() 1
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
29 #endif
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
30 extern void linda_update();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
31
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
32 Game game;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
33
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
34 void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
35 game_main()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
36 {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
37 Bool flg = TRUE;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
38 game.state = GAME_INIT;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
39
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
40 game.play_id = linda_init();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
41
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
42 while (flg) {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
43 flg = padCheck();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
44 if (flg == FALSE && game.demo_flg == 1) {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
45 game.state = GAME_FINISH;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
46 flg = TRUE;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
47 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
48 schedule();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
49
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
50 #ifdef LINDA
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
51 if (game.demo_flg == 0) {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
52 linda_update();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
53 psx_sync_n();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
54 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
55 #endif
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
56 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
57 }