Merge branch 'gles'
[neverball] / ball / game_draw.h
1 #ifndef GAME_DRAW_H
2 #define GAME_DRAW_H
3
4 #include "solid_draw.h"
5 #include "game_common.h"
6
7 /*---------------------------------------------------------------------------*/
8
9 struct game_draw
10 {
11     int state;
12
13     struct s_vary vary;
14     struct s_draw draw;
15
16     struct s_full back;
17
18     struct game_tilt tilt;              /* Floor rotation                    */
19     struct game_view view;              /* Current view                      */
20
21     int   goal_e;                       /* Goal enabled flag                 */
22     float goal_k;                       /* Goal animation                    */
23
24     int   jump_e;                       /* Jumping enabled flag              */
25     int   jump_b;                       /* Jump-in-progress flag             */
26     float jump_dt;                      /* Jump duration                     */
27
28     float fade_k;                       /* Fade in/out level                 */
29     float fade_d;                       /* Fade in/out direction             */
30 };
31
32 /* FIXME: this is just for POSE_* constants. */
33 #include "game_client.h"
34
35 void game_draw(struct game_draw *, int, float);
36
37 /*---------------------------------------------------------------------------*/
38
39 struct game_lerp
40 {
41     float alpha;                        /* Interpolation factor              */
42
43     struct s_lerp lerp;
44
45     struct game_tilt tilt[2];
46     struct game_view view[2];
47
48     float goal_k[2];
49     float jump_dt[2];
50 };
51
52 void game_lerp_init(struct game_lerp *, struct game_draw *);
53 void game_lerp_free(struct game_lerp *);
54 void game_lerp_copy(struct game_lerp *);
55 void game_lerp_apply(struct game_lerp *, struct game_draw *);
56
57 /*---------------------------------------------------------------------------*/
58
59 #endif