Use GLES 1.1
[neverball] / ball / level.h
1 #ifndef LEVEL_H
2 #define LEVEL_H
3
4 #include "base_config.h"
5 #include "score.h"
6
7 /*---------------------------------------------------------------------------*/
8
9 enum
10 {
11     SCORE_TIME = 0,
12     SCORE_GOAL,
13     SCORE_COIN
14 };
15
16 struct level
17 {
18     char file[PATHMAX];
19     char shot[PATHMAX];
20     char song[PATHMAX];
21
22     char message[MAXSTR];
23
24     char version[MAXSTR];
25     char author[MAXSTR];
26
27     int time; /* Time limit   */
28     int goal; /* Coins needed */
29
30     struct score scores[3];
31
32     /* Set information. */
33
34     int  number;
35
36     /* String representation of the number (eg. "IV") */
37     char name[MAXSTR];
38
39     int is_locked;
40     int is_bonus;
41     int is_completed;
42
43     struct level *next;
44 };
45
46 int  level_load(const char *, struct level *);
47
48 /*---------------------------------------------------------------------------*/
49
50 int level_exists(int);
51
52 void level_open(struct level *);
53 int level_opened(const struct level *);
54
55 void level_complete(struct level *);
56 int level_completed(const struct level *);
57
58 int level_time(const struct level *);
59 int level_goal(const struct level *);
60 int level_bonus(const struct level *);
61
62 const char *level_shot(const struct level *);
63 const char *level_file(const struct level *);
64 const char *level_song(const struct level *);
65 const char *level_name(const struct level *);
66 const char *level_msg(const struct level *);
67
68 const struct score *level_score(struct level *, int);
69
70 /*---------------------------------------------------------------------------*/
71
72 int  level_score_update (struct level *, int, int, int *, int *, int *);
73 void level_rename_player(struct level *, int, int, int, const char *);
74
75 /*---------------------------------------------------------------------------*/
76
77 #endif