rnd-20020930-2-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
28 /* values for toon animation direction */
29 #define ANIMDIR_LEFT    1
30 #define ANIMDIR_RIGHT   2
31 #define ANIMDIR_UP      4
32 #define ANIMDIR_DOWN    8
33
34 #define ANIMPOS_ANY     0
35 #define ANIMPOS_LEFT    1
36 #define ANIMPOS_RIGHT   2
37 #define ANIMPOS_UP      4
38 #define ANIMPOS_DOWN    8
39 #define ANIMPOS_UPPER   16
40
41
42 struct ToonScreenInfo
43 {
44   Bitmap **toon_bitmap_array;
45   Bitmap *save_buffer;
46   void (*update_function)(void);
47   void (*prepare_backbuffer_function)(void);
48   boolean (*redraw_needed_function)(void);
49
50   struct ToonInfo *toons;
51   int num_toons;
52
53   int startx, starty;
54   int width, height;
55 };
56
57 struct ToonInfo
58 {
59   int bitmap_nr;
60   int width, height;
61   int src_x, src_y;
62   int frames;
63   int frames_per_second;
64   int stepsize;
65   int mode;
66   int direction;
67   int position;
68 };
69
70
71 void InitToonScreen();
72 void InitAnimation(void);
73 void StopAnimation(void);
74 void DoAnimation(void);
75
76 #endif  /* TOONS_H */