rnd-20021129-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 *save_buffer;
45   void (*update_function)(void);
46   void (*prepare_backbuffer_function)(void);
47   boolean (*redraw_needed_function)(void);
48
49   struct ToonInfo *toons;
50   int num_toons;
51
52   int startx, starty;
53   int width, height;
54 };
55
56 struct ToonInfo
57 {
58   int graphic;
59   int width, height;
60   int src_x, src_y;
61   int anim_frames;
62   int move_delay;
63   int stepsize;
64   int anim_mode;
65   int direction;
66   int position;
67
68   int anim_delay;
69   int start_frame;
70   Bitmap *bitmap;       /* dynamically initialized */
71 };
72
73
74 int getAnimationFrame(int, int, int, int, int);
75
76 void InitToonScreen();
77 void InitAnimation(void);
78 void StopAnimation(void);
79 void DoAnimation(void);
80
81 #endif  /* TOONS_H */