small structural code change for global animations preparation
[rocksndiamonds.git] / src / libgame / toons.h
1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // toons.h
10 // ============================================================================
11
12 #ifndef TOONS_H
13 #define TOONS_H
14
15 #include "system.h"
16
17
18 /* values for toon animation */
19 #define ANIM_START      0
20 #define ANIM_CONTINUE   1
21 #define ANIM_STOP       2
22
23
24 struct ToonScreenInfo
25 {
26   Bitmap *save_buffer;
27   void (*update_function)(void);
28   void (*prepare_backbuffer_function)(void);
29   boolean (*redraw_needed_function)(void);
30
31   struct ToonInfo *toons;
32   int num_toons;
33
34   int startx, starty;
35   int width, height;
36
37   int frame_delay_value;
38 };
39
40 struct ToonInfo
41 {
42   Bitmap *bitmap;
43
44   int src_x, src_y;
45   int width, height;
46   int anim_frames;
47   int anim_start_frame;
48   int anim_delay;
49   int anim_mode;
50   int step_offset;
51   int step_delay;
52
53   char *direction;
54   char *position;
55 };
56
57
58 int getAnimationFrame(int, int, int, int, int);
59
60 void InitToonScreen(Bitmap *, void (*update_function)(void),
61                     void (*prepare_backbuffer_function)(void),
62                     boolean (*redraw_needed_function)(void),
63                     struct ToonInfo *, int, int, int, int, int, int);
64
65 void HandleAnimation(int);
66
67 #endif  /* TOONS_H */