Transform default game/locale data paths based on executable name
[neverball] / ball / demo.h
1 #ifndef DEMO_H
2 #define DEMO_H
3
4 #include <time.h>
5 #include <stdio.h>
6
7 #include "level.h"
8
9 /*---------------------------------------------------------------------------*/
10
11 struct demo
12 {
13     char   name[PATHMAX];     /* demo basename    */
14     char   filename[MAXSTR];  /* demo path        */
15
16     char   player[MAXNAM];
17     time_t date;
18
19     int    timer;
20     int    coins;
21     int    status;
22     int    mode;
23
24     char   shot[PATHMAX];   /* image filename */
25     char   file[PATHMAX];   /* level filename */
26
27     int    time;            /* time limit        */
28     int    goal;            /* coin limit        */
29     int    goal_e;          /* goal enabled flag */
30     int    score;           /* total coins       */
31     int    balls;           /* number of balls   */
32     int    times;           /* total time        */
33 };
34
35 /*---------------------------------------------------------------------------*/
36
37 #define MAXDEMO 256
38
39 int                demo_scan(void);
40 const char        *demo_pick(void);
41 const struct demo *demo_get(int);
42
43 int  demo_exists(const char *);
44
45 const char *demo_format_name(const char *fmt,
46                              const char *set,
47                              const char *level);
48
49 /*---------------------------------------------------------------------------*/
50
51 int  demo_play_init(const char *, const struct level *,
52                     int, int, int, int, int, int, int);
53 void demo_play_step(void);
54 void demo_play_stat(int, int, int);
55 void demo_play_stop(void);
56
57 int  demo_saved (void);
58 void demo_rename(const char *);
59
60 void demo_rename_player(const char *name, const char *player);
61
62 /*---------------------------------------------------------------------------*/
63
64 int  demo_replay_init(const char *, int *, int *, int *, int *, int *);
65 int  demo_replay_step(float);
66 void demo_replay_stop(int);
67 void demo_replay_dump_info(void);
68
69 const struct demo *curr_demo_replay(void);
70
71 /*---------------------------------------------------------------------------*/
72
73 FILE *demo_file(void);
74
75 /*---------------------------------------------------------------------------*/
76
77 #endif