rnd-20030210-1-src
[rocksndiamonds.git] / src / libgame / toons.h
1 /***********************************************************
2 * Artsoft Retro-Game Library                               *
3 *----------------------------------------------------------*
4 * (c) 1995-2002 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * toons.h                                                  *
12 ***********************************************************/
13
14 #ifndef TOONS_H
15 #define TOONS_H
16
17 #include "system.h"
18
19
20 /* values for animation mode (frame order and direction) */
21 #define ANIM_NONE               0
22 #define ANIM_LOOP               (1 << 0)
23 #define ANIM_LINEAR             (1 << 1)
24 #define ANIM_PINGPONG           (1 << 2)
25 #define ANIM_PINGPONG2          (1 << 3)
26 #define ANIM_REVERSE            (1 << 4)
27 #define ANIM_RANDOM             (1 << 5)
28
29 #if 0
30 /* values for toon animation direction */
31 #define ANIMDIR_LEFT    1
32 #define ANIMDIR_RIGHT   2
33 #define ANIMDIR_UP      4
34 #define ANIMDIR_DOWN    8
35
36 #define ANIMPOS_ANY     0
37 #define ANIMPOS_LEFT    1
38 #define ANIMPOS_RIGHT   2
39 #define ANIMPOS_UP      4
40 #define ANIMPOS_DOWN    8
41 #define ANIMPOS_UPPER   16
42 #endif
43
44
45 struct ToonScreenInfo
46 {
47   Bitmap *save_buffer;
48   void (*update_function)(void);
49   void (*prepare_backbuffer_function)(void);
50   boolean (*redraw_needed_function)(void);
51
52   struct ToonInfo *toons;
53   int num_toons;
54
55   int startx, starty;
56   int width, height;
57
58   int frame_delay_value;
59 };
60
61 struct ToonInfo
62 {
63 #if 0
64   int graphic;
65   int width, height;
66   int src_x, src_y;
67   int anim_frames;
68   int step_delay;
69   int step_offset;
70   int anim_mode;
71   int direction;
72   int position;
73
74   int anim_delay;
75   int anim_start_frame;
76   Bitmap *bitmap;       /* dynamically initialized */
77
78   char *direction_str;
79   char *position_str;
80
81 #else
82
83   Bitmap *bitmap;
84   int src_x, src_y;
85   int width, height;
86   int anim_frames;
87   int anim_start_frame;
88   int anim_delay;
89   int anim_mode;
90   int step_offset;
91   int step_delay;
92   char *direction;
93   char *position;
94 #endif
95 };
96
97
98 int getAnimationFrame(int, int, int, int, int);
99
100 void InitToonScreen(Bitmap *, void (*update_function)(void),
101                     void (*prepare_backbuffer_function)(void),
102                     boolean (*redraw_needed_function)(void),
103                     struct ToonInfo *, int, int, int, int, int, int);
104 void InitAnimation(void);
105 void StopAnimation(void);
106 void DoAnimation(void);
107
108 #endif  /* TOONS_H */