1 #ifndef GAME_MM_EXPORT_H
2 #define GAME_MM_EXPORT_H
4 /* ========================================================================= */
5 /* functions and definitions exported from game_mm to main program */
6 /* ========================================================================= */
8 /* ------------------------------------------------------------------------- */
9 /* constant definitions */
10 /* ------------------------------------------------------------------------- */
12 #define MM_MAX_PLAYFIELD_WIDTH MAX_PLAYFIELD_WIDTH
13 #define MM_MAX_PLAYFIELD_HEIGHT MAX_PLAYFIELD_HEIGHT
15 #define MM_STD_PLAYFIELD_WIDTH 16
16 #define MM_STD_PLAYFIELD_HEIGHT 12
18 #define MM_MAX_PLAYFIELD_SIZE (MM_MAX_PLAYFIELD_WIDTH * \
19 MM_MAX_PLAYFIELD_HEIGHT)
21 #define MAX_NUM_AMOEBA 100
22 #define MAX_NUM_BEAMERS 8
24 #define MAX_LASER_LEN 256
25 #define MAX_LASER_ENERGY 100
26 #define MAX_LASER_OVERLOAD 100
28 #define MM_LEVEL_SCORE_ELEMENTS 16
30 #define MM_MAX_LEVEL_NAME_LEN 32
31 #define MM_MAX_LEVEL_AUTHOR_LEN 32
34 #define EL_MM_START_1_NATIVE 0
35 #define EL_MM_END_1_NATIVE 155
37 #define EL_MM_CHAR_START_NATIVE 160
38 #define EL_MM_CHAR_END_NATIVE 239
40 #define EL_MM_START_2_NATIVE 240
41 #define EL_MM_END_2_NATIVE 430
43 #define EL_MM_RUNTIME_START_NATIVE 500
44 #define EL_MM_RUNTIME_END_NATIVE 504
46 #define EL_MM_DUMMY_START_NATIVE 700
47 #define EL_MM_DUMMY_END_NATIVE 709
49 /* elements to be specially mapped */
50 #define EL_MM_EMPTY_NATIVE 0
51 #define EL_DF_EMPTY_NATIVE 304
54 #define SND_MM_GAME_LEVELTIME_CHARGING 0
55 #define SND_MM_GAME_HEALTH_CHARGING 1
58 /* ------------------------------------------------------------------------- */
59 /* data structure definitions */
60 /* ------------------------------------------------------------------------- */
104 struct DamageList damage[MAX_LASER_LEN + 10];
107 struct XY edge[MAX_LASER_LEN + 10];
110 struct BeamerInfo beamer[MAX_NUM_BEAMERS][2];
111 int beamer_edge[MAX_NUM_BEAMERS];
112 int beamer_nr[MAX_NUM_BEAMERS];
122 boolean stops_inside_element;
134 struct CycleList cycle[MM_MAX_PLAYFIELD_SIZE];
137 struct MovingList pacman[MM_MAX_PLAYFIELD_SIZE];
142 int kettles_still_needed;
143 int lights_still_needed;
146 boolean level_solved;
150 boolean cheat_no_overload;
151 boolean cheat_no_explosion;
153 int laser_overload_value;
154 boolean laser_enabled;
159 int file_version; /* version of file the level was stored with */
160 int game_version; /* version of game engine to play this level */
161 boolean encoding_16bit_field; /* level contains 16-bit elements */
167 boolean auto_count_kettles;
168 boolean laser_red, laser_green, laser_blue;
169 char name[MM_MAX_LEVEL_NAME_LEN + 1];
170 char author[MM_MAX_LEVEL_AUTHOR_LEN + 1];
171 int score[MM_LEVEL_SCORE_ELEMENTS];
178 short field[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
181 struct GraphicInfo_MM
185 struct EngineSnapshotInfo_MM
187 struct GameInfo_MM game_mm;
189 struct LaserInfo laser;
191 short Ur[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
192 short Hit[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
193 short Box[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
194 short Angle[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
195 short Frame[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT];
197 short LX,LY, XS,YS, ELX,ELY;
200 int last_LX, last_LY, last_hit_mask;
204 unsigned int rotate_delay;
205 unsigned int pacman_delay;
206 unsigned int energy_delay;
207 unsigned int overload_delay;
211 /* ------------------------------------------------------------------------- */
212 /* exported functions */
213 /* ------------------------------------------------------------------------- */
215 extern struct GlobalInfo_MM global_mm_info;
216 extern struct GameInfo_MM game_mm;
217 extern struct LevelInfo_MM native_mm_level;
218 extern struct EngineSnapshotInfo_MM engine_snapshot_mm;
220 extern short Ur[MM_MAX_PLAYFIELD_WIDTH][MM_MAX_PLAYFIELD_HEIGHT];
222 extern void mm_open_all();
223 extern void mm_close_all();
225 void InitElementProperties_MM();
227 extern void InitGfxBuffers_MM();
229 extern void InitGameEngine_MM();
230 extern void InitGameActions_MM();
231 extern void GameActions_MM(struct MouseActionInfo, boolean);
233 extern void DrawLaser_MM();
235 extern boolean ClickElement(int, int, int);
237 extern unsigned int InitEngineRandom_MM(int);
239 extern void setLevelInfoToDefaults_MM();
240 extern void copyInternalEngineVars_MM();
241 extern boolean LoadNativeLevel_MM(char *, boolean);
242 extern void SaveNativeLevel_MM(char *);
244 extern int getFieldbufferOffsetX_MM();
245 extern int getFieldbufferOffsetY_MM();
247 extern void BlitScreenToBitmap_MM(Bitmap *);
248 extern void RedrawPlayfield_MM();
250 extern void LoadEngineSnapshotValues_MM();
251 extern void SaveEngineSnapshotValues_MM(ListNode **);
253 extern int getButtonFromTouchPosition(int, int, int, int);
255 #endif /* GAME_MM_EXPORT_H */