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