updated various names of EM engine specific definitions
[rocksndiamonds.git] / src / game_em / export.h
1 #ifndef EXPORT_H
2 #define EXPORT_H
3
4 // ============================================================================
5 // functions and definitions exported from game_em to main program
6 // ============================================================================
7
8 #include "emerald.h"
9
10
11 // ----------------------------------------------------------------------------
12 // exported structures
13 // ----------------------------------------------------------------------------
14
15 struct GlobalInfo_EM
16 {
17   Bitmap *screenbuffer;
18 };
19
20 struct GameInfo_EM
21 {
22   boolean level_solved;
23   boolean game_over;
24
25   boolean any_player_moving;
26   boolean any_player_snapping;
27
28   boolean use_single_button;
29   boolean use_snap_key_bug;
30
31   int last_moving_player;
32   int last_player_direction[MAX_PLAYERS];
33 };
34
35 struct LevelInfo_EM
36 {
37   int file_version;
38
39   short cave[EM_MAX_CAVE_WIDTH][EM_MAX_CAVE_HEIGHT];
40
41   struct LEVEL *lev;
42   struct PLAYER *ply[MAX_PLAYERS];
43
44   /* used for runtime values */
45   struct GameInfo_EM *game_em;
46 };
47
48 struct GraphicInfo_EM
49 {
50   Bitmap *bitmap;
51   int src_x, src_y;
52   int src_offset_x, src_offset_y;
53   int dst_offset_x, dst_offset_y;
54   int width, height;
55
56   Bitmap *crumbled_bitmap;
57   int crumbled_src_x, crumbled_src_y;
58   int crumbled_border_size;
59   int crumbled_tile_size;
60
61   boolean has_crumbled_graphics;
62   boolean preserve_background;
63
64   int unique_identifier;        /* used to identify needed screen updates */
65 };
66
67 struct EngineSnapshotInfo_EM
68 {
69   struct GameInfo_EM game_em;
70   unsigned int RandomEM;
71   struct LEVEL lev;
72   struct PLAYER ply[MAX_PLAYERS];
73   short Array[4][EM_MAX_CAVE_HEIGHT][EM_MAX_CAVE_WIDTH];
74   int screen_x;
75   int screen_y;
76   int frame;
77   short **Boom;
78   short **Cave;
79   short **Next;
80   short **Draw;
81 };
82
83
84 // ----------------------------------------------------------------------------
85 // exported functions
86 // ----------------------------------------------------------------------------
87
88 extern struct GlobalInfo_EM global_em_info;
89 extern struct GameInfo_EM game_em;
90 extern struct LevelInfo_EM native_em_level;
91 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
92 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][PLY_MAX][8];
93 extern struct EngineSnapshotInfo_EM engine_snapshot_em;
94
95 void em_open_all(void);
96 void em_close_all(void);
97
98 void InitGfxBuffers_EM(void);
99
100 void InitGameEngine_EM(void);
101 void GameActions_EM(byte *, boolean);
102
103 unsigned int InitEngineRandom_EM(int);
104
105 void setLevelInfoToDefaults_EM(void);
106 boolean LoadNativeLevel_EM(char *, boolean);
107
108 int getFieldbufferOffsetX_EM(void);
109 int getFieldbufferOffsetY_EM(void);
110
111 void BackToFront_EM(void);
112 void BlitScreenToBitmap_EM(Bitmap *);
113 void RedrawPlayfield_EM(boolean);
114
115 void LoadEngineSnapshotValues_EM(void);
116 void SaveEngineSnapshotValues_EM(void);
117
118 boolean checkIfAllPlayersFitToScreen(void);
119
120 void tab_generate(void);
121 void tab_generate_graphics_info_em(void);
122
123 #endif  // EXPORT_H