added support for nut settings in BD engine to level editor
[rocksndiamonds.git] / src / game_mm / mm_main.h
1 // ============================================================================
2 // Mirror Magic -- McDuffin's Revenge
3 // ----------------------------------------------------------------------------
4 // (c) 1994-2017 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // mm_main.h
10 // ============================================================================
11
12 #ifndef MM_MAIN_H
13 #define MM_MAIN_H
14
15 #define STD_LEV_FIELDX  MM_STD_PLAYFIELD_WIDTH
16 #define STD_LEV_FIELDY  MM_STD_PLAYFIELD_HEIGHT
17 #define MAX_LEV_FIELDX  MM_MAX_PLAYFIELD_WIDTH
18 #define MAX_LEV_FIELDY  MM_MAX_PLAYFIELD_HEIGHT
19
20 #define SCREENX(a)      (a)
21 #define SCREENY(a)      (a)
22 #define LEVELX(a)       (a)
23 #define LEVELY(a)       (a)
24
25 #define IN_FIELD(x, y, xsize, ysize)    ((x) >= 0 && (x) < (xsize) &&      \
26                                          (y) >= 0 && (y) < (ysize))
27 #define IN_FIELD_MINMAX(x, y, xmin, ymin, xmax, ymax)                      \
28                                         ((x) >= (xmin) && (x) <= (xmax) && \
29                                          (y) >= (ymin) && (y) <= (ymax))
30
31 #define IN_PIX_FIELD(x, y)      IN_FIELD(x, y, SXSIZE, SYSIZE)
32 #define IN_VIS_FIELD(x, y)      IN_FIELD(x, y, SCR_FIELDX, SCR_FIELDY)
33 #define IN_LEV_FIELD(x, y)      IN_FIELD(x, y, lev_fieldx, lev_fieldy)
34 #define IN_SCR_FIELD(x, y)      IN_FIELD_MINMAX(x, y, BX1, BY1, BX2, BY2)
35
36 // values for 'Elementeigenschaften'
37 #define EP_BIT_GRID             (1 << 0)
38 #define EP_BIT_MCDUFFIN         (1 << 1)
39 #define EP_BIT_RECTANGLE        (1 << 2)
40 #define EP_BIT_MIRROR           (1 << 3)
41 #define EP_BIT_MIRROR_FIXED     (1 << 4)
42 #define EP_BIT_POLAR            (1 << 5)
43 #define EP_BIT_POLAR_CROSS      (1 << 6)
44 #define EP_BIT_BEAMER           (1 << 7)
45 #define EP_BIT_CHAR             (1 << 8)
46 #define EP_BIT_REFLECTING       (1 << 9)
47 #define EP_BIT_ABSORBING        (1 << 10)
48 #define EP_BIT_INACTIVE         (1 << 11)
49 #define EP_BIT_WALL             (1 << 12)
50 #define EP_BIT_PACMAN           (1 << 13)
51 #define EP_BIT_ENVELOPE         (1 << 14)
52
53 #define IS_GRID(e)              (Elementeigenschaften[e] & EP_BIT_GRID)
54 #define IS_MCDUFFIN(e)          (Elementeigenschaften[e] & EP_BIT_MCDUFFIN)
55 #define IS_RECTANGLE(e)         (Elementeigenschaften[e] & EP_BIT_RECTANGLE)
56 #define IS_MIRROR(e)            (Elementeigenschaften[e] & EP_BIT_MIRROR)
57 #define IS_MIRROR_FIXED(e)      (Elementeigenschaften[e] & EP_BIT_MIRROR_FIXED)
58 #define IS_POLAR(e)             (Elementeigenschaften[e] & EP_BIT_POLAR)
59 #define IS_POLAR_CROSS(e)       (Elementeigenschaften[e] & EP_BIT_POLAR_CROSS)
60 #define IS_BEAMER_OLD(e)        (Elementeigenschaften[e] & EP_BIT_BEAMER)
61 #define IS_CHAR(e)              (Elementeigenschaften[e] & EP_BIT_CHAR)
62 #define IS_REFLECTING(e)        (Elementeigenschaften[e] & EP_BIT_REFLECTING)
63 #define IS_ABSORBING(e)         (Elementeigenschaften[e] & EP_BIT_ABSORBING)
64 #define IS_INACTIVE(e)          (Elementeigenschaften[e] & EP_BIT_INACTIVE)
65 #define IS_MM_WALL(e)           (Elementeigenschaften[e] & EP_BIT_WALL)
66 #define IS_PACMAN(e)            (Elementeigenschaften[e] & EP_BIT_PACMAN)
67 #define IS_ENVELOPE(e)          (Elementeigenschaften[e] & EP_BIT_ENVELOPE)
68
69 #define IS_WALL_STEEL(e)        ((e) >= EL_WALL_STEEL_START &&          \
70                                  (e) <= EL_WALL_STEEL_END)
71 #define IS_WALL_WOOD(e)         ((e) >= EL_WALL_WOOD_START &&           \
72                                  (e) <= EL_WALL_WOOD_END)
73 #define IS_WALL_ICE(e)          ((e) >= EL_WALL_ICE_START &&            \
74                                  (e) <= EL_WALL_ICE_END)
75 #define IS_WALL_AMOEBA(e)       ((e) >= EL_WALL_AMOEBA_START &&         \
76                                  (e) <= EL_WALL_AMOEBA_END)
77 #define IS_DF_WALL_STEEL(e)     ((e) >= EL_DF_WALL_STEEL_START &&       \
78                                  (e) <= EL_DF_WALL_STEEL_END)
79 #define IS_DF_WALL_WOOD(e)      ((e) >= EL_DF_WALL_WOOD_START &&        \
80                                  (e) <= EL_DF_WALL_WOOD_END)
81 #define IS_DF_WALL(e)           ((e) >= EL_DF_WALL_START &&             \
82                                  (e) <= EL_DF_WALL_END)
83 #define IS_WALL(e)              (IS_MM_WALL(e) || IS_DF_WALL(e))
84 #define IS_WALL_CHANGING(e)     ((e) >= EL_WALL_CHANGING_START &&       \
85                                  (e) <= EL_WALL_CHANGING_END)
86 #define IS_GRID_STEEL(e)        ((e) >= EL_GRID_STEEL_START &&          \
87                                  (e) <= EL_GRID_STEEL_END)
88 #define IS_GRID_WOOD(e)         ((e) >= EL_GRID_WOOD_START &&           \
89                                  (e) <= EL_GRID_WOOD_END)
90 #define IS_GRID_WOOD_FIXED(e)   ((e) >= EL_GRID_WOOD_FIXED_START &&     \
91                                  (e) <= EL_GRID_WOOD_FIXED_END)
92 #define IS_GRID_STEEL_FIXED(e)  ((e) >= EL_GRID_STEEL_FIXED_START &&    \
93                                  (e) <= EL_GRID_STEEL_FIXED_END)
94 #define IS_GRID_WOOD_AUTO(e)    ((e) >= EL_GRID_WOOD_AUTO_START &&      \
95                                  (e) <= EL_GRID_WOOD_AUTO_END)
96 #define IS_GRID_STEEL_AUTO(e)   ((e) >= EL_GRID_STEEL_AUTO_START &&     \
97                                  (e) <= EL_GRID_STEEL_AUTO_END)
98 #define IS_DF_GRID(e)           (IS_GRID_WOOD_FIXED(e) ||               \
99                                  IS_GRID_STEEL_FIXED(e) ||              \
100                                  IS_GRID_WOOD_AUTO(e) ||                \
101                                  IS_GRID_STEEL_AUTO(e))
102 #define IS_DF_MIRROR(e)         ((e) >= EL_DF_MIRROR_START &&           \
103                                  (e) <= EL_DF_MIRROR_END)
104 #define IS_DF_MIRROR_AUTO(e)    ((e) >= EL_DF_MIRROR_AUTO_START &&      \
105                                  (e) <= EL_DF_MIRROR_AUTO_END)
106 #define IS_DF_MIRROR_FIXED(e)   ((e) >= EL_DF_MIRROR_FIXED_START &&     \
107                                  (e) <= EL_DF_MIRROR_FIXED_END)
108 #define IS_DF_SLOPE(e)          ((e) >= EL_DF_SLOPE_START &&            \
109                                  (e) <= EL_DF_SLOPE_END)
110 #define IS_LASER(e)             ((e) >= EL_LASER_START &&               \
111                                  (e) <= EL_LASER_END)
112 #define IS_RECEIVER(e)          ((e) >= EL_RECEIVER_START &&            \
113                                  (e) <= EL_RECEIVER_END)
114 #define IS_FIBRE_OPTIC(e)       ((e) >= EL_FIBRE_OPTIC_START &&         \
115                                  (e) <= EL_FIBRE_OPTIC_END)
116 #define FIBRE_OPTIC_NR(e)       (((e) - EL_FIBRE_OPTIC_START) / 2)
117 #define IS_BEAMER(e)            ((e) >= EL_BEAMER_RED_START &&          \
118                                  (e) <= EL_BEAMER_BLUE_END)
119 #define BEAMER_CLASSIC_NR(e)    (((e) - EL_BEAMER_RED_START) / 16)
120 #define BEAMER_NR(e)            (IS_BEAMER(e) ? BEAMER_CLASSIC_NR(e) :  \
121                                  IS_FIBRE_OPTIC(e) ? (FIBRE_OPTIC_NR(e)+4) : 0)
122 #define IS_EXPLODING(e)         ((e) == EL_EXPLODING_OPAQUE ||          \
123                                  (e) == EL_EXPLODING_TRANSP)
124
125 #define IS_EATABLE4PACMAN(e)    ((e) == EL_EMPTY ||                     \
126                                  (e) == EL_KETTLE ||                    \
127                                  (e) == EL_CELL ||                      \
128                                  (e) == EL_BOMB ||                      \
129                                  IS_WALL_AMOEBA(e))
130
131 #define IS_ABSORBING_BLOCK(e)   (IS_WALL_WOOD(e) ||                     \
132                                  IS_DF_WALL_WOOD(e) ||                  \
133                                  (e) == EL_BLOCK_WOOD ||                \
134                                  (e) == EL_GATE_WOOD ||                 \
135                                  (e) == EL_EXIT_CLOSED ||               \
136                                  (e) == EL_EXIT_OPEN)
137
138 #define IS_ENVELOPE_OPENING(e)  ((e) >= EL_ENVELOPE_OPENING_START &&    \
139                                  (e) <= EL_ENVELOPE_OPENING_END)
140
141 #define ENVELOPE_NR(e)          ((e) - EL_ENVELOPE_1)
142 #define ENVELOPE_OPENING_NR(e)  ((e) - EL_ENVELOPE_1_OPENING)
143
144 #define CAN_MOVE(e)             ((e) == EL_PACMAN)
145 #define IS_FREE(x, y)           (Tile[x][y] == EL_EMPTY)
146
147 #define IS_MOVING(x, y)         (MovPos[x][y] != 0)
148 #define IS_BLOCKED(x, y)        (Tile[x][y] == EL_BLOCKED)
149 #define IS_DRAWABLE(e)          ((e) < EL_BLOCKED)
150 #define IS_NOT_DRAWABLE(e)      ((e) >= EL_BLOCKED)
151
152 #define WALL_BASE(e)            ((e) & 0xfff0)
153 #define WALL_BITS(e)            ((e) & 0x000f)
154
155 // boundaries of arrays etc.
156 #define MAX_PLAYER_NAME_LEN     10
157 #define MAX_LEVEL_NAME_LEN      32
158 #define MAX_LEVEL_AUTHOR_LEN    32
159 #define MAX_SCORE_ENTRIES       100
160 #define MAX_ELEMENTS            700             // 500 static + 200 runtime
161
162 #define MICROLEVEL_SCROLL_DELAY 50      // delay for scrolling micro level
163 #define MICROLEVEL_LABEL_DELAY  250     // delay for micro level label
164
165 // score for elements
166 #define SC_COLLECTIBLE          0
167 #define SC_UNUSED_1             1
168 #define SC_UNUSED_2             2
169 #define SC_UNUSED_3             3
170 #define SC_UNUSED_4             4
171 #define SC_UNUSED_5             5
172 #define SC_PACMAN               6
173 #define SC_UNUSED_7             7
174 #define SC_UNUSED_8             8
175 #define SC_KEY                  9
176 #define SC_TIME_BONUS           10
177 #define SC_UNUSED_11            11
178 #define SC_UNUSED_12            12
179 #define SC_UNUSED_13            13
180 #define SC_LIGHTBALL            14
181 #define SC_UNUSED_15            15
182
183 #define LEVEL_SCORE_ELEMENTS    16      // level elements with score
184
185
186 extern DrawBuffer      *drawto_mm;
187 extern DrawBuffer      *bitmap_db_field;
188
189 extern int              game_status;
190 extern boolean          level_editor_test_game;
191
192 extern boolean          redraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
193 extern int              redraw_x1, redraw_y1;
194
195 extern short            Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
196 extern short            Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
197 extern short            Hit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
198 extern short            Box[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
199 extern short            Angle[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
200
201 extern short            MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
202 extern short            MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
203 extern short            MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
204 extern short            Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
205 extern short            Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
206 extern short            StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
207 extern short            Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
208 extern boolean          Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
209 extern short            AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
210 extern short            AmoebaCnt[MAX_NUM_AMOEBA];
211 extern short            AmoebaCnt2[MAX_NUM_AMOEBA];
212 extern short            ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
213
214 extern int              GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
215 extern int              GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
216
217 extern unsigned int     Elementeigenschaften[MAX_ELEMENTS];
218
219 extern int              level_nr;
220 extern int              lev_fieldx, lev_fieldy, scroll_x, scroll_y;
221
222 extern int              FX, FY, ScrollStepSize;
223 extern int              ScreenMovDir, ScreenMovPos, ScreenGfxPos;
224 extern int              GameFrameDelay;
225 extern int              FfwdFrameDelay;
226 extern int              BX1, BY1, BX2, BY2;
227 extern int              SBX_Left, SBX_Right;
228 extern int              SBY_Upper, SBY_Lower;
229 extern int              TimeFrames, TimePlayed, TimeLeft;
230
231 extern struct LevelInfo_MM      native_mm_level;
232 extern struct GameInfo_MM       game_mm;
233 extern struct LaserInfo         laser;
234
235 extern short            LX, LY, XS, YS, ELX, ELY;
236 extern short            CT, Ct;
237
238 extern int              dSX, dSY;
239 extern int              cSX, cSY;
240 extern int              cSX2, cSY2;
241 extern int              cFX, cFY;
242
243 extern Pixel            pen_fg, pen_bg, pen_ray, pen_magicolor[2];
244 extern int              color_status;
245
246 extern struct XY        Step[];
247 extern short            Sign[16];
248
249 extern char            *element_info[];
250 extern int              num_element_info;
251
252 // wall positions (that can be OR'ed together)
253 #define WALL_TOPLEFT            1
254 #define WALL_TOPRIGHT           2
255 #define WALL_BOTTOMLEFT         4
256 #define WALL_BOTTOMRIGHT        8
257 #define WALL_LEFT               (WALL_TOPLEFT    | WALL_BOTTOMLEFT)
258 #define WALL_RIGHT              (WALL_TOPRIGHT   | WALL_BOTTOMRIGHT)
259 #define WALL_TOP                (WALL_TOPLEFT    | WALL_TOPRIGHT)
260 #define WALL_BOTTOM             (WALL_BOTTOMLEFT | WALL_BOTTOMRIGHT)
261
262 // game elements:
263 //        0 - 499: real elements, stored in level file
264 //      500 - 699: flag elements, only used at runtime
265
266 // "real" level elements
267 #define EL_MM_START             0
268 #define EL_MM_START_1           EL_MM_START
269
270 #define EL_EMPTY                0
271 #define EL_MIRROR_START         1
272 #define EL_MIRROR_00            (EL_MIRROR_START + 0)
273 #define EL_MIRROR_01            (EL_MIRROR_START + 1)
274 #define EL_MIRROR_02            (EL_MIRROR_START + 2)
275 #define EL_MIRROR_03            (EL_MIRROR_START + 3)
276 #define EL_MIRROR_04            (EL_MIRROR_START + 4)
277 #define EL_MIRROR_05            (EL_MIRROR_START + 5)
278 #define EL_MIRROR_06            (EL_MIRROR_START + 6)
279 #define EL_MIRROR_07            (EL_MIRROR_START + 7)
280 #define EL_MIRROR_08            (EL_MIRROR_START + 8)
281 #define EL_MIRROR_09            (EL_MIRROR_START + 9)
282 #define EL_MIRROR_10            (EL_MIRROR_START + 10)
283 #define EL_MIRROR_11            (EL_MIRROR_START + 11)
284 #define EL_MIRROR_12            (EL_MIRROR_START + 12)
285 #define EL_MIRROR_13            (EL_MIRROR_START + 13)
286 #define EL_MIRROR_14            (EL_MIRROR_START + 14)
287 #define EL_MIRROR_15            (EL_MIRROR_START + 15)
288 #define EL_MIRROR_END           EL_MIRROR_15
289 #define EL_GRID_STEEL_START     17
290 #define EL_GRID_STEEL_00        (EL_GRID_STEEL_START + 0)
291 #define EL_GRID_STEEL_01        (EL_GRID_STEEL_START + 1)
292 #define EL_GRID_STEEL_02        (EL_GRID_STEEL_START + 2)
293 #define EL_GRID_STEEL_03        (EL_GRID_STEEL_START + 3)
294 #define EL_GRID_STEEL_END       EL_GRID_STEEL_03
295 #define EL_MCDUFFIN_START       21
296 #define EL_MCDUFFIN_RIGHT       (EL_MCDUFFIN_START + 0)
297 #define EL_MCDUFFIN_UP          (EL_MCDUFFIN_START + 1)
298 #define EL_MCDUFFIN_LEFT        (EL_MCDUFFIN_START + 2)
299 #define EL_MCDUFFIN_DOWN        (EL_MCDUFFIN_START + 3)
300 #define EL_MCDUFFIN_END         EL_MCDUFFIN_DOWN
301 #define EL_EXIT_CLOSED          25
302 #define EL_EXIT_OPENING_1       26
303 #define EL_EXIT_OPENING_2       27
304 #define EL_EXIT_OPEN            28
305 #define EL_KETTLE               29
306 #define EL_BOMB                 30
307 #define EL_PRISM                31
308 #define EL_WALL_START           EL_WALL_STEEL_START
309 #define EL_WALL_STEEL_BASE      32
310 #define EL_WALL_STEEL_START     (EL_WALL_STEEL_BASE + 0)
311 #define EL_WALL_STEEL_END       (EL_WALL_STEEL_BASE + 15)
312 #define EL_WALL_WOOD_BASE       48
313 #define EL_WALL_WOOD_START      (EL_WALL_WOOD_BASE + 0)
314 #define EL_WALL_WOOD_END        (EL_WALL_WOOD_BASE + 15)
315 #define EL_WALL_ICE_BASE        64
316 #define EL_WALL_ICE_START       (EL_WALL_ICE_BASE + 0)
317 #define EL_WALL_ICE_END         (EL_WALL_ICE_BASE + 15)
318 #define EL_WALL_AMOEBA_BASE     80
319 #define EL_WALL_AMOEBA_START    (EL_WALL_AMOEBA_BASE + 0)
320 #define EL_WALL_AMOEBA_END      (EL_WALL_AMOEBA_BASE + 15)
321 #define EL_WALL_END             EL_WALL_AMOEBA_END
322 #define EL_BLOCK_WOOD           96
323 #define EL_GRAY_BALL            97
324 #define EL_BEAMER_START         98
325 #define EL_BEAMER_00            (EL_BEAMER_START + 0)
326 #define EL_BEAMER_01            (EL_BEAMER_START + 1)
327 #define EL_BEAMER_02            (EL_BEAMER_START + 2)
328 #define EL_BEAMER_03            (EL_BEAMER_START + 3)
329 #define EL_BEAMER_04            (EL_BEAMER_START + 4)
330 #define EL_BEAMER_05            (EL_BEAMER_START + 5)
331 #define EL_BEAMER_06            (EL_BEAMER_START + 6)
332 #define EL_BEAMER_07            (EL_BEAMER_START + 7)
333 #define EL_BEAMER_08            (EL_BEAMER_START + 8)
334 #define EL_BEAMER_09            (EL_BEAMER_START + 9)
335 #define EL_BEAMER_10            (EL_BEAMER_START + 10)
336 #define EL_BEAMER_11            (EL_BEAMER_START + 11)
337 #define EL_BEAMER_12            (EL_BEAMER_START + 12)
338 #define EL_BEAMER_13            (EL_BEAMER_START + 13)
339 #define EL_BEAMER_14            (EL_BEAMER_START + 14)
340 #define EL_BEAMER_15            (EL_BEAMER_START + 15)
341 #define EL_BEAMER_END           EL_BEAMER_15
342 #define EL_FUSE_ON              114
343 #define EL_PACMAN_START         115
344 #define EL_PACMAN_RIGHT         (EL_PACMAN_START + 0)
345 #define EL_PACMAN_UP            (EL_PACMAN_START + 1)
346 #define EL_PACMAN_LEFT          (EL_PACMAN_START + 2)
347 #define EL_PACMAN_DOWN          (EL_PACMAN_START + 3)
348 #define EL_PACMAN_END           EL_PACMAN_DOWN
349 #define EL_POLAR_START          119
350 #define EL_POLAR_00             (EL_POLAR_START + 0)
351 #define EL_POLAR_01             (EL_POLAR_START + 1)
352 #define EL_POLAR_02             (EL_POLAR_START + 2)
353 #define EL_POLAR_03             (EL_POLAR_START + 3)
354 #define EL_POLAR_04             (EL_POLAR_START + 4)
355 #define EL_POLAR_05             (EL_POLAR_START + 5)
356 #define EL_POLAR_06             (EL_POLAR_START + 6)
357 #define EL_POLAR_07             (EL_POLAR_START + 7)
358 #define EL_POLAR_08             (EL_POLAR_START + 8)
359 #define EL_POLAR_09             (EL_POLAR_START + 9)
360 #define EL_POLAR_10             (EL_POLAR_START + 10)
361 #define EL_POLAR_11             (EL_POLAR_START + 11)
362 #define EL_POLAR_12             (EL_POLAR_START + 12)
363 #define EL_POLAR_13             (EL_POLAR_START + 13)
364 #define EL_POLAR_14             (EL_POLAR_START + 14)
365 #define EL_POLAR_15             (EL_POLAR_START + 15)
366 #define EL_POLAR_END            EL_POLAR_15
367 #define EL_POLAR_CROSS_START    135
368 #define EL_POLAR_CROSS_00       (EL_POLAR_CROSS_START + 0)
369 #define EL_POLAR_CROSS_01       (EL_POLAR_CROSS_START + 1)
370 #define EL_POLAR_CROSS_02       (EL_POLAR_CROSS_START + 2)
371 #define EL_POLAR_CROSS_03       (EL_POLAR_CROSS_START + 3)
372 #define EL_POLAR_CROSS_END      EL_POLAR_CROSS_03
373 #define EL_MIRROR_FIXED_START   139
374 #define EL_MIRROR_FIXED_00      (EL_MIRROR_FIXED_START + 0)
375 #define EL_MIRROR_FIXED_01      (EL_MIRROR_FIXED_START + 1)
376 #define EL_MIRROR_FIXED_02      (EL_MIRROR_FIXED_START + 2)
377 #define EL_MIRROR_FIXED_03      (EL_MIRROR_FIXED_START + 3)
378 #define EL_MIRROR_FIXED_END     EL_MIRROR_FIXED_03
379 #define EL_GATE_STONE           143
380 #define EL_KEY                  144
381 #define EL_LIGHTBULB_OFF        145
382 #define EL_LIGHTBULB_ON         146
383 #define EL_LIGHTBALL            147
384 #define EL_BLOCK_STONE          148
385 #define EL_GATE_WOOD            149
386 #define EL_FUEL_FULL            150
387 #define EL_GRID_WOOD_START      151
388 #define EL_GRID_WOOD_00         (EL_GRID_WOOD_START + 0)
389 #define EL_GRID_WOOD_01         (EL_GRID_WOOD_START + 1)
390 #define EL_GRID_WOOD_02         (EL_GRID_WOOD_START + 2)
391 #define EL_GRID_WOOD_03         (EL_GRID_WOOD_START + 3)
392 #define EL_GRID_WOOD_END        EL_GRID_WOOD_03
393 #define EL_FUEL_EMPTY           155
394 #define EL_ENVELOPE_1           156
395 #define EL_ENVELOPE_2           157
396 #define EL_ENVELOPE_3           158
397 #define EL_ENVELOPE_4           159
398
399 #define EL_MM_END_1             159
400
401 #define EL_CHAR_START           160
402 #define EL_CHAR_ASCII0          (EL_CHAR_START - 32)
403 #define EL_CHAR_AUSRUF          (EL_CHAR_ASCII0 + 33)
404 #define EL_CHAR_ZOLL            (EL_CHAR_ASCII0 + 34)
405 #define EL_CHAR_RAUTE           (EL_CHAR_ASCII0 + 35)
406 #define EL_CHAR_DOLLAR          (EL_CHAR_ASCII0 + 36)
407 #define EL_CHAR_PROZ            (EL_CHAR_ASCII0 + 37)
408 #define EL_CHAR_AMPERSAND       (EL_CHAR_ASCII0 + 38)
409 #define EL_CHAR_APOSTR          (EL_CHAR_ASCII0 + 39)
410 #define EL_CHAR_KLAMM1          (EL_CHAR_ASCII0 + 40)
411 #define EL_CHAR_KLAMM2          (EL_CHAR_ASCII0 + 41)
412 #define EL_CHAR_MULT            (EL_CHAR_ASCII0 + 42)
413 #define EL_CHAR_PLUS            (EL_CHAR_ASCII0 + 43)
414 #define EL_CHAR_KOMMA           (EL_CHAR_ASCII0 + 44)
415 #define EL_CHAR_MINUS           (EL_CHAR_ASCII0 + 45)
416 #define EL_CHAR_PUNKT           (EL_CHAR_ASCII0 + 46)
417 #define EL_CHAR_SLASH           (EL_CHAR_ASCII0 + 47)
418 #define EL_CHAR_0               (EL_CHAR_ASCII0 + 48)
419 #define EL_CHAR_9               (EL_CHAR_ASCII0 + 57)
420 #define EL_CHAR_DOPPEL          (EL_CHAR_ASCII0 + 58)
421 #define EL_CHAR_SEMIKL          (EL_CHAR_ASCII0 + 59)
422 #define EL_CHAR_LT              (EL_CHAR_ASCII0 + 60)
423 #define EL_CHAR_GLEICH          (EL_CHAR_ASCII0 + 61)
424 #define EL_CHAR_GT              (EL_CHAR_ASCII0 + 62)
425 #define EL_CHAR_FRAGE           (EL_CHAR_ASCII0 + 63)
426 #define EL_CHAR_AT              (EL_CHAR_ASCII0 + 64)
427 #define EL_CHAR_A               (EL_CHAR_ASCII0 + 65)
428 #define EL_CHAR_Z               (EL_CHAR_ASCII0 + 90)
429 #define EL_CHAR_AE              (EL_CHAR_ASCII0 + 91)
430 #define EL_CHAR_OE              (EL_CHAR_ASCII0 + 92)
431 #define EL_CHAR_UE              (EL_CHAR_ASCII0 + 93)
432 #define EL_CHAR_COPY            (EL_CHAR_ASCII0 + 94)
433 #define EL_CHAR_END             (EL_CHAR_START + 79)
434
435 #define EL_CHAR(x)              ((x) == CHAR_BYTE_UMLAUT_A ? EL_CHAR_AE : \
436                                  (x) == CHAR_BYTE_UMLAUT_O ? EL_CHAR_OE : \
437                                  (x) == CHAR_BYTE_UMLAUT_U ? EL_CHAR_UE : \
438                                  EL_CHAR_A + (x) - 'A')
439
440 #define EL_MM_START_2           240
441
442 // elements for "Deflektor" style levels
443 #define EL_DF_START             EL_MM_START_2
444
445 #define EL_DF_MIRROR_START      EL_DF_START
446 #define EL_DF_MIRROR_00         (EL_DF_MIRROR_START + 0)
447 #define EL_DF_MIRROR_01         (EL_DF_MIRROR_START + 1)
448 #define EL_DF_MIRROR_02         (EL_DF_MIRROR_START + 2)
449 #define EL_DF_MIRROR_03         (EL_DF_MIRROR_START + 3)
450 #define EL_DF_MIRROR_04         (EL_DF_MIRROR_START + 4)
451 #define EL_DF_MIRROR_05         (EL_DF_MIRROR_START + 5)
452 #define EL_DF_MIRROR_06         (EL_DF_MIRROR_START + 6)
453 #define EL_DF_MIRROR_07         (EL_DF_MIRROR_START + 7)
454 #define EL_DF_MIRROR_08         (EL_DF_MIRROR_START + 8)
455 #define EL_DF_MIRROR_09         (EL_DF_MIRROR_START + 9)
456 #define EL_DF_MIRROR_10         (EL_DF_MIRROR_START + 10)
457 #define EL_DF_MIRROR_11         (EL_DF_MIRROR_START + 11)
458 #define EL_DF_MIRROR_12         (EL_DF_MIRROR_START + 12)
459 #define EL_DF_MIRROR_13         (EL_DF_MIRROR_START + 13)
460 #define EL_DF_MIRROR_14         (EL_DF_MIRROR_START + 14)
461 #define EL_DF_MIRROR_15         (EL_DF_MIRROR_START + 15)
462 #define EL_DF_MIRROR_END        EL_DF_MIRROR_15
463
464 #define EL_GRID_WOOD_FIXED_START 256
465 #define EL_GRID_WOOD_FIXED_00   (EL_GRID_WOOD_FIXED_START + 0)  //   0.0°
466 #define EL_GRID_WOOD_FIXED_01   (EL_GRID_WOOD_FIXED_START + 1)  //  22.5°
467 #define EL_GRID_WOOD_FIXED_02   (EL_GRID_WOOD_FIXED_START + 2)  //  45.0°
468 #define EL_GRID_WOOD_FIXED_03   (EL_GRID_WOOD_FIXED_START + 3)  //  67.5°
469 #define EL_GRID_WOOD_FIXED_04   (EL_GRID_WOOD_FIXED_START + 4)  //  90.0°
470 #define EL_GRID_WOOD_FIXED_05   (EL_GRID_WOOD_FIXED_START + 5)  // 112.5°
471 #define EL_GRID_WOOD_FIXED_06   (EL_GRID_WOOD_FIXED_START + 6)  // 135.0°
472 #define EL_GRID_WOOD_FIXED_07   (EL_GRID_WOOD_FIXED_START + 7)  // 157.5°
473 #define EL_GRID_WOOD_FIXED_END  EL_GRID_WOOD_FIXED_07
474
475 #define EL_GRID_STEEL_FIXED_START 264
476 #define EL_GRID_STEEL_FIXED_00  (EL_GRID_STEEL_FIXED_START + 0) //   0.0°
477 #define EL_GRID_STEEL_FIXED_01  (EL_GRID_STEEL_FIXED_START + 1) //  22.5°
478 #define EL_GRID_STEEL_FIXED_02  (EL_GRID_STEEL_FIXED_START + 2) //  45.0°
479 #define EL_GRID_STEEL_FIXED_03  (EL_GRID_STEEL_FIXED_START + 3) //  67.5°
480 #define EL_GRID_STEEL_FIXED_04  (EL_GRID_STEEL_FIXED_START + 4) //  90.0°
481 #define EL_GRID_STEEL_FIXED_05  (EL_GRID_STEEL_FIXED_START + 5) // 112.5°
482 #define EL_GRID_STEEL_FIXED_06  (EL_GRID_STEEL_FIXED_START + 6) // 135.0°
483 #define EL_GRID_STEEL_FIXED_07  (EL_GRID_STEEL_FIXED_START + 7) // 157.5°
484 #define EL_GRID_STEEL_FIXED_END EL_GRID_STEEL_FIXED_07
485
486 #define EL_DF_WALL_WOOD_BASE    272
487 #define EL_DF_WALL_WOOD_START   (EL_DF_WALL_WOOD_BASE + 0)
488 #define EL_DF_WALL_WOOD_END     (EL_DF_WALL_WOOD_BASE + 15)
489
490 #define EL_DF_WALL_STEEL_BASE   288
491 #define EL_DF_WALL_STEEL_START  (EL_DF_WALL_STEEL_BASE + 0)
492 #define EL_DF_WALL_STEEL_END    (EL_DF_WALL_STEEL_BASE + 15)
493
494 #define EL_DF_WALL_START        EL_DF_WALL_WOOD_START
495 #define EL_DF_WALL_END          EL_DF_WALL_STEEL_END
496
497 #define EL_DF_EMPTY             304
498 #define EL_CELL                 305
499 #define EL_MINE                 306
500 #define EL_REFRACTOR            307
501
502 #define EL_LASER_START          308
503 #define EL_LASER_RIGHT          (EL_LASER_START + 0)
504 #define EL_LASER_UP             (EL_LASER_START + 1)
505 #define EL_LASER_LEFT           (EL_LASER_START + 2)
506 #define EL_LASER_DOWN           (EL_LASER_START + 3)
507 #define EL_LASER_END            EL_LASER_DOWN
508
509 #define EL_RECEIVER_START       312
510 #define EL_RECEIVER_RIGHT       (EL_RECEIVER_START + 0)
511 #define EL_RECEIVER_UP          (EL_RECEIVER_START + 1)
512 #define EL_RECEIVER_LEFT        (EL_RECEIVER_START + 2)
513 #define EL_RECEIVER_DOWN        (EL_RECEIVER_START + 3)
514 #define EL_RECEIVER_END         EL_RECEIVER_DOWN
515
516 #define EL_FIBRE_OPTIC_START    316
517 #define EL_FIBRE_OPTIC_00       (EL_FIBRE_OPTIC_START + 0)
518 #define EL_FIBRE_OPTIC_01       (EL_FIBRE_OPTIC_START + 1)
519 #define EL_FIBRE_OPTIC_02       (EL_FIBRE_OPTIC_START + 2)
520 #define EL_FIBRE_OPTIC_03       (EL_FIBRE_OPTIC_START + 3)
521 #define EL_FIBRE_OPTIC_04       (EL_FIBRE_OPTIC_START + 4)
522 #define EL_FIBRE_OPTIC_05       (EL_FIBRE_OPTIC_START + 5)
523 #define EL_FIBRE_OPTIC_06       (EL_FIBRE_OPTIC_START + 6)
524 #define EL_FIBRE_OPTIC_07       (EL_FIBRE_OPTIC_START + 7)
525 #define EL_FIBRE_OPTIC_END      EL_FIBRE_OPTIC_07
526
527 #define EL_DF_MIRROR_AUTO_START 324
528 #define EL_DF_MIRROR_AUTO_00    (EL_DF_MIRROR_AUTO_START + 0)
529 #define EL_DF_MIRROR_AUTO_01    (EL_DF_MIRROR_AUTO_START + 1)
530 #define EL_DF_MIRROR_AUTO_02    (EL_DF_MIRROR_AUTO_START + 2)
531 #define EL_DF_MIRROR_AUTO_03    (EL_DF_MIRROR_AUTO_START + 3)
532 #define EL_DF_MIRROR_AUTO_04    (EL_DF_MIRROR_AUTO_START + 4)
533 #define EL_DF_MIRROR_AUTO_05    (EL_DF_MIRROR_AUTO_START + 5)
534 #define EL_DF_MIRROR_AUTO_06    (EL_DF_MIRROR_AUTO_START + 6)
535 #define EL_DF_MIRROR_AUTO_07    (EL_DF_MIRROR_AUTO_START + 7)
536 #define EL_DF_MIRROR_AUTO_08    (EL_DF_MIRROR_AUTO_START + 8)
537 #define EL_DF_MIRROR_AUTO_09    (EL_DF_MIRROR_AUTO_START + 9)
538 #define EL_DF_MIRROR_AUTO_10    (EL_DF_MIRROR_AUTO_START + 10)
539 #define EL_DF_MIRROR_AUTO_11    (EL_DF_MIRROR_AUTO_START + 11)
540 #define EL_DF_MIRROR_AUTO_12    (EL_DF_MIRROR_AUTO_START + 12)
541 #define EL_DF_MIRROR_AUTO_13    (EL_DF_MIRROR_AUTO_START + 13)
542 #define EL_DF_MIRROR_AUTO_14    (EL_DF_MIRROR_AUTO_START + 14)
543 #define EL_DF_MIRROR_AUTO_15    (EL_DF_MIRROR_AUTO_START + 15)
544 #define EL_DF_MIRROR_AUTO_END   EL_DF_MIRROR_AUTO_15
545
546 #define EL_GRID_WOOD_AUTO_START 340
547 #define EL_GRID_WOOD_AUTO_00    (EL_GRID_WOOD_AUTO_START + 0)
548 #define EL_GRID_WOOD_AUTO_01    (EL_GRID_WOOD_AUTO_START + 1)
549 #define EL_GRID_WOOD_AUTO_02    (EL_GRID_WOOD_AUTO_START + 2)
550 #define EL_GRID_WOOD_AUTO_03    (EL_GRID_WOOD_AUTO_START + 3)
551 #define EL_GRID_WOOD_AUTO_04    (EL_GRID_WOOD_AUTO_START + 4)
552 #define EL_GRID_WOOD_AUTO_05    (EL_GRID_WOOD_AUTO_START + 5)
553 #define EL_GRID_WOOD_AUTO_06    (EL_GRID_WOOD_AUTO_START + 6)
554 #define EL_GRID_WOOD_AUTO_07    (EL_GRID_WOOD_AUTO_START + 7)
555 #define EL_GRID_WOOD_AUTO_END   EL_GRID_WOOD_AUTO_07
556
557 #define EL_GRID_STEEL_AUTO_START 348
558 #define EL_GRID_STEEL_AUTO_00   (EL_GRID_STEEL_AUTO_START + 0)
559 #define EL_GRID_STEEL_AUTO_01   (EL_GRID_STEEL_AUTO_START + 1)
560 #define EL_GRID_STEEL_AUTO_02   (EL_GRID_STEEL_AUTO_START + 2)
561 #define EL_GRID_STEEL_AUTO_03   (EL_GRID_STEEL_AUTO_START + 3)
562 #define EL_GRID_STEEL_AUTO_04   (EL_GRID_STEEL_AUTO_START + 4)
563 #define EL_GRID_STEEL_AUTO_05   (EL_GRID_STEEL_AUTO_START + 5)
564 #define EL_GRID_STEEL_AUTO_06   (EL_GRID_STEEL_AUTO_START + 6)
565 #define EL_GRID_STEEL_AUTO_07   (EL_GRID_STEEL_AUTO_START + 7)
566 #define EL_GRID_STEEL_AUTO_END  EL_GRID_STEEL_AUTO_07
567
568 #define EL_DF_END               355
569
570 #define EL_BEAMER_RED_START     356
571 #define EL_BEAMER_RED_END       (EL_BEAMER_RED_START + 15)
572 #define EL_BEAMER_YELLOW_START  372
573 #define EL_BEAMER_YELLOW_END    (EL_BEAMER_YELLOW_START + 15)
574 #define EL_BEAMER_GREEN_START   388
575 #define EL_BEAMER_GREEN_END     (EL_BEAMER_GREEN_START + 15)
576 #define EL_BEAMER_BLUE_START    404
577 #define EL_BEAMER_BLUE_END      (EL_BEAMER_BLUE_START + 15)
578
579 // element definitions partially used for drawing graphics
580 #define EL_MCDUFFIN             420
581 #define EL_PACMAN               421
582 #define EL_FUSE_OFF             422
583 #define EL_WALL_STEEL           423
584 #define EL_WALL_WOOD            424
585 #define EL_WALL_ICE             425
586 #define EL_WALL_AMOEBA          426
587 #define EL_LASER                427
588 #define EL_RECEIVER             428
589 #define EL_DF_WALL_STEEL        429
590 #define EL_DF_WALL_WOOD         430
591
592 #define EL_DF_MIRROR_FIXED_START 431
593 #define EL_DF_MIRROR_FIXED_00   (EL_DF_MIRROR_FIXED_START + 0)
594 #define EL_DF_MIRROR_FIXED_01   (EL_DF_MIRROR_FIXED_START + 1)
595 #define EL_DF_MIRROR_FIXED_02   (EL_DF_MIRROR_FIXED_START + 2)
596 #define EL_DF_MIRROR_FIXED_03   (EL_DF_MIRROR_FIXED_START + 3)
597 #define EL_DF_MIRROR_FIXED_04   (EL_DF_MIRROR_FIXED_START + 4)
598 #define EL_DF_MIRROR_FIXED_05   (EL_DF_MIRROR_FIXED_START + 5)
599 #define EL_DF_MIRROR_FIXED_06   (EL_DF_MIRROR_FIXED_START + 6)
600 #define EL_DF_MIRROR_FIXED_07   (EL_DF_MIRROR_FIXED_START + 7)
601 #define EL_DF_MIRROR_FIXED_08   (EL_DF_MIRROR_FIXED_START + 8)
602 #define EL_DF_MIRROR_FIXED_09   (EL_DF_MIRROR_FIXED_START + 9)
603 #define EL_DF_MIRROR_FIXED_10   (EL_DF_MIRROR_FIXED_START + 10)
604 #define EL_DF_MIRROR_FIXED_11   (EL_DF_MIRROR_FIXED_START + 11)
605 #define EL_DF_MIRROR_FIXED_12   (EL_DF_MIRROR_FIXED_START + 12)
606 #define EL_DF_MIRROR_FIXED_13   (EL_DF_MIRROR_FIXED_START + 13)
607 #define EL_DF_MIRROR_FIXED_14   (EL_DF_MIRROR_FIXED_START + 14)
608 #define EL_DF_MIRROR_FIXED_15   (EL_DF_MIRROR_FIXED_START + 15)
609 #define EL_DF_MIRROR_FIXED_END  EL_DF_MIRROR_FIXED_15
610
611 #define EL_DF_SLOPE_START        447
612 #define EL_DF_SLOPE_00          (EL_DF_SLOPE_START + 0)
613 #define EL_DF_SLOPE_01          (EL_DF_SLOPE_START + 1)
614 #define EL_DF_SLOPE_02          (EL_DF_SLOPE_START + 2)
615 #define EL_DF_SLOPE_03          (EL_DF_SLOPE_START + 3)
616 #define EL_DF_SLOPE_END         EL_DF_SLOPE_03
617
618 #define EL_MM_END_2             450
619 #define EL_MM_END               EL_MM_END_2
620
621 // "real" (and therefore drawable) runtime elements
622 #define EL_EXIT_OPENING         500
623 #define EL_EXIT_CLOSING         501
624 #define EL_GRAY_BALL_ACTIVE     502
625 #define EL_GRAY_BALL_OPENING    503
626 #define EL_WALL_ICE_SHRINKING   504
627 #define EL_WALL_AMOEBA_GROWING  505
628 #define EL_BOMB_ACTIVE          506
629 #define EL_MINE_ACTIVE          507
630 #define EL_ENVELOPE_1_OPENING   508
631 #define EL_ENVELOPE_2_OPENING   509
632 #define EL_ENVELOPE_3_OPENING   510
633 #define EL_ENVELOPE_4_OPENING   511
634
635 #define EL_ENVELOPE_OPENING_START       EL_ENVELOPE_1_OPENING
636 #define EL_ENVELOPE_OPENING_END         EL_ENVELOPE_4_OPENING
637
638 #define EL_WALL_CHANGING_BASE   512
639 #define EL_WALL_CHANGING_START  (EL_WALL_CHANGING_BASE + 0)
640 #define EL_WALL_CHANGING_END    (EL_WALL_CHANGING_BASE + 15)
641
642 #define EL_FIRST_RUNTIME_EL     EL_EXIT_OPENING
643
644 // "unreal" (and therefore not drawable) runtime elements
645 #define EL_BLOCKED              600
646 #define EL_EXPLODING_OPAQUE     601
647 #define EL_EXPLODING_TRANSP     602
648
649
650 // game graphics:
651 //        0 -  191: graphics from "MirrorScreen"
652 //      192 -  255: pseudo graphics mapped to "MirrorScreen"
653 //      256 -  511: graphics from "MirrorFont"
654 //      512 -  767: graphics from "MirrorDF"
655
656 #define IMG_EMPTY               IMG_EMPTY_SPACE
657
658 // values for graphics/sounds action types
659 #define MM_ACTION_DEFAULT       0
660 #define MM_ACTION_WAITING       1
661 #define MM_ACTION_FALLING       2
662 #define MM_ACTION_MOVING        3
663 #define MM_ACTION_DIGGING       4
664 #define MM_ACTION_SNAPPING      5
665 #define MM_ACTION_COLLECTING    6
666 #define MM_ACTION_DROPPING      7
667 #define MM_ACTION_PUSHING       8
668 #define MM_ACTION_WALKING       9
669 #define MM_ACTION_PASSING       10
670 #define MM_ACTION_IMPACT        11
671 #define MM_ACTION_BREAKING      12
672 #define MM_ACTION_ACTIVATING    13
673 #define MM_ACTION_DEACTIVATING  14
674 #define MM_ACTION_OPENING       15
675 #define MM_ACTION_CLOSING       16
676 #define MM_ACTION_ATTACKING     17
677 #define MM_ACTION_GROWING       18
678 #define MM_ACTION_SHRINKING     19
679 #define MM_ACTION_ACTIVE        20
680 #define MM_ACTION_FILLING       21
681 #define MM_ACTION_EMPTYING      22
682 #define MM_ACTION_CHANGING      23
683 #define MM_ACTION_EXPLODING     24
684 #define MM_ACTION_BORING        25
685 #define MM_ACTION_BORING_1      26
686 #define MM_ACTION_BORING_2      27
687 #define MM_ACTION_BORING_3      28
688 #define MM_ACTION_BORING_4      29
689 #define MM_ACTION_BORING_5      30
690 #define MM_ACTION_BORING_6      31
691 #define MM_ACTION_BORING_7      32
692 #define MM_ACTION_BORING_8      33
693 #define MM_ACTION_BORING_9      34
694 #define MM_ACTION_BORING_10     35
695 #define MM_ACTION_SLEEPING      36
696 #define MM_ACTION_SLEEPING_1    37
697 #define MM_ACTION_SLEEPING_2    38
698 #define MM_ACTION_SLEEPING_3    39
699 #define MM_ACTION_AWAKENING     40
700 #define MM_ACTION_DYING         41
701 #define MM_ACTION_TURNING               42
702 #define MM_ACTION_TURNING_FROM_LEFT     43
703 #define MM_ACTION_TURNING_FROM_RIGHT    44
704 #define MM_ACTION_TURNING_FROM_UP       45
705 #define MM_ACTION_TURNING_FROM_DOWN     46
706 #define MM_ACTION_SMASHED_BY_ROCK       47
707 #define MM_ACTION_SMASHED_BY_SPRING     48
708 #define MM_ACTION_EATING                49
709 #define MM_ACTION_TWINKLING             50
710 #define MM_ACTION_SPLASHING             51
711 #define MM_ACTION_HITTING               52
712
713 // laser angles (directions)
714 #define ANG_RAY_RIGHT           0
715 #define ANG_RAY_UP              4
716 #define ANG_RAY_LEFT            8
717 #define ANG_RAY_DOWN            12
718
719 // laser angles (degree)
720 #define ANG_RAY_0               0
721 #define ANG_RAY_90              4
722 #define ANG_RAY_180             8
723 #define ANG_RAY_270             12
724 #define IS_22_5_ANGLE(angle)    ((angle) % 2)
725 #define IS_90_ANGLE(angle)      (!((angle) % 4))
726 #define IS_45_ANGLE(angle)      (!(((angle) + 2) % 4))
727 #define IS_HORIZ_ANGLE(angle)   (!((angle) % 8))
728 #define IS_VERT_ANGLE(angle)    (!(((angle) + 4) % 8))
729
730 // mirror angles
731 #define ANG_MIRROR_0            0
732 #define ANG_MIRROR_45           4
733 #define ANG_MIRROR_90           8
734 #define ANG_MIRROR_135          12
735
736 // positions for checking where laser already hits element
737 #define HIT_POS_CENTER          1
738 #define HIT_POS_EDGE            2
739 #define HIT_POS_BETWEEN         4
740
741 // masks for scanning elements
742 #define HIT_MASK_NO_HIT         0
743 #define HIT_MASK_TOPLEFT        1
744 #define HIT_MASK_TOPRIGHT       2
745 #define HIT_MASK_BOTTOMLEFT     4
746 #define HIT_MASK_BOTTOMRIGHT    8
747 #define HIT_MASK_LEFT           (HIT_MASK_TOPLEFT | HIT_MASK_BOTTOMLEFT)
748 #define HIT_MASK_RIGHT          (HIT_MASK_TOPRIGHT | HIT_MASK_BOTTOMRIGHT)
749 #define HIT_MASK_TOP            (HIT_MASK_TOPLEFT | HIT_MASK_TOPRIGHT)
750 #define HIT_MASK_BOTTOM         (HIT_MASK_BOTTOMLEFT | HIT_MASK_BOTTOMRIGHT)
751 #define HIT_MASK_DIAGONAL_1     (HIT_MASK_TOPLEFT  | HIT_MASK_BOTTOMRIGHT)
752 #define HIT_MASK_DIAGONAL_2     (HIT_MASK_TOPRIGHT | HIT_MASK_BOTTOMLEFT)
753 #define HIT_MASK_ALL            (HIT_MASK_LEFT | HIT_MASK_RIGHT)
754
755 // step values for rotating elements
756 #define ROTATE_NO_ROTATING      0
757 #define ROTATE_LEFT             (+1)
758 #define ROTATE_RIGHT            (-1)
759 #define BUTTON_ROTATION(button) ((button) == MB_LEFTBUTTON  ? ROTATE_LEFT :  \
760                                  (button) == MB_RIGHTBUTTON ? ROTATE_RIGHT : \
761                                  ROTATE_NO_ROTATING)
762
763 // game over values
764 #define GAME_OVER_NO_ENERGY     1
765 #define GAME_OVER_OVERLOADED    2
766 #define GAME_OVER_BOMB          3
767
768 #define PROGRAM_VERSION_MAJOR   2
769 #define PROGRAM_VERSION_MINOR   0
770 #define PROGRAM_VERSION_PATCH   2
771 #define PROGRAM_VERSION_STRING  "2.0.2"
772
773 // functions for version handling
774 #define MM_VERSION_IDENT(x,y,z) VERSION_IDENT(x,y,z,0)
775 #define MM_VERSION_MAJOR(x)     VERSION_PART_1(x)
776 #define MM_VERSION_MINOR(x)     VERSION_PART_2(x)
777 #define MM_VERSION_PATCH(x)     VERSION_PART_3(x)
778
779 // file version numbers for resource files (levels, score, setup, etc.)
780 // currently supported/known file version numbers:
781 //      1.4 (still in use)
782 //      2.0 (actual)
783
784 #define MM_FILE_VERSION_1_4     MM_VERSION_IDENT(1,4,0)
785 #define MM_FILE_VERSION_2_0     MM_VERSION_IDENT(2,0,0)
786
787 // file version does not change for every program version, but is changed
788 // when new features are introduced that are incompatible with older file
789 // versions, so that they can be treated accordingly
790 #define MM_FILE_VERSION_ACTUAL  MM_FILE_VERSION_2_0
791
792 #define MM_GAME_VERSION_ACTUAL  MM_VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
793                                                  PROGRAM_VERSION_MINOR, \
794                                                  PROGRAM_VERSION_PATCH)
795
796 #endif  // MM_MAIN_H