add infos in Modes and Secrets tabs
[neverball] / ball / demo.h
1 #ifndef DEMO_H
2 #define DEMO_H
3
4 #include <time.h>
5 #include "level.h"
6
7 /*---------------------------------------------------------------------------*/
8
9 /* Demo information structure (header) */
10 struct demo
11 {
12     char   name[PATHMAX];      /* demo basename */
13     char   filename[MAXSTR];  /* demo path */
14
15     /* The following reflects the file structure. */
16
17     /* magic number */
18     /* replay file version */
19     int    timer;           /* elapsed time */
20     int    coins;           /* coin number */
21     int    state;           /* how the replay end */
22     int    mode;            /* game mode */
23     time_t date;            /* date of creation */
24     char   player[MAXNAM];  /* player name */
25     char   shot[PATHMAX];   /* image filename */
26     char   file[PATHMAX];   /* level filename */
27     char   back[PATHMAX];   /* level bg filename */
28     char   grad[PATHMAX];   /* level gradiant filename */
29     char   song[PATHMAX];   /* level song filename */
30     int    time;            /* time limit (! training mode) */
31     int    goal;            /* coin to open the goal (! training mode) */
32     int    score;           /* sum of coins (challenge mode) */
33     int    balls;           /* number of balls (challenge mode) */
34     int    times;           /* total time (challenge mode) */
35 };
36
37
38 /*---------------------------------------------------------------------------*/
39
40 #define MAXDEMO 256
41
42 int                demo_scan(void);
43 const char        *demo_pick(void);
44 const struct demo *demo_get(int);
45
46 const char *date_to_str(time_t);
47
48 int  demo_exists(const char *);
49 void demo_unique(char *);
50
51 /*---------------------------------------------------------------------------*/
52
53 int  demo_play_init(const char *, const struct level *,
54                     const struct level_game *);
55 void demo_play_step(float);
56 void demo_play_stop(const struct level_game *);
57 int  demo_play_saved(void);
58 void demo_play_save(const char *);
59
60 /*---------------------------------------------------------------------------*/
61
62 int  demo_replay_init(const char *, struct level_game *);
63 int  demo_replay_step(float *);
64 void demo_replay_stop(int);
65 void demo_replay_dump_info(void);
66 const struct demo *curr_demo_replay(void);
67
68 /*---------------------------------------------------------------------------*/
69
70 #endif