2c12cfcca502bfd61601d8f4d37a37f7f5a2afeb
[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
52 #define IS_GRID(e)              (Elementeigenschaften[e] & EP_BIT_GRID)
53 #define IS_MCDUFFIN(e)          (Elementeigenschaften[e] & EP_BIT_MCDUFFIN)
54 #define IS_RECTANGLE(e)         (Elementeigenschaften[e] & EP_BIT_RECTANGLE)
55 #define IS_MIRROR(e)            (Elementeigenschaften[e] & EP_BIT_MIRROR)
56 #define IS_MIRROR_FIXED(e)      (Elementeigenschaften[e] & EP_BIT_MIRROR_FIXED)
57 #define IS_POLAR(e)             (Elementeigenschaften[e] & EP_BIT_POLAR)
58 #define IS_POLAR_CROSS(e)       (Elementeigenschaften[e] & EP_BIT_POLAR_CROSS)
59 #define IS_BEAMER_OLD(e)        (Elementeigenschaften[e] & EP_BIT_BEAMER)
60 #define IS_CHAR(e)              (Elementeigenschaften[e] & EP_BIT_CHAR)
61 #define IS_REFLECTING(e)        (Elementeigenschaften[e] & EP_BIT_REFLECTING)
62 #define IS_ABSORBING(e)         (Elementeigenschaften[e] & EP_BIT_ABSORBING)
63 #define IS_INACTIVE(e)          (Elementeigenschaften[e] & EP_BIT_INACTIVE)
64 #define IS_MM_WALL(e)           (Elementeigenschaften[e] & EP_BIT_WALL)
65 #define IS_PACMAN(e)            (Elementeigenschaften[e] & EP_BIT_PACMAN)
66
67 #define IS_WALL_STEEL(e)        ((e) >= EL_WALL_STEEL_START &&          \
68                                  (e) <= EL_WALL_STEEL_END)
69 #define IS_WALL_WOOD(e)         ((e) >= EL_WALL_WOOD_START &&           \
70                                  (e) <= EL_WALL_WOOD_END)
71 #define IS_WALL_ICE(e)          ((e) >= EL_WALL_ICE_START &&            \
72                                  (e) <= EL_WALL_ICE_END)
73 #define IS_WALL_AMOEBA(e)       ((e) >= EL_WALL_AMOEBA_START &&         \
74                                  (e) <= EL_WALL_AMOEBA_END)
75 #define IS_DF_WALL_STEEL(e)     ((e) >= EL_DF_WALL_STEEL_START &&       \
76                                  (e) <= EL_DF_WALL_STEEL_END)
77 #define IS_DF_WALL_WOOD(e)      ((e) >= EL_DF_WALL_WOOD_START &&        \
78                                  (e) <= EL_DF_WALL_WOOD_END)
79 #define IS_DF_WALL(e)           ((e) >= EL_DF_WALL_START &&             \
80                                  (e) <= EL_DF_WALL_END)
81 #define IS_WALL(e)              (IS_MM_WALL(e) || IS_DF_WALL(e))
82 #define IS_WALL_CHANGING(e)     ((e) >= EL_WALL_CHANGING_START &&       \
83                                  (e) <= EL_WALL_CHANGING_END)
84 #define IS_GRID_STEEL(e)        ((e) >= EL_GRID_STEEL_START &&          \
85                                  (e) <= EL_GRID_STEEL_END)
86 #define IS_GRID_WOOD(e)         ((e) >= EL_GRID_WOOD_START &&           \
87                                  (e) <= EL_GRID_WOOD_END)
88 #define IS_GRID_WOOD_FIXED(e)   ((e) >= EL_GRID_WOOD_FIXED_START &&     \
89                                  (e) <= EL_GRID_WOOD_FIXED_END)
90 #define IS_GRID_STEEL_FIXED(e)  ((e) >= EL_GRID_STEEL_FIXED_START &&    \
91                                  (e) <= EL_GRID_STEEL_FIXED_END)
92 #define IS_GRID_WOOD_AUTO(e)    ((e) >= EL_GRID_WOOD_AUTO_START &&      \
93                                  (e) <= EL_GRID_WOOD_AUTO_END)
94 #define IS_GRID_STEEL_AUTO(e)   ((e) >= EL_GRID_STEEL_AUTO_START &&     \
95                                  (e) <= EL_GRID_STEEL_AUTO_END)
96 #define IS_DF_GRID(e)           (IS_GRID_WOOD_FIXED(e) ||               \
97                                  IS_GRID_STEEL_FIXED(e) ||              \
98                                  IS_GRID_WOOD_AUTO(e) ||                \
99                                  IS_GRID_STEEL_AUTO(e))
100 #define IS_DF_MIRROR(e)         ((e) >= EL_DF_MIRROR_START &&           \
101                                  (e) <= EL_DF_MIRROR_END)
102 #define IS_DF_MIRROR_AUTO(e)    ((e) >= EL_DF_MIRROR_AUTO_START &&      \
103                                  (e) <= EL_DF_MIRROR_AUTO_END)
104 #define IS_LASER(e)             ((e) >= EL_LASER_START &&               \
105                                  (e) <= EL_LASER_END)
106 #define IS_RECEIVER(e)          ((e) >= EL_RECEIVER_START &&            \
107                                  (e) <= EL_RECEIVER_END)
108 #define IS_FIBRE_OPTIC(e)       ((e) >= EL_FIBRE_OPTIC_START &&         \
109                                  (e) <= EL_FIBRE_OPTIC_END)
110 #define FIBRE_OPTIC_NR(e)       (((e) - EL_FIBRE_OPTIC_START) / 2)
111 #define IS_BEAMER(e)            ((e) >= EL_BEAMER_RED_START &&          \
112                                  (e) <= EL_BEAMER_BLUE_END)
113 #define BEAMER_CLASSIC_NR(e)    (((e) - EL_BEAMER_RED_START) / 16)
114 #define BEAMER_NR(e)            (IS_BEAMER(e) ? BEAMER_CLASSIC_NR(e) :  \
115                                  IS_FIBRE_OPTIC(e) ? (FIBRE_OPTIC_NR(e)+4) : 0)
116 #define IS_EXPLODING(e)         ((e) == EL_EXPLODING_OPAQUE ||          \
117                                  (e) == EL_EXPLODING_TRANSP)
118
119 #define IS_EATABLE4PACMAN(e)    ((e) == EL_EMPTY ||                     \
120                                  (e) == EL_KETTLE ||                    \
121                                  (e) == EL_CELL ||                      \
122                                  (e) == EL_BOMB ||                      \
123                                  IS_WALL_AMOEBA(e))
124
125 #define CAN_MOVE(e)             ((e) == EL_PACMAN)
126 #define IS_FREE(x,y)            (Tile[x][y] == EL_EMPTY)
127
128 #define IS_MOVING(x,y)          (MovPos[x][y] != 0)
129 #define IS_BLOCKED(x,y)         (Tile[x][y] == EL_BLOCKED)
130 #define IS_DRAWABLE(e)          ((e) < EL_BLOCKED)
131 #define IS_NOT_DRAWABLE(e)      ((e) >= EL_BLOCKED)
132
133 #define PLAYERINFO(x,y)         (&stored_player[StorePlayer[x][y]-EL_SPIELER1])
134
135 #define WALL_BASE(e)            ((e) & 0xfff0)
136 #define WALL_BITS(e)            ((e) & 0x000f)
137
138 // Bitmaps with graphic file
139 #define PIX_BACK                0
140 #define PIX_DOOR                1
141 #define PIX_TOONS               2
142 #define PIX_DF                  3
143 #define PIX_BIGFONT             4
144 #define PIX_SMALLFONT           5
145 #define PIX_MEDIUMFONT          6
146 // Bitmaps without graphic file
147 #define PIX_DB_DOOR             7
148
149 #define NUM_PICTURES            7
150 #define NUM_BITMAPS             8
151
152 // boundaries of arrays etc.
153 #define MAX_PLAYER_NAME_LEN     10
154 #define MAX_LEVEL_NAME_LEN      32
155 #define MAX_LEVEL_AUTHOR_LEN    32
156 #define MAX_SCORE_ENTRIES       100
157 #define MAX_ELEMENTS            700             // 500 static + 200 runtime
158
159 #define MICROLEVEL_SCROLL_DELAY 50      // delay for scrolling micro level
160 #define MICROLEVEL_LABEL_DELAY  250     // delay for micro level label
161
162 // score for elements
163 #define SC_COLLECTIBLE          0
164 #define SC_UNUSED_1             1
165 #define SC_UNUSED_2             2
166 #define SC_UNUSED_3             3
167 #define SC_UNUSED_4             4
168 #define SC_UNUSED_5             5
169 #define SC_PACMAN               6
170 #define SC_UNUSED_7             7
171 #define SC_UNUSED_8             8
172 #define SC_KEY                  9
173 #define SC_TIME_BONUS           10
174 #define SC_UNUSED_11            11
175 #define SC_UNUSED_12            12
176 #define SC_UNUSED_13            13
177 #define SC_LIGHTBALL            14
178 #define SC_UNUSED_15            15
179
180 #define LEVEL_SCORE_ELEMENTS    16      // level elements with score
181
182
183 extern DrawBuffer      *drawto_field;
184
185 extern int              game_status;
186 extern boolean          level_editor_test_game;
187
188 extern boolean          redraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
189 extern int              redraw_x1, redraw_y1;
190
191 extern short            Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
192 extern short            Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
193 extern short            Hit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
194 extern short            Box[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
195 extern short            Angle[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
196
197 extern short            MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
198 extern short            MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
199 extern short            MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
200 extern short            Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
201 extern short            Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
202 extern short            StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
203 extern short            Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
204 extern boolean          Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
205 extern short            AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
206 extern short            AmoebaCnt[MAX_NUM_AMOEBA];
207 extern short            AmoebaCnt2[MAX_NUM_AMOEBA];
208 extern short            ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
209
210 extern unsigned int     Elementeigenschaften[MAX_ELEMENTS];
211
212 extern int              level_nr;
213 extern int              lev_fieldx, lev_fieldy, scroll_x, scroll_y;
214
215 extern int              FX, FY, ScrollStepSize;
216 extern int              ScreenMovDir, ScreenMovPos, ScreenGfxPos;
217 extern int              GameFrameDelay;
218 extern int              FfwdFrameDelay;
219 extern int              BX1, BY1, BX2, BY2;
220 extern int              SBX_Left, SBX_Right;
221 extern int              SBY_Upper, SBY_Lower;
222 extern int              TimeFrames, TimePlayed, TimeLeft;
223
224 extern struct LevelInfo_MM      native_mm_level;
225 extern struct GameInfo_MM       game_mm;
226 extern struct LaserInfo         laser;
227
228 extern short            LX, LY, XS, YS, ELX, ELY;
229 extern short            CT, Ct;
230
231 extern int              dSX, dSY;
232 extern int              cSX, cSY;
233 extern int              cSX2, cSY2;
234 extern int              cFX, cFY;
235
236 extern Pixel            pen_fg, pen_bg, pen_ray, pen_magicolor[2];
237 extern int              color_status;
238
239 extern struct XY        Step[];
240 extern short            Sign[16];
241
242 extern char            *element_info[];
243 extern int              num_element_info;
244
245 // often used screen positions
246 #define DX                      534
247 #define DY                      60
248 #define EX                      DX
249 #define EY                      (DY + 178)
250 #define TILEX                   TILESIZE
251 #define TILEY                   TILESIZE
252 #define MINI_TILESIZE           (TILESIZE / 2)
253 #define MINI_TILEX              (TILEX / 2)
254 #define MINI_TILEY              (TILEY / 2)
255 #define MICRO_TILEX             (TILEX / 4)
256 #define MICRO_TILEY             (TILEY / 4)
257 #define MICRO_WALLX             (TILEX / 8)
258 #define MICRO_WALLY             (TILEY / 8)
259 #define MIDPOSX                 (SCR_FIELDX / 2)
260 #define MIDPOSY                 (SCR_FIELDY / 2)
261 #define DXSIZE                  100
262 #define DYSIZE                  280
263 #define VXSIZE                  DXSIZE
264 #define VYSIZE                  100
265 #define EXSIZE                  DXSIZE
266 #define EYSIZE                  (VXSIZE + 44)
267 #define FULL_SXSIZE             (2 + SXSIZE + 2)
268 #define FULL_SYSIZE             (2 + SYSIZE + 2)
269 #define MICROLEV_XPOS           (SX + 12 * TILEX)
270 #define MICROLEV_YPOS           (SY +  6 * TILEY)
271 #define MICROLEV_XSIZE          (STD_LEV_FIELDX * MICRO_TILEX)
272 #define MICROLEV_YSIZE          (STD_LEV_FIELDY * MICRO_TILEY)
273 #define MICROLABEL_XPOS         (SY)
274 #define MICROLABEL_YPOS         (SY + 352)
275 #define MICROLABEL_XSIZE        (SXSIZE)
276 #define MICROLABEL_YSIZE        (FONT4_YSIZE)
277
278 #define GFX_STARTX              SX
279 #define GFX_STARTY              SY
280 #define MINI_GFX_STARTX         (SX + 8 * TILEX)
281 #define MINI_GFX_STARTY         (SY + 6 * TILEY)
282 #define MICRO_GFX_STARTX        (MINI_GFX_STARTX + 8 * MINI_TILEX)
283 #define MICRO_GFX_STARTY        (MINI_GFX_STARTY + 6 * MINI_TILEY)
284 #define GFX_PER_LINE            16
285 #define MINI_GFX_PER_LINE       GFX_PER_LINE
286 #define MICRO_GFX_PER_LINE      GFX_PER_LINE
287
288 #define MINI_DF_STARTX          (8 * TILEX)
289 #define MINI_DF_STARTY          (8 * TILEY)
290 #define MICRO_DF_STARTX         (MINI_DF_STARTX + 8 * MINI_TILEX)
291 #define MICRO_DF_STARTY         (MINI_DF_STARTY + 8 * MINI_TILEY)
292 #define DF_PER_LINE             16
293 #define MINI_DF_PER_LINE        DF_PER_LINE
294 #define MICRO_DF_PER_LINE       DF_PER_LINE
295
296 #define MICRO_FONT_STARTX       (MICRO_DF_STARTX + 8 * MICRO_TILEX)
297 #define MICRO_FONT_STARTY       (MICRO_DF_STARTY + 8 * MICRO_TILEY)
298 #define MICRO_FONT_PER_LINE     8
299
300 // wall positions (that can be OR'ed together)
301 #define WALL_TOPLEFT            1
302 #define WALL_TOPRIGHT           2
303 #define WALL_BOTTOMLEFT         4
304 #define WALL_BOTTOMRIGHT        8
305 #define WALL_LEFT               (WALL_TOPLEFT    | WALL_BOTTOMLEFT)
306 #define WALL_RIGHT              (WALL_TOPRIGHT   | WALL_BOTTOMRIGHT)
307 #define WALL_TOP                (WALL_TOPLEFT    | WALL_TOPRIGHT)
308 #define WALL_BOTTOM             (WALL_BOTTOMLEFT | WALL_BOTTOMRIGHT)
309
310 // game elements:
311 //        0 - 499: real elements, stored in level file
312 //      500 - 699: flag elements, only used at runtime
313
314 // "real" level elements
315 #define EL_MM_START             0
316 #define EL_MM_START_1           EL_MM_START
317
318 #define EL_EMPTY                0
319 #define EL_MIRROR_START         1
320 #define EL_MIRROR_00            (EL_MIRROR_START + 0)
321 #define EL_MIRROR_01            (EL_MIRROR_START + 1)
322 #define EL_MIRROR_02            (EL_MIRROR_START + 2)
323 #define EL_MIRROR_03            (EL_MIRROR_START + 3)
324 #define EL_MIRROR_04            (EL_MIRROR_START + 4)
325 #define EL_MIRROR_05            (EL_MIRROR_START + 5)
326 #define EL_MIRROR_06            (EL_MIRROR_START + 6)
327 #define EL_MIRROR_07            (EL_MIRROR_START + 7)
328 #define EL_MIRROR_08            (EL_MIRROR_START + 8)
329 #define EL_MIRROR_09            (EL_MIRROR_START + 9)
330 #define EL_MIRROR_10            (EL_MIRROR_START + 10)
331 #define EL_MIRROR_11            (EL_MIRROR_START + 11)
332 #define EL_MIRROR_12            (EL_MIRROR_START + 12)
333 #define EL_MIRROR_13            (EL_MIRROR_START + 13)
334 #define EL_MIRROR_14            (EL_MIRROR_START + 14)
335 #define EL_MIRROR_15            (EL_MIRROR_START + 15)
336 #define EL_MIRROR_END           EL_MIRROR_15
337 #define EL_GRID_STEEL_START     17
338 #define EL_GRID_STEEL_00        (EL_GRID_STEEL_START + 0)
339 #define EL_GRID_STEEL_01        (EL_GRID_STEEL_START + 1)
340 #define EL_GRID_STEEL_02        (EL_GRID_STEEL_START + 2)
341 #define EL_GRID_STEEL_03        (EL_GRID_STEEL_START + 3)
342 #define EL_GRID_STEEL_END       EL_GRID_STEEL_03
343 #define EL_MCDUFFIN_START       21
344 #define EL_MCDUFFIN_RIGHT       (EL_MCDUFFIN_START + 0)
345 #define EL_MCDUFFIN_UP          (EL_MCDUFFIN_START + 1)
346 #define EL_MCDUFFIN_LEFT        (EL_MCDUFFIN_START + 2)
347 #define EL_MCDUFFIN_DOWN        (EL_MCDUFFIN_START + 3)
348 #define EL_MCDUFFIN_END         EL_MCDUFFIN_DOWN
349 #define EL_EXIT_CLOSED          25
350 #define EL_EXIT_OPENING_1       26
351 #define EL_EXIT_OPENING_2       27
352 #define EL_EXIT_OPEN            28
353 #define EL_KETTLE               29
354 #define EL_BOMB                 30
355 #define EL_PRISM                31
356 #define EL_WALL_START           32
357 #define EL_WALL_EMPTY           EL_WALL_START
358 #define EL_WALL_00              EL_WALL_START
359 #define EL_WALL_STEEL           EL_WALL_00
360 #define EL_WALL_STEEL_START     EL_WALL_00
361 #define EL_WALL_15              47
362 #define EL_WALL_STEEL_END       EL_WALL_15
363 #define EL_WALL_16              48
364 #define EL_WALL_WOOD            EL_WALL_16
365 #define EL_WALL_WOOD_START      EL_WALL_16
366 #define EL_WALL_31              63
367 #define EL_WALL_WOOD_END        EL_WALL_31
368 #define EL_WALL_32              64
369 #define EL_WALL_ICE             EL_WALL_32
370 #define EL_WALL_ICE_START       EL_WALL_32
371 #define EL_WALL_47              79
372 #define EL_WALL_ICE_END         EL_WALL_47
373 #define EL_WALL_48              80
374 #define EL_WALL_AMOEBA          EL_WALL_48
375 #define EL_WALL_AMOEBA_START    EL_WALL_48
376 #define EL_WALL_63              95
377 #define EL_WALL_AMOEBA_END      EL_WALL_63
378 #define EL_WALL_END             EL_WALL_63
379 #define EL_BLOCK_WOOD           96
380 #define EL_BALL_GRAY            97
381 #define EL_BEAMER_START         98
382 #define EL_BEAMER_00            (EL_BEAMER_START + 0)
383 #define EL_BEAMER_01            (EL_BEAMER_START + 1)
384 #define EL_BEAMER_02            (EL_BEAMER_START + 2)
385 #define EL_BEAMER_03            (EL_BEAMER_START + 3)
386 #define EL_BEAMER_04            (EL_BEAMER_START + 4)
387 #define EL_BEAMER_05            (EL_BEAMER_START + 5)
388 #define EL_BEAMER_06            (EL_BEAMER_START + 6)
389 #define EL_BEAMER_07            (EL_BEAMER_START + 7)
390 #define EL_BEAMER_08            (EL_BEAMER_START + 8)
391 #define EL_BEAMER_09            (EL_BEAMER_START + 9)
392 #define EL_BEAMER_10            (EL_BEAMER_START + 10)
393 #define EL_BEAMER_11            (EL_BEAMER_START + 11)
394 #define EL_BEAMER_12            (EL_BEAMER_START + 12)
395 #define EL_BEAMER_13            (EL_BEAMER_START + 13)
396 #define EL_BEAMER_14            (EL_BEAMER_START + 14)
397 #define EL_BEAMER_15            (EL_BEAMER_START + 15)
398 #define EL_BEAMER_END           EL_BEAMER_15
399 #define EL_FUSE_ON              114
400 #define EL_PACMAN_START         115
401 #define EL_PACMAN_RIGHT         (EL_PACMAN_START + 0)
402 #define EL_PACMAN_UP            (EL_PACMAN_START + 1)
403 #define EL_PACMAN_LEFT          (EL_PACMAN_START + 2)
404 #define EL_PACMAN_DOWN          (EL_PACMAN_START + 3)
405 #define EL_PACMAN_END           EL_PACMAN_DOWN
406 #define EL_POLAR_START          119
407 #define EL_POLAR_00             (EL_POLAR_START + 0)
408 #define EL_POLAR_01             (EL_POLAR_START + 1)
409 #define EL_POLAR_02             (EL_POLAR_START + 2)
410 #define EL_POLAR_03             (EL_POLAR_START + 3)
411 #define EL_POLAR_04             (EL_POLAR_START + 4)
412 #define EL_POLAR_05             (EL_POLAR_START + 5)
413 #define EL_POLAR_06             (EL_POLAR_START + 6)
414 #define EL_POLAR_07             (EL_POLAR_START + 7)
415 #define EL_POLAR_08             (EL_POLAR_START + 8)
416 #define EL_POLAR_09             (EL_POLAR_START + 9)
417 #define EL_POLAR_10             (EL_POLAR_START + 10)
418 #define EL_POLAR_11             (EL_POLAR_START + 11)
419 #define EL_POLAR_12             (EL_POLAR_START + 12)
420 #define EL_POLAR_13             (EL_POLAR_START + 13)
421 #define EL_POLAR_14             (EL_POLAR_START + 14)
422 #define EL_POLAR_15             (EL_POLAR_START + 15)
423 #define EL_POLAR_END            EL_POLAR_15
424 #define EL_POLAR_CROSS_START    135
425 #define EL_POLAR_CROSS_00       (EL_POLAR_CROSS_START + 0)
426 #define EL_POLAR_CROSS_01       (EL_POLAR_CROSS_START + 1)
427 #define EL_POLAR_CROSS_02       (EL_POLAR_CROSS_START + 2)
428 #define EL_POLAR_CROSS_03       (EL_POLAR_CROSS_START + 3)
429 #define EL_POLAR_CROSS_END      EL_POLAR_CROSS_03
430 #define EL_MIRROR_FIXED_START   139
431 #define EL_MIRROR_FIXED_00      (EL_MIRROR_FIXED_START + 0)
432 #define EL_MIRROR_FIXED_01      (EL_MIRROR_FIXED_START + 1)
433 #define EL_MIRROR_FIXED_02      (EL_MIRROR_FIXED_START + 2)
434 #define EL_MIRROR_FIXED_03      (EL_MIRROR_FIXED_START + 3)
435 #define EL_MIRROR_FIXED_END     EL_MIRROR_FIXED_03
436 #define EL_GATE_STONE           143
437 #define EL_KEY                  144
438 #define EL_LIGHTBULB_OFF        145
439 #define EL_LIGHTBULB_ON         146
440 #define EL_LIGHTBALL            147
441 #define EL_BLOCK_STONE          148
442 #define EL_GATE_WOOD            149
443 #define EL_FUEL_FULL            150
444 #define EL_GRID_WOOD_START      151
445 #define EL_GRID_WOOD_00         (EL_GRID_WOOD_START + 0)
446 #define EL_GRID_WOOD_01         (EL_GRID_WOOD_START + 1)
447 #define EL_GRID_WOOD_02         (EL_GRID_WOOD_START + 2)
448 #define EL_GRID_WOOD_03         (EL_GRID_WOOD_START + 3)
449 #define EL_GRID_WOOD_END        EL_GRID_WOOD_03
450 #define EL_FUEL_EMPTY           155
451
452 #define EL_MM_END_1             155
453
454 #define EL_CHAR_START           160
455 #define EL_CHAR_ASCII0          (EL_CHAR_START - 32)
456 #define EL_CHAR_AUSRUF          (EL_CHAR_ASCII0 + 33)
457 #define EL_CHAR_ZOLL            (EL_CHAR_ASCII0 + 34)
458 #define EL_CHAR_RAUTE           (EL_CHAR_ASCII0 + 35)
459 #define EL_CHAR_DOLLAR          (EL_CHAR_ASCII0 + 36)
460 #define EL_CHAR_PROZ            (EL_CHAR_ASCII0 + 37)
461 #define EL_CHAR_AMPERSAND       (EL_CHAR_ASCII0 + 38)
462 #define EL_CHAR_APOSTR          (EL_CHAR_ASCII0 + 39)
463 #define EL_CHAR_KLAMM1          (EL_CHAR_ASCII0 + 40)
464 #define EL_CHAR_KLAMM2          (EL_CHAR_ASCII0 + 41)
465 #define EL_CHAR_MULT            (EL_CHAR_ASCII0 + 42)
466 #define EL_CHAR_PLUS            (EL_CHAR_ASCII0 + 43)
467 #define EL_CHAR_KOMMA           (EL_CHAR_ASCII0 + 44)
468 #define EL_CHAR_MINUS           (EL_CHAR_ASCII0 + 45)
469 #define EL_CHAR_PUNKT           (EL_CHAR_ASCII0 + 46)
470 #define EL_CHAR_SLASH           (EL_CHAR_ASCII0 + 47)
471 #define EL_CHAR_0               (EL_CHAR_ASCII0 + 48)
472 #define EL_CHAR_9               (EL_CHAR_ASCII0 + 57)
473 #define EL_CHAR_DOPPEL          (EL_CHAR_ASCII0 + 58)
474 #define EL_CHAR_SEMIKL          (EL_CHAR_ASCII0 + 59)
475 #define EL_CHAR_LT              (EL_CHAR_ASCII0 + 60)
476 #define EL_CHAR_GLEICH          (EL_CHAR_ASCII0 + 61)
477 #define EL_CHAR_GT              (EL_CHAR_ASCII0 + 62)
478 #define EL_CHAR_FRAGE           (EL_CHAR_ASCII0 + 63)
479 #define EL_CHAR_AT              (EL_CHAR_ASCII0 + 64)
480 #define EL_CHAR_A               (EL_CHAR_ASCII0 + 65)
481 #define EL_CHAR_Z               (EL_CHAR_ASCII0 + 90)
482 #define EL_CHAR_AE              (EL_CHAR_ASCII0 + 91)
483 #define EL_CHAR_OE              (EL_CHAR_ASCII0 + 92)
484 #define EL_CHAR_UE              (EL_CHAR_ASCII0 + 93)
485 #define EL_CHAR_COPY            (EL_CHAR_ASCII0 + 94)
486 #define EL_CHAR_END             (EL_CHAR_START + 79)
487
488 #define EL_CHAR(x)              ((x) == CHAR_BYTE_UMLAUT_A ? EL_CHAR_AE : \
489                                  (x) == CHAR_BYTE_UMLAUT_O ? EL_CHAR_OE : \
490                                  (x) == CHAR_BYTE_UMLAUT_U ? EL_CHAR_UE : \
491                                  EL_CHAR_A + (x) - 'A')
492
493 #define EL_MM_START_2           240
494
495 // elements for "Deflektor" style levels
496 #define EL_DF_START             EL_MM_START_2
497
498 #define EL_DF_MIRROR_START      EL_DF_START
499 #define EL_DF_MIRROR_00         (EL_DF_MIRROR_START + 0)
500 #define EL_DF_MIRROR_01         (EL_DF_MIRROR_START + 1)
501 #define EL_DF_MIRROR_02         (EL_DF_MIRROR_START + 2)
502 #define EL_DF_MIRROR_03         (EL_DF_MIRROR_START + 3)
503 #define EL_DF_MIRROR_04         (EL_DF_MIRROR_START + 4)
504 #define EL_DF_MIRROR_05         (EL_DF_MIRROR_START + 5)
505 #define EL_DF_MIRROR_06         (EL_DF_MIRROR_START + 6)
506 #define EL_DF_MIRROR_07         (EL_DF_MIRROR_START + 7)
507 #define EL_DF_MIRROR_08         (EL_DF_MIRROR_START + 8)
508 #define EL_DF_MIRROR_09         (EL_DF_MIRROR_START + 9)
509 #define EL_DF_MIRROR_10         (EL_DF_MIRROR_START + 10)
510 #define EL_DF_MIRROR_11         (EL_DF_MIRROR_START + 11)
511 #define EL_DF_MIRROR_12         (EL_DF_MIRROR_START + 12)
512 #define EL_DF_MIRROR_13         (EL_DF_MIRROR_START + 13)
513 #define EL_DF_MIRROR_14         (EL_DF_MIRROR_START + 14)
514 #define EL_DF_MIRROR_15         (EL_DF_MIRROR_START + 15)
515 #define EL_DF_MIRROR_END        EL_DF_MIRROR_15
516
517 #define EL_GRID_WOOD_FIXED_START 256
518 #define EL_GRID_WOOD_FIXED_00   (EL_GRID_WOOD_FIXED_START + 0)  //   0.0°
519 #define EL_GRID_WOOD_FIXED_01   (EL_GRID_WOOD_FIXED_START + 1)  //  22.5°
520 #define EL_GRID_WOOD_FIXED_02   (EL_GRID_WOOD_FIXED_START + 2)  //  45.0°
521 #define EL_GRID_WOOD_FIXED_03   (EL_GRID_WOOD_FIXED_START + 3)  //  67.5°
522 #define EL_GRID_WOOD_FIXED_04   (EL_GRID_WOOD_FIXED_START + 4)  //  90.0°
523 #define EL_GRID_WOOD_FIXED_05   (EL_GRID_WOOD_FIXED_START + 5)  // 112.5°
524 #define EL_GRID_WOOD_FIXED_06   (EL_GRID_WOOD_FIXED_START + 6)  // 135.0°
525 #define EL_GRID_WOOD_FIXED_07   (EL_GRID_WOOD_FIXED_START + 7)  // 157.5°
526 #define EL_GRID_WOOD_FIXED_END  EL_GRID_WOOD_FIXED_07
527
528 #define EL_GRID_STEEL_FIXED_START 264
529 #define EL_GRID_STEEL_FIXED_00  (EL_GRID_STEEL_FIXED_START + 0) //   0.0°
530 #define EL_GRID_STEEL_FIXED_01  (EL_GRID_STEEL_FIXED_START + 1) //  22.5°
531 #define EL_GRID_STEEL_FIXED_02  (EL_GRID_STEEL_FIXED_START + 2) //  45.0°
532 #define EL_GRID_STEEL_FIXED_03  (EL_GRID_STEEL_FIXED_START + 3) //  67.5°
533 #define EL_GRID_STEEL_FIXED_04  (EL_GRID_STEEL_FIXED_START + 4) //  90.0°
534 #define EL_GRID_STEEL_FIXED_05  (EL_GRID_STEEL_FIXED_START + 5) // 112.5°
535 #define EL_GRID_STEEL_FIXED_06  (EL_GRID_STEEL_FIXED_START + 6) // 135.0°
536 #define EL_GRID_STEEL_FIXED_07  (EL_GRID_STEEL_FIXED_START + 7) // 157.5°
537 #define EL_GRID_STEEL_FIXED_END EL_GRID_STEEL_FIXED_07
538
539 #define EL_DF_WALL_WOOD         272
540 #define EL_DF_WALL_START        EL_DF_WALL_WOOD_START
541 #define EL_DF_WALL_WOOD_START   (EL_DF_WALL_WOOD + 0)
542 #define EL_DF_WALL_WOOD_END     (EL_DF_WALL_WOOD + 15)
543
544 #define EL_DF_WALL_STEEL        288
545 #define EL_DF_WALL_STEEL_START  (EL_DF_WALL_STEEL + 0)
546 #define EL_DF_WALL_STEEL_END    (EL_DF_WALL_STEEL + 15)
547 #define EL_DF_WALL_END          EL_DF_WALL_STEEL_END
548
549 #define EL_DF_EMPTY             304
550 #define EL_CELL                 305
551 #define EL_MINE                 306
552 #define EL_REFRACTOR            307
553
554 #define EL_LASER_START          308
555 #define EL_LASER_RIGHT          (EL_LASER_START + 0)
556 #define EL_LASER_UP             (EL_LASER_START + 1)
557 #define EL_LASER_LEFT           (EL_LASER_START + 2)
558 #define EL_LASER_DOWN           (EL_LASER_START + 3)
559 #define EL_LASER_END            EL_LASER_DOWN
560
561 #define EL_RECEIVER_START       312
562 #define EL_RECEIVER_RIGHT       (EL_RECEIVER_START + 0)
563 #define EL_RECEIVER_UP          (EL_RECEIVER_START + 1)
564 #define EL_RECEIVER_LEFT        (EL_RECEIVER_START + 2)
565 #define EL_RECEIVER_DOWN        (EL_RECEIVER_START + 3)
566 #define EL_RECEIVER_END         EL_RECEIVER_DOWN
567
568 #define EL_FIBRE_OPTIC_START    316
569 #define EL_FIBRE_OPTIC_00       (EL_FIBRE_OPTIC_START + 0)
570 #define EL_FIBRE_OPTIC_01       (EL_FIBRE_OPTIC_START + 1)
571 #define EL_FIBRE_OPTIC_02       (EL_FIBRE_OPTIC_START + 2)
572 #define EL_FIBRE_OPTIC_03       (EL_FIBRE_OPTIC_START + 3)
573 #define EL_FIBRE_OPTIC_04       (EL_FIBRE_OPTIC_START + 4)
574 #define EL_FIBRE_OPTIC_05       (EL_FIBRE_OPTIC_START + 5)
575 #define EL_FIBRE_OPTIC_06       (EL_FIBRE_OPTIC_START + 6)
576 #define EL_FIBRE_OPTIC_07       (EL_FIBRE_OPTIC_START + 7)
577 #define EL_FIBRE_OPTIC_END      EL_FIBRE_OPTIC_07
578
579 #define EL_DF_MIRROR_AUTO_START 324
580 #define EL_DF_MIRROR_AUTO_00    (EL_DF_MIRROR_AUTO_START + 0)
581 #define EL_DF_MIRROR_AUTO_01    (EL_DF_MIRROR_AUTO_START + 1)
582 #define EL_DF_MIRROR_AUTO_02    (EL_DF_MIRROR_AUTO_START + 2)
583 #define EL_DF_MIRROR_AUTO_03    (EL_DF_MIRROR_AUTO_START + 3)
584 #define EL_DF_MIRROR_AUTO_04    (EL_DF_MIRROR_AUTO_START + 4)
585 #define EL_DF_MIRROR_AUTO_05    (EL_DF_MIRROR_AUTO_START + 5)
586 #define EL_DF_MIRROR_AUTO_06    (EL_DF_MIRROR_AUTO_START + 6)
587 #define EL_DF_MIRROR_AUTO_07    (EL_DF_MIRROR_AUTO_START + 7)
588 #define EL_DF_MIRROR_AUTO_08    (EL_DF_MIRROR_AUTO_START + 8)
589 #define EL_DF_MIRROR_AUTO_09    (EL_DF_MIRROR_AUTO_START + 9)
590 #define EL_DF_MIRROR_AUTO_10    (EL_DF_MIRROR_AUTO_START + 10)
591 #define EL_DF_MIRROR_AUTO_11    (EL_DF_MIRROR_AUTO_START + 11)
592 #define EL_DF_MIRROR_AUTO_12    (EL_DF_MIRROR_AUTO_START + 12)
593 #define EL_DF_MIRROR_AUTO_13    (EL_DF_MIRROR_AUTO_START + 13)
594 #define EL_DF_MIRROR_AUTO_14    (EL_DF_MIRROR_AUTO_START + 14)
595 #define EL_DF_MIRROR_AUTO_15    (EL_DF_MIRROR_AUTO_START + 15)
596 #define EL_DF_MIRROR_AUTO_END   EL_DF_MIRROR_AUTO_15
597
598 #define EL_GRID_WOOD_AUTO_START 340
599 #define EL_GRID_WOOD_AUTO_00    (EL_GRID_WOOD_AUTO_START + 0)
600 #define EL_GRID_WOOD_AUTO_01    (EL_GRID_WOOD_AUTO_START + 1)
601 #define EL_GRID_WOOD_AUTO_02    (EL_GRID_WOOD_AUTO_START + 2)
602 #define EL_GRID_WOOD_AUTO_03    (EL_GRID_WOOD_AUTO_START + 3)
603 #define EL_GRID_WOOD_AUTO_04    (EL_GRID_WOOD_AUTO_START + 4)
604 #define EL_GRID_WOOD_AUTO_05    (EL_GRID_WOOD_AUTO_START + 5)
605 #define EL_GRID_WOOD_AUTO_06    (EL_GRID_WOOD_AUTO_START + 6)
606 #define EL_GRID_WOOD_AUTO_07    (EL_GRID_WOOD_AUTO_START + 7)
607 #define EL_GRID_WOOD_AUTO_END   EL_GRID_WOOD_AUTO_07
608
609 #define EL_GRID_STEEL_AUTO_START 348
610 #define EL_GRID_STEEL_AUTO_00   (EL_GRID_STEEL_AUTO_START + 0)
611 #define EL_GRID_STEEL_AUTO_01   (EL_GRID_STEEL_AUTO_START + 1)
612 #define EL_GRID_STEEL_AUTO_02   (EL_GRID_STEEL_AUTO_START + 2)
613 #define EL_GRID_STEEL_AUTO_03   (EL_GRID_STEEL_AUTO_START + 3)
614 #define EL_GRID_STEEL_AUTO_04   (EL_GRID_STEEL_AUTO_START + 4)
615 #define EL_GRID_STEEL_AUTO_05   (EL_GRID_STEEL_AUTO_START + 5)
616 #define EL_GRID_STEEL_AUTO_06   (EL_GRID_STEEL_AUTO_START + 6)
617 #define EL_GRID_STEEL_AUTO_07   (EL_GRID_STEEL_AUTO_START + 7)
618 #define EL_GRID_STEEL_AUTO_END  EL_GRID_STEEL_AUTO_07
619
620 #define EL_DF_END               355
621
622 #define EL_BEAMER_RED_START     356
623 #define EL_BEAMER_RED_END       (EL_BEAMER_RED_START + 15)
624 #define EL_BEAMER_YELLOW_START  372
625 #define EL_BEAMER_YELLOW_END    (EL_BEAMER_YELLOW_START + 15)
626 #define EL_BEAMER_GREEN_START   388
627 #define EL_BEAMER_GREEN_END     (EL_BEAMER_GREEN_START + 15)
628 #define EL_BEAMER_BLUE_START    404
629 #define EL_BEAMER_BLUE_END      (EL_BEAMER_BLUE_START + 15)
630
631 // element definitions partially used for drawing graphics
632 #define EL_MCDUFFIN             420
633 #define EL_PACMAN               421
634 #define EL_FUSE_OFF             422
635 #define EL_STEEL_WALL           423
636 #define EL_WOODEN_WALL          424
637 #define EL_ICE_WALL             425
638 #define EL_AMOEBA_WALL          426
639 #define EL_LASER                427
640 #define EL_RECEIVER             428
641 #define EL_DF_STEEL_WALL        429
642 #define EL_DF_WOODEN_WALL       430
643
644 #define EL_MM_END_2             430
645 #define EL_MM_END               EL_MM_END_2
646
647 // "real" (and therefore drawable) runtime elements
648 #define EL_EXIT_OPENING         500
649 #define EL_EXIT_CLOSING         501
650 #define EL_GRAY_BALL_OPENING    502
651 #define EL_ICE_WALL_SHRINKING   503
652 #define EL_AMOEBA_WALL_GROWING  504
653
654 #define EL_WALL_CHANGING        512
655 #define EL_WALL_CHANGING_START  (EL_WALL_CHANGING + 0)
656 #define EL_WALL_CHANGING_END    (EL_WALL_CHANGING + 15)
657
658 #define EL_FIRST_RUNTIME_EL     EL_EXIT_OPENING
659
660 // "unreal" (and therefore not drawable) runtime elements
661 #define EL_BLOCKED              600
662 #define EL_EXPLODING_OPAQUE     601
663 #define EL_EXPLODING_TRANSP     602
664
665
666 // game graphics:
667 //        0 -  191: graphics from "MirrorScreen"
668 //      192 -  255: pseudo graphics mapped to "MirrorScreen"
669 //      256 -  511: graphics from "MirrorFont"
670 //      512 -  767: graphics from "MirrorDF"
671
672 #define IMG_EMPTY               IMG_EMPTY_SPACE
673
674 #define GFX_START_MIRRORSCREEN  0
675 #define GFX_END_MIRRORSCREEN    191
676 #define GFX_START_PSEUDO        192
677 #define GFX_END_PSEUDO          255
678 #define GFX_START_MIRRORFONT    256
679 #define GFX_END_MIRRORFONT      511
680 #define GFX_START_MIRRORDF      512
681 #define GFX_END_MIRRORDF        767
682
683 #define NUM_TILES               512
684
685 // graphics from "MirrorScreen"
686 #define GFX_EMPTY               (-1)
687 // row 0 (0)
688 #define GFX_MIRROR_START        0
689 #define GFX_MIRROR              GFX_MIRROR_START
690 #define GFX_MIRROR_00           (GFX_MIRROR_START + 0)
691 #define GFX_MIRROR_01           (GFX_MIRROR_START + 1)
692 #define GFX_MIRROR_02           (GFX_MIRROR_START + 2)
693 #define GFX_MIRROR_03           (GFX_MIRROR_START + 3)
694 #define GFX_MIRROR_04           (GFX_MIRROR_START + 4)
695 #define GFX_MIRROR_05           (GFX_MIRROR_START + 5)
696 #define GFX_MIRROR_06           (GFX_MIRROR_START + 6)
697 #define GFX_MIRROR_07           (GFX_MIRROR_START + 7)
698 #define GFX_MIRROR_08           (GFX_MIRROR_START + 8)
699 #define GFX_MIRROR_09           (GFX_MIRROR_START + 9)
700 #define GFX_MIRROR_10           (GFX_MIRROR_START + 10)
701 #define GFX_MIRROR_11           (GFX_MIRROR_START + 11)
702 #define GFX_MIRROR_12           (GFX_MIRROR_START + 12)
703 #define GFX_MIRROR_13           (GFX_MIRROR_START + 13)
704 #define GFX_MIRROR_14           (GFX_MIRROR_START + 14)
705 #define GFX_MIRROR_15           (GFX_MIRROR_START + 15)
706 #define GFX_MIRROR_END          GFX_MIRROR_15
707 // row 1 (16)
708 #define GFX_GRID_STEEL_START    16
709 #define GFX_GRID_STEEL          GFX_GRID_STEEL_START
710 #define GFX_GRID_STEEL_00       (GFX_GRID_STEEL_START + 0)
711 #define GFX_GRID_STEEL_01       (GFX_GRID_STEEL_START + 1)
712 #define GFX_GRID_STEEL_02       (GFX_GRID_STEEL_START + 2)
713 #define GFX_GRID_STEEL_03       (GFX_GRID_STEEL_START + 3)
714 #define GFX_MCDUFFIN_START      20
715 #define GFX_MCDUFFIN            GFX_MCDUFFIN_START
716 #define GFX_MCDUFFIN_RIGHT      (GFX_MCDUFFIN_START + 0)
717 #define GFX_MCDUFFIN_UP         (GFX_MCDUFFIN_START + 1)
718 #define GFX_MCDUFFIN_LEFT       (GFX_MCDUFFIN_START + 2)
719 #define GFX_MCDUFFIN_DOWN       (GFX_MCDUFFIN_START + 3)
720 #define GFX_EXIT_CLOSED         24
721 #define GFX_EXIT_OPENING_1      25
722 #define GFX_EXIT_OPENING_2      26
723 #define GFX_EXIT_OPEN           27
724 #define GFX_KETTLE              28
725 #define GFX_EXPLOSION_KETTLE    29
726 // row 2 (32)
727 #define GFX_PRISM               32
728 #define GFX_WALL_SEVERAL        33
729 #define GFX_WALL_ANIMATION      34
730 #define GFX_BLOCK_WOOD          36
731 #define GFX_BOMB                37
732 #define GFX_FUSE_ON             38
733 #define GFX_FUSE_OFF            39
734 #define GFX_GATE_STONE          40
735 #define GFX_KEY                 41
736 #define GFX_LIGHTBULB_OFF       42
737 #define GFX_LIGHTBULB_ON        43
738 #define GFX_BALL_RED            44
739 #define GFX_BALL_BLUE           45
740 #define GFX_BALL_YELLOW         46
741 #define GFX_BALL_GRAY           47
742 // row 3 (48)
743 #define GFX_BEAMER_START        48
744 #define GFX_BEAMER_END          63
745 // row 4 (64)
746 #define GFX_PACMAN_START        64
747 #define GFX_PACMAN              GFX_PACMAN_START
748 #define GFX_PACMAN_RIGHT        (GFX_PACMAN_START + 0)
749 #define GFX_PACMAN_UP           (GFX_PACMAN_START + 1)
750 #define GFX_PACMAN_LEFT         (GFX_PACMAN_START + 2)
751 #define GFX_PACMAN_DOWN         (GFX_PACMAN_START + 3)
752 #define GFX_EXPLOSION_START     72
753 #define GFX_EXPLOSION_SHORT     76
754 #define GFX_EXPLOSION_LAST      78
755 // row 5 (80)
756 #define GFX_POLAR_START         80
757 #define GFX_POLAR_END           95
758 // row 6 (96)
759 #define GFX_POLAR_CROSS_START   96
760 #define GFX_POLAR_CROSS         GFX_POLAR_CROSS_START
761 #define GFX_POLAR_CROSS_00      (GFX_POLAR_CROSS_START + 0)
762 #define GFX_POLAR_CROSS_01      (GFX_POLAR_CROSS_START + 1)
763 #define GFX_POLAR_CROSS_02      (GFX_POLAR_CROSS_START + 2)
764 #define GFX_POLAR_CROSS_03      (GFX_POLAR_CROSS_START + 3)
765 #define GFX_MIRROR_FIXED_START  100
766 #define GFX_MIRROR_FIXED        GFX_MIRROR_FIXED_START
767 #define GFX_MIRROR_FIXED_00     (GFX_MIRROR_FIXED_START + 0)
768 #define GFX_MIRROR_FIXED_01     (GFX_MIRROR_FIXED_START + 1)
769 #define GFX_MIRROR_FIXED_02     (GFX_MIRROR_FIXED_START + 2)
770 #define GFX_MIRROR_FIXED_03     (GFX_MIRROR_FIXED_START + 3)
771 // row 7 (112)
772 #define GFX_BLOCK_STONE         112
773 #define GFX_GATE_WOOD           113
774 #define GFX_FUEL_FULL           114
775 #define GFX_FUEL_EMPTY          115
776 #define GFX_GRID_WOOD_00        116
777 #define GFX_GRID_WOOD_01        117
778 #define GFX_GRID_WOOD_02        118
779 #define GFX_GRID_WOOD_03        119
780 // row 8 (128)
781 #define GFX_ARROW_BLUE_LEFT     128
782 #define GFX_ARROW_BLUE_RIGHT    129
783 #define GFX_ARROW_BLUE_UP       130
784 #define GFX_ARROW_BLUE_DOWN     131
785 #define GFX_ARROW_RED_LEFT      132
786 #define GFX_ARROW_RED_RIGHT     133
787 #define GFX_ARROW_RED_UP        134
788 #define GFX_ARROW_RED_DOWN      135
789 // row 9 (144)
790 #define GFX_SCROLLBAR_BLUE      144
791 #define GFX_SCROLLBAR_RED       145
792 // row 10 (160)
793 #define GFX_MASK_CIRCLE         160
794 #define GFX_MASK_RECTANGLE      161
795 #define GFX_MASK_RECTANGLE2     162
796 #define GFX_MASK_RECTANGLE3     163
797 #define GFX_MASK_GRID_00        164
798 #define GFX_MASK_GRID_01        165
799 #define GFX_MASK_GRID_02        166
800 #define GFX_MASK_GRID_03        167
801 // row 11 (176)
802 #define GFX_MASK_MCDUFFIN_00    176
803 #define GFX_MASK_MCDUFFIN_01    177
804 #define GFX_MASK_MCDUFFIN_02    178
805 #define GFX_MASK_MCDUFFIN_03    179
806
807 // pseudo-graphics; will be mapped to other graphics
808 #define GFX_WALL_STEEL          192
809 #define GFX_WALL_WOOD           193
810 #define GFX_WALL_ICE            194
811 #define GFX_WALL_AMOEBA         195
812 #define GFX_DF_WALL_STEEL       196
813 #define GFX_DF_WALL_WOOD        197
814
815 #define GFX_KUGEL_ROT           GFX_BALL_RED
816 #define GFX_KUGEL_BLAU          GFX_BALL_BLUE
817 #define GFX_KUGEL_GELB          GFX_BALL_YELLOW
818 #define GFX_KUGEL_GRAU          GFX_BALL_GRAY
819
820 // graphics from "MirrorFont"
821 #define GFX_CHAR_START          (GFX_START_MIRRORFONT)
822 #define GFX_CHAR_ASCII0         (GFX_CHAR_START - 32)
823 #define GFX_CHAR_AUSRUF         (GFX_CHAR_ASCII0 + 33)
824 #define GFX_CHAR_ZOLL           (GFX_CHAR_ASCII0 + 34)
825 #define GFX_CHAR_DOLLAR         (GFX_CHAR_ASCII0 + 36)
826 #define GFX_CHAR_PROZ           (GFX_CHAR_ASCII0 + 37)
827 #define GFX_CHAR_APOSTR         (GFX_CHAR_ASCII0 + 39)
828 #define GFX_CHAR_KLAMM1         (GFX_CHAR_ASCII0 + 40)
829 #define GFX_CHAR_KLAMM2         (GFX_CHAR_ASCII0 + 41)
830 #define GFX_CHAR_PLUS           (GFX_CHAR_ASCII0 + 43)
831 #define GFX_CHAR_KOMMA          (GFX_CHAR_ASCII0 + 44)
832 #define GFX_CHAR_MINUS          (GFX_CHAR_ASCII0 + 45)
833 #define GFX_CHAR_PUNKT          (GFX_CHAR_ASCII0 + 46)
834 #define GFX_CHAR_SLASH          (GFX_CHAR_ASCII0 + 47)
835 #define GFX_CHAR_0              (GFX_CHAR_ASCII0 + 48)
836 #define GFX_CHAR_9              (GFX_CHAR_ASCII0 + 57)
837 #define GFX_CHAR_DOPPEL         (GFX_CHAR_ASCII0 + 58)
838 #define GFX_CHAR_SEMIKL         (GFX_CHAR_ASCII0 + 59)
839 #define GFX_CHAR_LT             (GFX_CHAR_ASCII0 + 60)
840 #define GFX_CHAR_GLEICH         (GFX_CHAR_ASCII0 + 61)
841 #define GFX_CHAR_GT             (GFX_CHAR_ASCII0 + 62)
842 #define GFX_CHAR_FRAGE          (GFX_CHAR_ASCII0 + 63)
843 #define GFX_CHAR_AT             (GFX_CHAR_ASCII0 + 64)
844 #define GFX_CHAR_A              (GFX_CHAR_ASCII0 + 65)
845 #define GFX_CHAR_Z              (GFX_CHAR_ASCII0 + 90)
846 #define GFX_CHAR_AE             (GFX_CHAR_ASCII0 + 91)
847 #define GFX_CHAR_OE             (GFX_CHAR_ASCII0 + 92)
848 #define GFX_CHAR_UE             (GFX_CHAR_ASCII0 + 93)
849 #define GFX_CHAR_COPY           (GFX_CHAR_ASCII0 + 94)
850 #define GFX_CHAR_END            (GFX_CHAR_START + 79)
851
852 // graphics from "MirrorDF"
853 #define GFX_DF_MIRROR_00        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  0)
854 #define GFX_DF_MIRROR_01        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  1)
855 #define GFX_DF_MIRROR_02        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  2)
856 #define GFX_DF_MIRROR_03        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  3)
857 #define GFX_DF_MIRROR_04        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  4)
858 #define GFX_DF_MIRROR_05        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  5)
859 #define GFX_DF_MIRROR_06        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  6)
860 #define GFX_DF_MIRROR_07        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  7)
861 #define GFX_DF_MIRROR_08        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  8)
862 #define GFX_DF_MIRROR_09        (GFX_START_MIRRORDF +  0 * DF_PER_LINE +  9)
863 #define GFX_DF_MIRROR_10        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 10)
864 #define GFX_DF_MIRROR_11        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 11)
865 #define GFX_DF_MIRROR_12        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 12)
866 #define GFX_DF_MIRROR_13        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 13)
867 #define GFX_DF_MIRROR_14        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 14)
868 #define GFX_DF_MIRROR_15        (GFX_START_MIRRORDF +  0 * DF_PER_LINE + 15)
869
870 #define GFX_DF_MIRROR_AUTO_00   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  0)
871 #define GFX_DF_MIRROR_AUTO_01   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  1)
872 #define GFX_DF_MIRROR_AUTO_02   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  2)
873 #define GFX_DF_MIRROR_AUTO_03   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  3)
874 #define GFX_DF_MIRROR_AUTO_04   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  4)
875 #define GFX_DF_MIRROR_AUTO_05   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  5)
876 #define GFX_DF_MIRROR_AUTO_06   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  6)
877 #define GFX_DF_MIRROR_AUTO_07   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  7)
878 #define GFX_DF_MIRROR_AUTO_08   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  8)
879 #define GFX_DF_MIRROR_AUTO_09   (GFX_START_MIRRORDF +  1 * DF_PER_LINE +  9)
880 #define GFX_DF_MIRROR_AUTO_10   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 10)
881 #define GFX_DF_MIRROR_AUTO_11   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 11)
882 #define GFX_DF_MIRROR_AUTO_12   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 12)
883 #define GFX_DF_MIRROR_AUTO_13   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 13)
884 #define GFX_DF_MIRROR_AUTO_14   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 14)
885 #define GFX_DF_MIRROR_AUTO_15   (GFX_START_MIRRORDF +  1 * DF_PER_LINE + 15)
886
887 #define GFX_GRID_STEEL_FIXED_00 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  0)
888 #define GFX_GRID_STEEL_FIXED_01 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  1)
889 #define GFX_GRID_STEEL_FIXED_02 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  2)
890 #define GFX_GRID_STEEL_FIXED_03 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  3)
891 #define GFX_GRID_STEEL_FIXED_04 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  4)
892 #define GFX_GRID_STEEL_FIXED_05 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  5)
893 #define GFX_GRID_STEEL_FIXED_06 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  6)
894 #define GFX_GRID_STEEL_FIXED_07 (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  7)
895 #define GFX_GRID_STEEL_FIXED    GFX_GRID_STEEL_FIXED_00
896
897 #define GFX_GRID_WOOD_FIXED_00  (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  8)
898 #define GFX_GRID_WOOD_FIXED_01  (GFX_START_MIRRORDF +  2 * DF_PER_LINE +  9)
899 #define GFX_GRID_WOOD_FIXED_02  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 10)
900 #define GFX_GRID_WOOD_FIXED_03  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 11)
901 #define GFX_GRID_WOOD_FIXED_04  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 12)
902 #define GFX_GRID_WOOD_FIXED_05  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 13)
903 #define GFX_GRID_WOOD_FIXED_06  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 14)
904 #define GFX_GRID_WOOD_FIXED_07  (GFX_START_MIRRORDF +  2 * DF_PER_LINE + 15)
905 #define GFX_GRID_WOOD_FIXED     GFX_GRID_WOOD_FIXED_00
906
907 #define GFX_GRID_STEEL_AUTO_00  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  0)
908 #define GFX_GRID_STEEL_AUTO_01  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  1)
909 #define GFX_GRID_STEEL_AUTO_02  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  2)
910 #define GFX_GRID_STEEL_AUTO_03  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  3)
911 #define GFX_GRID_STEEL_AUTO_04  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  4)
912 #define GFX_GRID_STEEL_AUTO_05  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  5)
913 #define GFX_GRID_STEEL_AUTO_06  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  6)
914 #define GFX_GRID_STEEL_AUTO_07  (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  7)
915 #define GFX_GRID_STEEL_AUTO     GFX_GRID_STEEL_AUTO_00
916
917 #define GFX_GRID_WOOD_AUTO_00   (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  8)
918 #define GFX_GRID_WOOD_AUTO_01   (GFX_START_MIRRORDF +  3 * DF_PER_LINE +  9)
919 #define GFX_GRID_WOOD_AUTO_02   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 10)
920 #define GFX_GRID_WOOD_AUTO_03   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 11)
921 #define GFX_GRID_WOOD_AUTO_04   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 12)
922 #define GFX_GRID_WOOD_AUTO_05   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 13)
923 #define GFX_GRID_WOOD_AUTO_06   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 14)
924 #define GFX_GRID_WOOD_AUTO_07   (GFX_START_MIRRORDF +  3 * DF_PER_LINE + 15)
925 #define GFX_GRID_WOOD_AUTO      GFX_GRID_WOOD_AUTO_00
926
927 #define GFX_BEAMER_RED_START    (GFX_START_MIRRORDF +  4 * DF_PER_LINE +  0)
928 #define GFX_BEAMER_RED_END      (GFX_START_MIRRORDF +  4 * DF_PER_LINE + 15)
929 #define GFX_BEAMER_YELLOW_START (GFX_START_MIRRORDF +  5 * DF_PER_LINE +  0)
930 #define GFX_BEAMER_YELLOW_END   (GFX_START_MIRRORDF +  5 * DF_PER_LINE + 15)
931 #define GFX_BEAMER_GREEN_START  (GFX_START_MIRRORDF +  6 * DF_PER_LINE +  0)
932 #define GFX_BEAMER_GREEN_END    (GFX_START_MIRRORDF +  6 * DF_PER_LINE + 15)
933 #define GFX_BEAMER_BLUE_START   (GFX_START_MIRRORDF +  7 * DF_PER_LINE +  0)
934 #define GFX_BEAMER_BLUE_END     (GFX_START_MIRRORDF +  7 * DF_PER_LINE + 15)
935
936 #define GFX_DF_WALL_SEVERAL     (GFX_START_MIRRORDF +  8 * DF_PER_LINE +  0)
937 #define GFX_REFRACTOR           (GFX_START_MIRRORDF +  8 * DF_PER_LINE +  1)
938 #define GFX_CELL                (GFX_START_MIRRORDF +  8 * DF_PER_LINE +  2)
939 #define GFX_MINE                (GFX_START_MIRRORDF +  8 * DF_PER_LINE +  4)
940
941 #define GFX_LASER_RIGHT         (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  0)
942 #define GFX_LASER_UP            (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  1)
943 #define GFX_LASER_LEFT          (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  2)
944 #define GFX_LASER_DOWN          (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  3)
945 #define GFX_RECEIVER_RIGHT      (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  4)
946 #define GFX_RECEIVER_UP         (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  5)
947 #define GFX_RECEIVER_LEFT       (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  6)
948 #define GFX_RECEIVER_DOWN       (GFX_START_MIRRORDF +  9 * DF_PER_LINE +  7)
949
950 #define GFX_FIBRE_OPTIC_00      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  0)
951 #define GFX_FIBRE_OPTIC_01      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  1)
952 #define GFX_FIBRE_OPTIC_02      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  2)
953 #define GFX_FIBRE_OPTIC_03      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  3)
954 #define GFX_FIBRE_OPTIC_04      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  4)
955 #define GFX_FIBRE_OPTIC_05      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  5)
956 #define GFX_FIBRE_OPTIC_06      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  6)
957 #define GFX_FIBRE_OPTIC_07      (GFX_START_MIRRORDF + 10 * DF_PER_LINE +  7)
958
959 #define GFX_FIBRE_OPTIC_ED_00   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  0)
960 #define GFX_FIBRE_OPTIC_ED_01   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  1)
961 #define GFX_FIBRE_OPTIC_ED_02   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  2)
962 #define GFX_FIBRE_OPTIC_ED_03   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  3)
963 #define GFX_FIBRE_OPTIC_ED_04   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  4)
964 #define GFX_FIBRE_OPTIC_ED_05   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  5)
965 #define GFX_FIBRE_OPTIC_ED_06   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  6)
966 #define GFX_FIBRE_OPTIC_ED_07   (GFX_START_MIRRORDF + 11 * DF_PER_LINE +  7)
967
968 // the names of the sounds
969 #define SND_AMOEBE              0
970 #define SND_ANTIGRAV            1
971 #define SND_AUTSCH              2
972 #define SND_BONG                3
973 #define SND_FUEL                4
974 #define SND_HALLOFFAME          5
975 #define SND_HOLZ                6
976 #define SND_HUI                 7
977 #define SND_KABUMM              8
978 #define SND_KINK                9
979 #define SND_KLING               10
980 #define SND_LASER               11
981 #define SND_OEFFNEN             12
982 #define SND_QUIEK               13
983 #define SND_RHYTHMLOOP          14
984 #define SND_ROAAAR              15
985 #define SND_SIRR                16
986 #define SND_SLURP               17
987 #define SND_WARNTON             18
988 #define SND_WHOOSH              19
989
990 #define NUM_SOUNDS              20
991
992 // values for graphics/sounds action types
993 #define MM_ACTION_DEFAULT       0
994 #define MM_ACTION_WAITING       1
995 #define MM_ACTION_FALLING       2
996 #define MM_ACTION_MOVING        3
997 #define MM_ACTION_DIGGING       4
998 #define MM_ACTION_SNAPPING      5
999 #define MM_ACTION_COLLECTING    6
1000 #define MM_ACTION_DROPPING      7
1001 #define MM_ACTION_PUSHING       8
1002 #define MM_ACTION_WALKING       9
1003 #define MM_ACTION_PASSING       10
1004 #define MM_ACTION_IMPACT        11
1005 #define MM_ACTION_BREAKING      12
1006 #define MM_ACTION_ACTIVATING    13
1007 #define MM_ACTION_DEACTIVATING  14
1008 #define MM_ACTION_OPENING       15
1009 #define MM_ACTION_CLOSING       16
1010 #define MM_ACTION_ATTACKING     17
1011 #define MM_ACTION_GROWING       18
1012 #define MM_ACTION_SHRINKING     19
1013 #define MM_ACTION_ACTIVE        20
1014 #define MM_ACTION_FILLING       21
1015 #define MM_ACTION_EMPTYING      22
1016 #define MM_ACTION_CHANGING      23
1017 #define MM_ACTION_EXPLODING     24
1018 #define MM_ACTION_BORING        25
1019 #define MM_ACTION_BORING_1      26
1020 #define MM_ACTION_BORING_2      27
1021 #define MM_ACTION_BORING_3      28
1022 #define MM_ACTION_BORING_4      29
1023 #define MM_ACTION_BORING_5      30
1024 #define MM_ACTION_BORING_6      31
1025 #define MM_ACTION_BORING_7      32
1026 #define MM_ACTION_BORING_8      33
1027 #define MM_ACTION_BORING_9      34
1028 #define MM_ACTION_BORING_10     35
1029 #define MM_ACTION_SLEEPING      36
1030 #define MM_ACTION_SLEEPING_1    37
1031 #define MM_ACTION_SLEEPING_2    38
1032 #define MM_ACTION_SLEEPING_3    39
1033 #define MM_ACTION_AWAKENING     40
1034 #define MM_ACTION_DYING         41
1035 #define MM_ACTION_TURNING               42
1036 #define MM_ACTION_TURNING_FROM_LEFT     43
1037 #define MM_ACTION_TURNING_FROM_RIGHT    44
1038 #define MM_ACTION_TURNING_FROM_UP       45
1039 #define MM_ACTION_TURNING_FROM_DOWN     46
1040 #define MM_ACTION_SMASHED_BY_ROCK       47
1041 #define MM_ACTION_SMASHED_BY_SPRING     48
1042 #define MM_ACTION_EATING                49
1043 #define MM_ACTION_TWINKLING             50
1044 #define MM_ACTION_SPLASHING             51
1045 #define MM_ACTION_HITTING               52
1046
1047 // laser angles (directions)
1048 #define ANG_RAY_RIGHT           0
1049 #define ANG_RAY_UP              4
1050 #define ANG_RAY_LEFT            8
1051 #define ANG_RAY_DOWN            12
1052
1053 // laser angles (degree)
1054 #define ANG_RAY_0               0
1055 #define ANG_RAY_90              4
1056 #define ANG_RAY_180             8
1057 #define ANG_RAY_270             12
1058 #define IS_22_5_ANGLE(angle)    ((angle) % 2)
1059 #define IS_90_ANGLE(angle)      (!((angle) % 4))
1060 #define IS_HORIZ_ANGLE(angle)   (!((angle) % 8))
1061 #define IS_VERT_ANGLE(angle)    ((angle) % 8)
1062
1063 // mirror angles
1064 #define ANG_MIRROR_0            0
1065 #define ANG_MIRROR_45           4
1066 #define ANG_MIRROR_90           8
1067 #define ANG_MIRROR_135          12
1068
1069 // positions for checking where laser already hits element
1070 #define HIT_POS_CENTER          1
1071 #define HIT_POS_EDGE            2
1072 #define HIT_POS_BETWEEN         4
1073
1074 // masks for scanning elements
1075 #define HIT_MASK_NO_HIT         0
1076 #define HIT_MASK_TOPLEFT        1
1077 #define HIT_MASK_TOPRIGHT       2
1078 #define HIT_MASK_BOTTOMLEFT     4
1079 #define HIT_MASK_BOTTOMRIGHT    8
1080 #define HIT_MASK_LEFT           (HIT_MASK_TOPLEFT | HIT_MASK_BOTTOMLEFT)
1081 #define HIT_MASK_RIGHT          (HIT_MASK_TOPRIGHT | HIT_MASK_BOTTOMRIGHT)
1082 #define HIT_MASK_TOP            (HIT_MASK_TOPLEFT | HIT_MASK_TOPRIGHT)
1083 #define HIT_MASK_BOTTOM         (HIT_MASK_BOTTOMLEFT | HIT_MASK_BOTTOMRIGHT)
1084 #define HIT_MASK_ALL            (HIT_MASK_LEFT | HIT_MASK_RIGHT)
1085
1086 // step values for rotating elements
1087 #define ROTATE_NO_ROTATING      0
1088 #define ROTATE_LEFT             (+1)
1089 #define ROTATE_RIGHT            (-1)
1090 #define BUTTON_ROTATION(button) ((button) == MB_LEFTBUTTON  ? ROTATE_LEFT :  \
1091                                  (button) == MB_RIGHTBUTTON ? ROTATE_RIGHT : \
1092                                  ROTATE_NO_ROTATING)
1093
1094 // game over values
1095 #define GAME_OVER_NO_ENERGY     1
1096 #define GAME_OVER_OVERLOADED    2
1097 #define GAME_OVER_BOMB          3
1098 #define GAME_OVER_DELAYED       4
1099
1100 // values for color_status
1101 #define STATIC_COLORS           0
1102 #define DYNAMIC_COLORS          1
1103
1104 #define PROGRAM_VERSION_MAJOR   2
1105 #define PROGRAM_VERSION_MINOR   0
1106 #define PROGRAM_VERSION_PATCH   2
1107 #define PROGRAM_VERSION_STRING  "2.0.2"
1108
1109 #define PROGRAM_TITLE_STRING    "Mirror Magic II"
1110 #define PROGRAM_AUTHOR_STRING   "Holger Schemel"
1111 #define PROGRAM_RIGHTS_STRING   "Copyright ^1994-2001"
1112 #define PROGRAM_DOS_PORT_STRING "DOS port based on code by Guido Schulz"
1113 #define PROGRAM_IDENT_STRING    PROGRAM_VERSION_STRING " " TARGET_STRING
1114 #define WINDOW_TITLE_STRING     PROGRAM_TITLE_STRING " " PROGRAM_IDENT_STRING
1115 #define WINDOW_SUBTITLE_STRING  PROGRAM_RIGHTS_STRING " " PROGRAM_AUTHOR_STRING
1116 #define ICON_TITLE_STRING       PROGRAM_TITLE_STRING
1117 #define UNIX_USERDATA_DIRECTORY ".mirrormagic"
1118
1119 #define X11_ICON_FILENAME       "mirrormagic_icon.xbm"
1120 #define X11_ICONMASK_FILENAME   "mirrormagic_iconmask.xbm"
1121 #define MSDOS_POINTER_FILENAME  "mouse.pcx"
1122
1123 // functions for version handling
1124 #define MM_VERSION_IDENT(x,y,z) VERSION_IDENT(x,y,z,0)
1125 #define MM_VERSION_MAJOR(x)     VERSION_PART_1(x)
1126 #define MM_VERSION_MINOR(x)     VERSION_PART_2(x)
1127 #define MM_VERSION_PATCH(x)     VERSION_PART_3(x)
1128
1129 // file version numbers for resource files (levels, score, setup, etc.)
1130 // currently supported/known file version numbers:
1131 //      1.4 (still in use)
1132 //      2.0 (actual)
1133
1134 #define MM_FILE_VERSION_1_4     MM_VERSION_IDENT(1,4,0)
1135 #define MM_FILE_VERSION_2_0     MM_VERSION_IDENT(2,0,0)
1136
1137 // file version does not change for every program version, but is changed
1138 // when new features are introduced that are incompatible with older file
1139 // versions, so that they can be treated accordingly
1140 #define MM_FILE_VERSION_ACTUAL  MM_FILE_VERSION_2_0
1141
1142 #define MM_GAME_VERSION_ACTUAL  MM_VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
1143                                                  PROGRAM_VERSION_MINOR, \
1144                                                  PROGRAM_VERSION_PATCH)
1145
1146 // sound control
1147
1148 #define ST(x)           (((x) - 8) * 16)
1149
1150 #endif  // MM_MAIN_H