1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2024 by Artsoft Entertainment
7 // https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
15 // ============================================================================
16 // functions and definitions exported from game_em to main program
17 // ============================================================================
23 // ----------------------------------------------------------------------------
24 // constant definitions
25 // ----------------------------------------------------------------------------
27 #define EM_MAX_CAVE_WIDTH CAVE_WIDTH
28 #define EM_MAX_CAVE_HEIGHT CAVE_HEIGHT
31 // ----------------------------------------------------------------------------
32 // exported structures
33 // ----------------------------------------------------------------------------
47 boolean any_player_moving;
48 boolean any_player_snapping;
50 int last_moving_player;
51 int last_player_direction[MAX_PLAYERS];
54 struct PLAYER *ply[MAX_PLAYERS];
56 // flags to handle bugs in and changes between different engine versions
57 boolean use_single_button;
58 boolean use_snap_key_bug;
59 boolean use_random_bug;
60 boolean use_old_explosions;
61 boolean use_old_android;
62 boolean use_old_push_elements;
63 boolean use_old_push_into_acid;
64 boolean use_wrap_around;
65 boolean use_push_delay;
79 int src_offset_x, src_offset_y;
80 int dst_offset_x, dst_offset_y;
83 Bitmap *crumbled_bitmap;
84 int crumbled_src_x, crumbled_src_y;
85 int crumbled_border_size;
86 int crumbled_tile_size;
88 boolean has_crumbled_graphics;
89 boolean preserve_background;
91 int unique_identifier; // used to identify needed screen updates
94 struct EngineSnapshotInfo_EM
96 struct GameInfo_EM game_em;
98 struct PLAYER ply[MAX_PLAYERS];
106 // ----------------------------------------------------------------------------
107 // exported functions
108 // ----------------------------------------------------------------------------
110 extern struct GlobalInfo_EM global_em_info;
111 extern struct GameInfo_EM game_em;
112 extern struct LevelInfo_EM native_em_level;
113 extern struct GraphicInfo_EM graphic_info_em_object[GAME_TILE_MAX][8];
114 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][PLY_MAX][8];
115 extern struct EngineSnapshotInfo_EM engine_snapshot_em;
117 void em_open_all(void);
118 void em_close_all(void);
120 void InitGfxBuffers_EM(void);
122 void InitGameEngine_EM(void);
123 void GameActions_EM(byte[MAX_PLAYERS]);
125 unsigned int InitEngineRandom_EM(int);
127 void setLevelInfoToDefaults_EM(void);
128 boolean LoadNativeLevel_EM(char *, boolean);
130 int getFieldbufferOffsetX_EM(void);
131 int getFieldbufferOffsetY_EM(void);
133 void BlitScreenToBitmap_EM(Bitmap *);
134 void RedrawPlayfield_EM(boolean);
136 void LoadEngineSnapshotValues_EM(void);
137 void SaveEngineSnapshotValues_EM(void);
139 boolean checkIfAllPlayersFitToScreen(void);
141 int map_em_element_C_to_X(int);
142 int map_em_element_X_to_C(int);
144 #endif // EXPORT_EM_H