a32c8171954e5ca13fabe343f05fb482a2b3e5ac
[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 #include "fs.h"
9
10 /*---------------------------------------------------------------------------*/
11
12 struct demo
13 {
14     char   name[PATHMAX];               /* Demo basename                     */
15     char   filename[MAXSTR];            /* Demo path                         */
16
17     char   player[MAXSTR];
18     time_t date;
19
20     int    timer;
21     int    coins;
22     int    status;
23     int    mode;
24
25     char   shot[PATHMAX];               /* Image filename                    */
26     char   file[PATHMAX];               /* Level filename                    */
27
28     int    time;                        /* Time limit                        */
29     int    goal;                        /* Coin limit                        */
30     int    score;                       /* Total coins                       */
31     int    balls;                       /* Number of balls                   */
32     int    times;                       /* Total time                        */
33
34 };
35
36 /*---------------------------------------------------------------------------*/
37
38 struct demo *demo_load(const char *);
39 void         demo_free(struct demo *);
40
41 int demo_exists(const char *);
42
43 const char *demo_format_name(const char *fmt,
44                              const char *set,
45                              const char *level);
46
47 /*---------------------------------------------------------------------------*/
48
49 int  demo_play_init(const char *, const struct level *, int, int, int, int);
50 void demo_play_step(void);
51 void demo_play_stat(int, int, int);
52 void demo_play_stop(void);
53 float demo_play_blend(void);
54
55 int  demo_saved (void);
56 void demo_rename(const char *);
57
58 void demo_rename_player(const char *name, const char *player);
59
60 /*---------------------------------------------------------------------------*/
61
62 int  demo_replay_init(const char *, int *, int *, int *, int *, int *);
63 int  demo_replay_step(float);
64 void demo_replay_stop(int);
65
66 const char *curr_demo(void);
67
68 void demo_speed_set(int);
69
70 /*---------------------------------------------------------------------------*/
71
72 extern fs_file demo_fp;
73
74 /*---------------------------------------------------------------------------*/
75
76 #endif