added showing commit hash on version page of info screen
[rocksndiamonds.git] / src / main.h
1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // main.h
10 // ============================================================================
11
12 #ifndef MAIN_H
13 #define MAIN_H
14
15 #include <time.h>
16 #include <sys/time.h>
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <errno.h>
20 #include <unistd.h>
21 #include <fcntl.h>
22
23 #include "libgame/libgame.h"
24 #include "game_em/game_em.h"
25 #include "game_sp/game_sp.h"
26 #include "game_mm/game_mm.h"
27 #include "engines.h"
28
29 #include "conf_gfx.h"   // include auto-generated data structure definitions
30 #include "conf_snd.h"   // include auto-generated data structure definitions
31 #include "conf_mus.h"   // include auto-generated data structure definitions
32
33
34 #define IMG_UNDEFINED                   (-1)
35 #define IMG_EMPTY                       IMG_EMPTY_SPACE
36 #define IMG_SP_EMPTY                    IMG_EMPTY_SPACE
37 #define IMG_SP_EMPTY_SPACE              IMG_EMPTY_SPACE
38 #define IMG_EXPLOSION                   IMG_DEFAULT_EXPLODING
39 #define IMG_CHAR_START                  IMG_CHAR_SPACE
40 #define IMG_STEEL_CHAR_START            IMG_STEEL_CHAR_SPACE
41 #define IMG_CUSTOM_START                IMG_CUSTOM_1
42
43 #define SND_UNDEFINED                   (-1)
44 #define MUS_UNDEFINED                   (-1)
45
46 #define WIN_XSIZE_DEFAULT               672
47 #define WIN_YSIZE_DEFAULT               560
48
49 #define SCR_FIELDX_DEFAULT              17
50 #define SCR_FIELDY_DEFAULT              17
51
52 #define SXSIZE_DEFAULT                  (SCR_FIELDX_DEFAULT * TILEX)
53 #define SYSIZE_DEFAULT                  (SCR_FIELDY_DEFAULT * TILEY)
54
55 #define MAX_BUF_XSIZE                   (SCR_FIELDX + 2)
56 #define MAX_BUF_YSIZE                   (SCR_FIELDY + 2)
57 #define MIN_LEV_FIELDX                  3
58 #define MIN_LEV_FIELDY                  3
59 #define STD_LEV_FIELDX                  64
60 #define STD_LEV_FIELDY                  32
61 #define MAX_LEV_FIELDX                  MAX_PLAYFIELD_WIDTH
62 #define MAX_LEV_FIELDY                  MAX_PLAYFIELD_HEIGHT
63
64 #define MIN_SCROLL_DELAY                0
65 #define STD_SCROLL_DELAY                3
66 #define MAX_SCROLL_DELAY                8
67
68 #define SCREENX(a)                      ((a) - scroll_x)
69 #define SCREENY(a)                      ((a) - scroll_y)
70 #define LEVELX(a)                       ((a) + scroll_x)
71 #define LEVELY(a)                       ((a) + scroll_y)
72
73 #define IN_FIELD(x, y, xsize, ysize)    ((x) >= 0 && (x) < (xsize) &&      \
74                                          (y) >= 0 && (y) < (ysize))
75 #define IN_FIELD_MINMAX(x, y, xmin, ymin, xmax, ymax)                      \
76                                         ((x) >= (xmin) && (x) <= (xmax) && \
77                                          (y) >= (ymin) && (y) <= (ymax))
78
79 #define IN_PIX_FIELD(x, y)              IN_FIELD(x, y, SXSIZE, SYSIZE)
80 #define IN_VIS_FIELD(x, y)              IN_FIELD(x, y, SCR_FIELDX, SCR_FIELDY)
81 #define IN_LEV_FIELD(x, y)              IN_FIELD(x, y, lev_fieldx, lev_fieldy)
82 #define IN_SCR_FIELD(x, y)              IN_FIELD_MINMAX(x,y, BX1,BY1, BX2,BY2)
83
84 // values for configurable properties (custom elem's only, else pre-defined)
85 // (never change these values, as they are stored in level files!)
86 #define EP_DIGGABLE                     0
87 #define EP_COLLECTIBLE_ONLY             1
88 #define EP_DONT_RUN_INTO                2
89 #define EP_DONT_COLLIDE_WITH            3
90 #define EP_DONT_TOUCH                   4
91 #define EP_INDESTRUCTIBLE               5
92 #define EP_SLIPPERY                     6
93 #define EP_CAN_CHANGE                   7
94 #define EP_CAN_MOVE                     8
95 #define EP_CAN_FALL                     9
96 #define EP_CAN_SMASH_PLAYER             10
97 #define EP_CAN_SMASH_ENEMIES            11
98 #define EP_CAN_SMASH_EVERYTHING         12
99 #define EP_EXPLODES_BY_FIRE             13
100 #define EP_EXPLODES_SMASHED             14
101 #define EP_EXPLODES_IMPACT              15
102 #define EP_WALKABLE_OVER                16
103 #define EP_WALKABLE_INSIDE              17
104 #define EP_WALKABLE_UNDER               18
105 #define EP_PASSABLE_OVER                19
106 #define EP_PASSABLE_INSIDE              20
107 #define EP_PASSABLE_UNDER               21
108 #define EP_DROPPABLE                    22
109 #define EP_EXPLODES_1X1_OLD             23
110 #define EP_PUSHABLE                     24
111 #define EP_EXPLODES_CROSS_OLD           25
112 #define EP_PROTECTED                    26
113 #define EP_CAN_MOVE_INTO_ACID           27
114 #define EP_THROWABLE                    28
115 #define EP_CAN_EXPLODE                  29
116 #define EP_GRAVITY_REACHABLE            30
117 #define EP_DONT_GET_HIT_BY              31
118
119 // values for pre-defined properties
120 // (from here on, values can be changed by inserting new values)
121 #define EP_PLAYER                       32
122 #define EP_CAN_PASS_MAGIC_WALL          33
123 #define EP_CAN_PASS_DC_MAGIC_WALL       34
124 #define EP_SWITCHABLE                   35
125 #define EP_BD_ELEMENT                   36
126 #define EP_SP_ELEMENT                   37
127 #define EP_SB_ELEMENT                   38
128 #define EP_GEM                          39
129 #define EP_FOOD_DARK_YAMYAM             40
130 #define EP_FOOD_PENGUIN                 41
131 #define EP_FOOD_PIG                     42
132 #define EP_HISTORIC_WALL                43
133 #define EP_HISTORIC_SOLID               44
134 #define EP_CLASSIC_ENEMY                45
135 #define EP_BELT                         46
136 #define EP_BELT_ACTIVE                  47
137 #define EP_BELT_SWITCH                  48
138 #define EP_TUBE                         49
139 #define EP_ACID_POOL                    50
140 #define EP_KEYGATE                      51
141 #define EP_AMOEBOID                     52
142 #define EP_AMOEBALIVE                   53
143 #define EP_HAS_EDITOR_CONTENT           54
144 #define EP_CAN_TURN_EACH_MOVE           55
145 #define EP_CAN_GROW                     56
146 #define EP_ACTIVE_BOMB                  57
147 #define EP_INACTIVE                     58
148
149 // values for special configurable properties (depending on level settings)
150 #define EP_EM_SLIPPERY_WALL             59
151
152 // values for special graphics properties (no effect on game engine)
153 #define EP_GFX_CRUMBLED                 60
154
155 // values for derived properties (determined from properties above)
156 #define EP_ACCESSIBLE_OVER              61
157 #define EP_ACCESSIBLE_INSIDE            62
158 #define EP_ACCESSIBLE_UNDER             63
159 #define EP_WALKABLE                     64
160 #define EP_PASSABLE                     65
161 #define EP_ACCESSIBLE                   66
162 #define EP_COLLECTIBLE                  67
163 #define EP_SNAPPABLE                    68
164 #define EP_WALL                         69
165 #define EP_SOLID_FOR_PUSHING            70
166 #define EP_DRAGONFIRE_PROOF             71
167 #define EP_EXPLOSION_PROOF              72
168 #define EP_CAN_SMASH                    73
169 #define EP_EXPLODES_3X3_OLD             74
170 #define EP_CAN_EXPLODE_BY_FIRE          75
171 #define EP_CAN_EXPLODE_SMASHED          76
172 #define EP_CAN_EXPLODE_IMPACT           77
173 #define EP_SP_PORT                      78
174 #define EP_CAN_EXPLODE_BY_DRAGONFIRE    79
175 #define EP_CAN_EXPLODE_BY_EXPLOSION     80
176 #define EP_COULD_MOVE_INTO_ACID         81
177 #define EP_MAYBE_DONT_COLLIDE_WITH      82
178 #define EP_CAN_BE_CLONED_BY_ANDROID     83
179
180 // values for internal purpose only (level editor)
181 #define EP_WALK_TO_OBJECT               84
182 #define EP_DEADLY                       85
183 #define EP_EDITOR_CASCADE               86
184 #define EP_EDITOR_CASCADE_ACTIVE        87
185 #define EP_EDITOR_CASCADE_INACTIVE      88
186
187 // values for internal purpose only (game engine)
188 #define EP_HAS_ACTION                   89
189 #define EP_CAN_CHANGE_OR_HAS_ACTION     90
190
191 // values for internal purpose only (other)
192 #define EP_OBSOLETE                     91
193
194 #define NUM_ELEMENT_PROPERTIES          92
195
196 #define NUM_EP_BITFIELDS                ((NUM_ELEMENT_PROPERTIES + 31) / 32)
197 #define EP_BITFIELD_BASE_NR             0
198
199 #define EP_BITMASK_BASE_DEFAULT         (1 << EP_CAN_MOVE_INTO_ACID)
200 #define EP_BITMASK_DEFAULT              0
201
202 #define PROPERTY_BIT(p)                 (1 << ((p) % 32))
203 #define PROPERTY_VAR(e,p)               (element_info[e].properties[(p) / 32])
204 #define HAS_PROPERTY(e,p)       ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0)
205 #define SET_PROPERTY(e,p,v)     ((v) ?                                     \
206                                  (PROPERTY_VAR(e,p) |=  PROPERTY_BIT(p)) : \
207                                  (PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p)))
208
209
210 // values for change events for custom elements (stored in level file)
211 #define CE_DELAY                        0
212 #define CE_TOUCHED_BY_PLAYER            1
213 #define CE_PRESSED_BY_PLAYER            2
214 #define CE_PUSHED_BY_PLAYER             3
215 #define CE_DROPPED_BY_PLAYER            4
216 #define CE_HITTING_SOMETHING            5
217 #define CE_IMPACT                       6
218 #define CE_SMASHED                      7
219 #define CE_TOUCHING_X                   8
220 #define CE_CHANGE_OF_X                  9
221 #define CE_EXPLOSION_OF_X               10
222 #define CE_PLAYER_TOUCHES_X             11
223 #define CE_PLAYER_PRESSES_X             12
224 #define CE_PLAYER_PUSHES_X              13
225 #define CE_PLAYER_COLLECTS_X            14
226 #define CE_PLAYER_DROPS_X               15
227 #define CE_VALUE_GETS_ZERO              16
228 #define CE_VALUE_GETS_ZERO_OF_X         17
229 #define CE_BY_OTHER_ACTION              18
230 #define CE_BY_DIRECT_ACTION             19
231 #define CE_PLAYER_DIGS_X                20
232 #define CE_ENTERED_BY_PLAYER            21
233 #define CE_LEFT_BY_PLAYER               22
234 #define CE_PLAYER_ENTERS_X              23
235 #define CE_PLAYER_LEAVES_X              24
236 #define CE_SWITCHED                     25
237 #define CE_SWITCH_OF_X                  26
238 #define CE_HIT_BY_SOMETHING             27
239 #define CE_HITTING_X                    28
240 #define CE_HIT_BY_X                     29
241 #define CE_BLOCKED                      30
242 #define CE_SWITCHED_BY_PLAYER           31
243 #define CE_PLAYER_SWITCHES_X            32
244 #define CE_SNAPPED_BY_PLAYER            33
245 #define CE_PLAYER_SNAPS_X               34
246 #define CE_MOVE_OF_X                    35
247 #define CE_DIGGING_X                    36
248 #define CE_CREATION_OF_X                37
249 #define CE_SCORE_GETS_ZERO              38
250 #define CE_SCORE_GETS_ZERO_OF_X         39
251 #define CE_VALUE_CHANGES                40
252 #define CE_VALUE_CHANGES_OF_X           41
253 #define CE_SCORE_CHANGES                42
254 #define CE_SCORE_CHANGES_OF_X           43
255 #define CE_CLICKED_BY_MOUSE             44
256 #define CE_PRESSED_BY_MOUSE             45
257 #define CE_MOUSE_CLICKED_ON_X           46
258 #define CE_MOUSE_PRESSED_ON_X           47
259
260 #define NUM_CHANGE_EVENTS               48
261
262 #define NUM_CE_BITFIELDS                ((NUM_CHANGE_EVENTS + 31) / 32)
263
264 #define CE_HEADLINE_SPECIAL_EVENTS      250
265 #define CE_UNDEFINED                    255
266
267 #define CE_BITMASK_DEFAULT              0
268
269 #define CH_EVENT_BITFIELD_NR(e)         (e / 32)
270 #define CH_EVENT_BIT(e)                 (1 << ((e) % 32))
271
272 #define CH_EVENT_VAR(e,c)               (element_info[e].change->has_event[c])
273 #define CH_ANY_EVENT_VAR(e,c)           (element_info[e].has_change_event[c])
274
275 #define PAGE_HAS_CHANGE_EVENT(p,c)      ((p)->has_event[c])
276 #define HAS_CHANGE_EVENT(e,c)           (IS_CUSTOM_ELEMENT(e) &&        \
277                                          CH_EVENT_VAR(e,c))
278 #define HAS_ANY_CHANGE_EVENT(e,c)       (IS_CUSTOM_ELEMENT(e) &&        \
279                                          CH_ANY_EVENT_VAR(e,c))
280
281 #define SET_CHANGE_EVENT(e,c,v)         (IS_CUSTOM_ELEMENT(e) ?         \
282                                          CH_EVENT_VAR(e,c) = (v) : 0)
283 #define SET_ANY_CHANGE_EVENT(e,c,v)     (IS_CUSTOM_ELEMENT(e) ?         \
284                                          CH_ANY_EVENT_VAR(e,c) = (v) : 0)
285
286 // values for player bitmasks
287 #define PLAYER_BITS_NONE                0
288 #define PLAYER_BITS_1                   (1 << 0)
289 #define PLAYER_BITS_2                   (1 << 1)
290 #define PLAYER_BITS_3                   (1 << 2)
291 #define PLAYER_BITS_4                   (1 << 3)
292 #define PLAYER_BITS_ANY                 (PLAYER_BITS_1 | \
293                                          PLAYER_BITS_2 | \
294                                          PLAYER_BITS_3 | \
295                                          PLAYER_BITS_4)
296 #define PLAYER_BITS_TRIGGER             (1 << 4)
297 #define PLAYER_BITS_ACTION              (1 << 5)
298
299 // values for move directions (bits 0 - 3: basic move directions)
300 #define MV_BIT_PREVIOUS                 4
301 #define MV_BIT_TRIGGER                  5
302 #define MV_BIT_TRIGGER_BACK             6
303 #define MV_BIT_NORMAL                   MV_BIT_TRIGGER
304 #define MV_BIT_REVERSE                  MV_BIT_TRIGGER_BACK
305
306 #define MV_PREVIOUS                     (1 << MV_BIT_PREVIOUS)
307 #define MV_TRIGGER                      (1 << MV_BIT_TRIGGER)
308 #define MV_TRIGGER_BACK                 (1 << MV_BIT_TRIGGER_BACK)
309 #define MV_NORMAL                       (1 << MV_BIT_NORMAL)
310 #define MV_REVERSE                      (1 << MV_BIT_REVERSE)
311
312 // values for move stepsize
313 #define STEPSIZE_NOT_MOVING             0
314 #define STEPSIZE_VERY_SLOW              1
315 #define STEPSIZE_SLOW                   2
316 #define STEPSIZE_NORMAL                 4
317 #define STEPSIZE_FAST                   8
318 #define STEPSIZE_VERY_FAST              16
319 #define STEPSIZE_EVEN_FASTER            32
320 #define STEPSIZE_SLOWER                 50      // (symbolic value only)
321 #define STEPSIZE_FASTER                 200     // (symbolic value only)
322 #define STEPSIZE_RESET                  100     // (symbolic value only)
323
324 // values for change side for custom elements
325 #define CH_SIDE_NONE                    MV_NONE
326 #define CH_SIDE_LEFT                    MV_LEFT
327 #define CH_SIDE_RIGHT                   MV_RIGHT
328 #define CH_SIDE_TOP                     MV_UP
329 #define CH_SIDE_BOTTOM                  MV_DOWN
330 #define CH_SIDE_LEFT_RIGHT              MV_HORIZONTAL
331 #define CH_SIDE_TOP_BOTTOM              MV_VERTICAL
332 #define CH_SIDE_ANY                     MV_ANY_DIRECTION
333
334 // values for change player for custom elements
335 #define CH_PLAYER_NONE                  PLAYER_BITS_NONE
336 #define CH_PLAYER_1                     PLAYER_BITS_1
337 #define CH_PLAYER_2                     PLAYER_BITS_2
338 #define CH_PLAYER_3                     PLAYER_BITS_3
339 #define CH_PLAYER_4                     PLAYER_BITS_4
340 #define CH_PLAYER_ANY                   PLAYER_BITS_ANY
341
342 // values for change page for custom elements
343 #define CH_PAGE_ANY_FILE                (0xff)
344 #define CH_PAGE_ANY                     (0xffffffff)
345
346 // values for change power for custom elements
347 #define CP_WHEN_EMPTY                   0
348 #define CP_WHEN_DIGGABLE                1
349 #define CP_WHEN_DESTRUCTIBLE            2
350 #define CP_WHEN_COLLECTIBLE             3
351 #define CP_WHEN_REMOVABLE               4
352 #define CP_WHEN_WALKABLE                5
353
354 // values for change actions for custom elements (stored in level file)
355 #define CA_NO_ACTION                    0
356 #define CA_EXIT_PLAYER                  1
357 #define CA_KILL_PLAYER                  2
358 #define CA_MOVE_PLAYER                  3
359 #define CA_RESTART_LEVEL                4
360 #define CA_SHOW_ENVELOPE                5
361 #define CA_SET_LEVEL_TIME               6
362 #define CA_SET_LEVEL_GEMS               7
363 #define CA_SET_LEVEL_SCORE              8
364 #define CA_SET_LEVEL_WIND               9
365 #define CA_SET_PLAYER_GRAVITY           10
366 #define CA_SET_PLAYER_KEYS              11
367 #define CA_SET_PLAYER_SPEED             12
368 #define CA_SET_PLAYER_SHIELD            13
369 #define CA_SET_PLAYER_ARTWORK           14
370 #define CA_SET_CE_SCORE                 15
371 #define CA_SET_CE_VALUE                 16
372 #define CA_SET_ENGINE_SCAN_MODE         17
373 #define CA_SET_PLAYER_INVENTORY         18
374 #define CA_SET_CE_ARTWORK               19
375 #define CA_SET_LEVEL_RANDOM_SEED        20
376 #define CA_MOVE_PLAYER_NEW              21
377
378 #define CA_HEADLINE_LEVEL_ACTIONS       250
379 #define CA_HEADLINE_PLAYER_ACTIONS      251
380 #define CA_HEADLINE_CE_ACTIONS          252
381 #define CA_HEADLINE_ENGINE_ACTIONS      253
382 #define CA_UNDEFINED                    255
383
384 // values for change action mode for custom elements
385 #define CA_MODE_UNDEFINED               0
386 #define CA_MODE_SET                     1
387 #define CA_MODE_ADD                     2
388 #define CA_MODE_SUBTRACT                3
389 #define CA_MODE_MULTIPLY                4
390 #define CA_MODE_DIVIDE                  5
391 #define CA_MODE_MODULO                  6
392
393 // values for change action parameters for custom elements
394 #define CA_ARG_MIN                      0
395 #define CA_ARG_0                        0
396 #define CA_ARG_1                        1
397 #define CA_ARG_2                        2
398 #define CA_ARG_3                        3
399 #define CA_ARG_4                        4
400 #define CA_ARG_5                        5
401 #define CA_ARG_6                        6
402 #define CA_ARG_7                        7
403 #define CA_ARG_8                        8
404 #define CA_ARG_9                        9
405 #define CA_ARG_10                       10
406 #define CA_ARG_100                      100
407 #define CA_ARG_1000                     1000
408 #define CA_ARG_MAX                      9999
409 #define CA_ARG_PLAYER                   10000
410 #define CA_ARG_PLAYER_1                 (CA_ARG_PLAYER + PLAYER_BITS_1)
411 #define CA_ARG_PLAYER_2                 (CA_ARG_PLAYER + PLAYER_BITS_2)
412 #define CA_ARG_PLAYER_3                 (CA_ARG_PLAYER + PLAYER_BITS_3)
413 #define CA_ARG_PLAYER_4                 (CA_ARG_PLAYER + PLAYER_BITS_4)
414 #define CA_ARG_PLAYER_ANY               (CA_ARG_PLAYER + PLAYER_BITS_ANY)
415 #define CA_ARG_PLAYER_TRIGGER           (CA_ARG_PLAYER + PLAYER_BITS_TRIGGER)
416 #define CA_ARG_PLAYER_ACTION            (CA_ARG_PLAYER + PLAYER_BITS_ACTION)
417 #define CA_ARG_PLAYER_HEADLINE          (CA_ARG_PLAYER + 999)
418 #define CA_ARG_NUMBER                   11000
419 #define CA_ARG_NUMBER_MIN               (CA_ARG_NUMBER + 0)
420 #define CA_ARG_NUMBER_MAX               (CA_ARG_NUMBER + 1)
421 #define CA_ARG_NUMBER_RESET             (CA_ARG_NUMBER + 2)
422 #define CA_ARG_NUMBER_CE_SCORE          (CA_ARG_NUMBER + 3)
423 #define CA_ARG_NUMBER_CE_VALUE          (CA_ARG_NUMBER + 4)
424 #define CA_ARG_NUMBER_CE_DELAY          (CA_ARG_NUMBER + 5)
425 #define CA_ARG_NUMBER_LEVEL_TIME        (CA_ARG_NUMBER + 6)
426 #define CA_ARG_NUMBER_LEVEL_GEMS        (CA_ARG_NUMBER + 7)
427 #define CA_ARG_NUMBER_LEVEL_SCORE       (CA_ARG_NUMBER + 8)
428 #define CA_ARG_NUMBER_HEADLINE          (CA_ARG_NUMBER + 999)
429 #define CA_ARG_ELEMENT                  12000
430 #define CA_ARG_ELEMENT_RESET            (CA_ARG_ELEMENT + 0)
431 #define CA_ARG_ELEMENT_TARGET           (CA_ARG_ELEMENT + 1)
432 #define CA_ARG_ELEMENT_TRIGGER          (CA_ARG_ELEMENT + 2)
433 #define CA_ARG_ELEMENT_ACTION           (CA_ARG_ELEMENT + 7)
434 #define CA_ARG_ELEMENT_HEADLINE         (CA_ARG_ELEMENT + 997)
435 #define CA_ARG_ELEMENT_CV_TARGET        (CA_ARG_ELEMENT_TARGET)
436 #define CA_ARG_ELEMENT_CV_TRIGGER       (CA_ARG_ELEMENT_TRIGGER)
437 #define CA_ARG_ELEMENT_CV_ACTION        (CA_ARG_ELEMENT_ACTION)
438 #define CA_ARG_ELEMENT_CV_HEADLINE      (CA_ARG_ELEMENT_HEADLINE)
439 #define CA_ARG_ELEMENT_NR_TARGET        (CA_ARG_ELEMENT + 3)
440 #define CA_ARG_ELEMENT_NR_TRIGGER       (CA_ARG_ELEMENT + 4)
441 #define CA_ARG_ELEMENT_NR_ACTION        (CA_ARG_ELEMENT + 8)
442 #define CA_ARG_ELEMENT_NR_HEADLINE      (CA_ARG_ELEMENT + 998)
443 #define CA_ARG_ELEMENT_CS_TARGET        (CA_ARG_ELEMENT + 5)
444 #define CA_ARG_ELEMENT_CS_TRIGGER       (CA_ARG_ELEMENT + 6)
445 #define CA_ARG_ELEMENT_CS_ACTION        (CA_ARG_ELEMENT + 9)
446 #define CA_ARG_ELEMENT_CS_HEADLINE      (CA_ARG_ELEMENT + 999)
447 #define CA_ARG_SPEED                    13000
448 #define CA_ARG_SPEED_NOT_MOVING         (CA_ARG_SPEED + STEPSIZE_NOT_MOVING)
449 #define CA_ARG_SPEED_VERY_SLOW          (CA_ARG_SPEED + STEPSIZE_VERY_SLOW)
450 #define CA_ARG_SPEED_SLOW               (CA_ARG_SPEED + STEPSIZE_SLOW)
451 #define CA_ARG_SPEED_NORMAL             (CA_ARG_SPEED + STEPSIZE_NORMAL)
452 #define CA_ARG_SPEED_FAST               (CA_ARG_SPEED + STEPSIZE_FAST)
453 #define CA_ARG_SPEED_VERY_FAST          (CA_ARG_SPEED + STEPSIZE_VERY_FAST)
454 #define CA_ARG_SPEED_EVEN_FASTER        (CA_ARG_SPEED + STEPSIZE_EVEN_FASTER)
455 #define CA_ARG_SPEED_SLOWER             (CA_ARG_SPEED + STEPSIZE_SLOWER)
456 #define CA_ARG_SPEED_FASTER             (CA_ARG_SPEED + STEPSIZE_FASTER)
457 #define CA_ARG_SPEED_RESET              (CA_ARG_SPEED + STEPSIZE_RESET)
458 #define CA_ARG_SPEED_HEADLINE           (CA_ARG_SPEED + 999)
459 #define CA_ARG_GRAVITY                  14000
460 #define CA_ARG_GRAVITY_OFF              (CA_ARG_GRAVITY + 0)
461 #define CA_ARG_GRAVITY_ON               (CA_ARG_GRAVITY + 1)
462 #define CA_ARG_GRAVITY_TOGGLE           (CA_ARG_GRAVITY + 2)
463 #define CA_ARG_GRAVITY_HEADLINE         (CA_ARG_GRAVITY + 999)
464 #define CA_ARG_DIRECTION                15000
465 #define CA_ARG_DIRECTION_NONE           (CA_ARG_DIRECTION + MV_NONE)
466 #define CA_ARG_DIRECTION_LEFT           (CA_ARG_DIRECTION + MV_LEFT)
467 #define CA_ARG_DIRECTION_RIGHT          (CA_ARG_DIRECTION + MV_RIGHT)
468 #define CA_ARG_DIRECTION_UP             (CA_ARG_DIRECTION + MV_UP)
469 #define CA_ARG_DIRECTION_DOWN           (CA_ARG_DIRECTION + MV_DOWN)
470 #define CA_ARG_DIRECTION_TRIGGER        (CA_ARG_DIRECTION + MV_TRIGGER)
471 #define CA_ARG_DIRECTION_TRIGGER_BACK   (CA_ARG_DIRECTION + MV_TRIGGER_BACK)
472 #define CA_ARG_DIRECTION_HEADLINE       (CA_ARG_DIRECTION + 999)
473 #define CA_ARG_SHIELD                   16000
474 #define CA_ARG_SHIELD_OFF               (CA_ARG_SHIELD + 0)
475 #define CA_ARG_SHIELD_NORMAL            (CA_ARG_SHIELD + 1)
476 #define CA_ARG_SHIELD_DEADLY            (CA_ARG_SHIELD + 2)
477 #define CA_ARG_SHIELD_HEADLINE          (CA_ARG_SHIELD + 999)
478 #define CA_ARG_SCAN_MODE                17000
479 #define CA_ARG_SCAN_MODE_NORMAL         (CA_ARG_SCAN_MODE + MV_NORMAL)
480 #define CA_ARG_SCAN_MODE_REVERSE        (CA_ARG_SCAN_MODE + MV_REVERSE)
481 #define CA_ARG_SCAN_MODE_HEADLINE       (CA_ARG_SCAN_MODE + 999)
482 #define CA_ARG_INVENTORY                18000
483 #define CA_ARG_INVENTORY_RESET          (CA_ARG_INVENTORY + 0)
484 #define CA_ARG_INVENTORY_RM_TARGET      (CA_ARG_INVENTORY + 1)
485 #define CA_ARG_INVENTORY_RM_TRIGGER     (CA_ARG_INVENTORY + 2)
486 #define CA_ARG_INVENTORY_RM_ACTION      (CA_ARG_INVENTORY + 3)
487 #define CA_ARG_INVENTORY_RM_FIRST       (CA_ARG_INVENTORY + 4)
488 #define CA_ARG_INVENTORY_RM_LAST        (CA_ARG_INVENTORY + 5)
489 #define CA_ARG_INVENTORY_RM_ALL         (CA_ARG_INVENTORY + 6)
490 #define CA_ARG_INVENTORY_HEADLINE       (CA_ARG_INVENTORY + 998)
491 #define CA_ARG_INVENTORY_RM_HEADLINE    (CA_ARG_INVENTORY + 999)
492 #define CA_ARG_UNDEFINED                65535
493
494 // values for custom move patterns (bits 0 - 3: basic move directions)
495 #define MV_BIT_TOWARDS_PLAYER           4
496 #define MV_BIT_AWAY_FROM_PLAYER         5
497 #define MV_BIT_ALONG_LEFT_SIDE          6
498 #define MV_BIT_ALONG_RIGHT_SIDE         7
499 #define MV_BIT_TURNING_LEFT             8
500 #define MV_BIT_TURNING_RIGHT            9
501 #define MV_BIT_WHEN_PUSHED              10
502 #define MV_BIT_MAZE_RUNNER              11
503 #define MV_BIT_MAZE_HUNTER              12
504 #define MV_BIT_WHEN_DROPPED             13
505 #define MV_BIT_TURNING_LEFT_RIGHT       14
506 #define MV_BIT_TURNING_RIGHT_LEFT       15
507 #define MV_BIT_TURNING_RANDOM           16
508 #define MV_BIT_WIND_DIRECTION           17
509
510 // values for custom move patterns
511 #define MV_TOWARDS_PLAYER               (1 << MV_BIT_TOWARDS_PLAYER)
512 #define MV_AWAY_FROM_PLAYER             (1 << MV_BIT_AWAY_FROM_PLAYER)
513 #define MV_ALONG_LEFT_SIDE              (1 << MV_BIT_ALONG_LEFT_SIDE)
514 #define MV_ALONG_RIGHT_SIDE             (1 << MV_BIT_ALONG_RIGHT_SIDE)
515 #define MV_TURNING_LEFT                 (1 << MV_BIT_TURNING_LEFT)
516 #define MV_TURNING_RIGHT                (1 << MV_BIT_TURNING_RIGHT)
517 #define MV_WHEN_PUSHED                  (1 << MV_BIT_WHEN_PUSHED)
518 #define MV_MAZE_RUNNER                  (1 << MV_BIT_MAZE_RUNNER)
519 #define MV_MAZE_HUNTER                  (1 << MV_BIT_MAZE_HUNTER)
520 #define MV_MAZE_RUNNER_STYLE            (MV_MAZE_RUNNER | MV_MAZE_HUNTER)
521 #define MV_WHEN_DROPPED                 (1 << MV_BIT_WHEN_DROPPED)
522 #define MV_TURNING_LEFT_RIGHT           (1 << MV_BIT_TURNING_LEFT_RIGHT)
523 #define MV_TURNING_RIGHT_LEFT           (1 << MV_BIT_TURNING_RIGHT_LEFT)
524 #define MV_TURNING_RANDOM               (1 << MV_BIT_TURNING_RANDOM)
525 #define MV_WIND_DIRECTION               (1 << MV_BIT_WIND_DIRECTION)
526
527 // values for initial move direction
528 #define MV_START_NONE                   (MV_NONE)
529 #define MV_START_AUTOMATIC              (MV_NONE)
530 #define MV_START_LEFT                   (MV_LEFT)
531 #define MV_START_RIGHT                  (MV_RIGHT)
532 #define MV_START_UP                     (MV_UP)
533 #define MV_START_DOWN                   (MV_DOWN)
534 #define MV_START_RANDOM                 (MV_ALL_DIRECTIONS)
535 #define MV_START_PREVIOUS               (MV_PREVIOUS)
536
537 // values for elements left behind by custom elements
538 #define LEAVE_TYPE_UNLIMITED            0
539 #define LEAVE_TYPE_LIMITED              1
540
541 // values for slippery property for custom elements
542 #define SLIPPERY_ANY_RANDOM             0
543 #define SLIPPERY_ANY_LEFT_RIGHT         1
544 #define SLIPPERY_ANY_RIGHT_LEFT         2
545 #define SLIPPERY_ONLY_LEFT              3
546 #define SLIPPERY_ONLY_RIGHT             4
547
548 // values for explosion type for custom elements
549 #define EXPLODES_3X3                    0
550 #define EXPLODES_1X1                    1
551 #define EXPLODES_CROSS                  2
552
553 // macros for configurable properties
554 #define IS_DIGGABLE(e)          HAS_PROPERTY(e, EP_DIGGABLE)
555 #define IS_COLLECTIBLE_ONLY(e)  HAS_PROPERTY(e, EP_COLLECTIBLE_ONLY)
556 #define DONT_RUN_INTO(e)        HAS_PROPERTY(e, EP_DONT_RUN_INTO)
557 #define DONT_COLLIDE_WITH(e)    HAS_PROPERTY(e, EP_DONT_COLLIDE_WITH)
558 #define DONT_TOUCH(e)           HAS_PROPERTY(e, EP_DONT_TOUCH)
559 #define IS_INDESTRUCTIBLE(e)    HAS_PROPERTY(e, EP_INDESTRUCTIBLE)
560 #define IS_SLIPPERY(e)          HAS_PROPERTY(e, EP_SLIPPERY)
561 #define CAN_CHANGE(e)           HAS_PROPERTY(e, EP_CAN_CHANGE)
562 #define CAN_MOVE(e)             HAS_PROPERTY(e, EP_CAN_MOVE)
563 #define CAN_FALL(e)             HAS_PROPERTY(e, EP_CAN_FALL)
564 #define CAN_SMASH_PLAYER(e)     HAS_PROPERTY(e, EP_CAN_SMASH_PLAYER)
565 #define CAN_SMASH_ENEMIES(e)    HAS_PROPERTY(e, EP_CAN_SMASH_ENEMIES)
566 #define CAN_SMASH_EVERYTHING(e) HAS_PROPERTY(e, EP_CAN_SMASH_EVERYTHING)
567 #define EXPLODES_BY_FIRE(e)     HAS_PROPERTY(e, EP_EXPLODES_BY_FIRE)
568 #define EXPLODES_SMASHED(e)     HAS_PROPERTY(e, EP_EXPLODES_SMASHED)
569 #define EXPLODES_IMPACT(e)      HAS_PROPERTY(e, EP_EXPLODES_IMPACT)
570 #define IS_WALKABLE_OVER(e)     HAS_PROPERTY(e, EP_WALKABLE_OVER)
571 #define IS_WALKABLE_INSIDE(e)   HAS_PROPERTY(e, EP_WALKABLE_INSIDE)
572 #define IS_WALKABLE_UNDER(e)    HAS_PROPERTY(e, EP_WALKABLE_UNDER)
573 #define IS_PASSABLE_OVER(e)     HAS_PROPERTY(e, EP_PASSABLE_OVER)
574 #define IS_PASSABLE_INSIDE(e)   HAS_PROPERTY(e, EP_PASSABLE_INSIDE)
575 #define IS_PASSABLE_UNDER(e)    HAS_PROPERTY(e, EP_PASSABLE_UNDER)
576 #define IS_DROPPABLE(e)         HAS_PROPERTY(e, EP_DROPPABLE)
577 #define EXPLODES_1X1_OLD(e)     HAS_PROPERTY(e, EP_EXPLODES_1X1_OLD)
578 #define IS_PUSHABLE(e)          HAS_PROPERTY(e, EP_PUSHABLE)
579 #define EXPLODES_CROSS_OLD(e)   HAS_PROPERTY(e, EP_EXPLODES_CROSS_OLD)
580 #define IS_PROTECTED(e)         HAS_PROPERTY(e, EP_PROTECTED)
581 #define CAN_MOVE_INTO_ACID(e)   HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID)
582 #define IS_THROWABLE(e)         HAS_PROPERTY(e, EP_THROWABLE)
583 #define CAN_EXPLODE(e)          HAS_PROPERTY(e, EP_CAN_EXPLODE)
584 #define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE)
585 #define DONT_GET_HIT_BY(e)      HAS_PROPERTY(e, EP_DONT_GET_HIT_BY)
586
587 // macros for special configurable properties
588 #define IS_EM_SLIPPERY_WALL(e)  HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL)
589
590 // macros for special graphics properties
591 #define GFX_CRUMBLED(e)         HAS_PROPERTY(GFX_ELEMENT(e), EP_GFX_CRUMBLED)
592
593 // macros for pre-defined properties
594 #define ELEM_IS_PLAYER(e)       HAS_PROPERTY(e, EP_PLAYER)
595 #define CAN_PASS_MAGIC_WALL(e)  HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL)
596 #define CAN_PASS_DC_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_DC_MAGIC_WALL)
597 #define IS_SWITCHABLE(e)        HAS_PROPERTY(e, EP_SWITCHABLE)
598 #define IS_BD_ELEMENT(e)        HAS_PROPERTY(e, EP_BD_ELEMENT)
599 #define IS_SP_ELEMENT(e)        HAS_PROPERTY(e, EP_SP_ELEMENT)
600 #define IS_SB_ELEMENT(e)        HAS_PROPERTY(e, EP_SB_ELEMENT)
601 #define IS_GEM(e)               HAS_PROPERTY(e, EP_GEM)
602 #define IS_FOOD_DARK_YAMYAM(e)  HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM)
603 #define IS_FOOD_PENGUIN(e)      HAS_PROPERTY(e, EP_FOOD_PENGUIN)
604 #define IS_FOOD_PIG(e)          HAS_PROPERTY(e, EP_FOOD_PIG)
605 #define IS_HISTORIC_WALL(e)     HAS_PROPERTY(e, EP_HISTORIC_WALL)
606 #define IS_HISTORIC_SOLID(e)    HAS_PROPERTY(e, EP_HISTORIC_SOLID)
607 #define IS_CLASSIC_ENEMY(e)     HAS_PROPERTY(e, EP_CLASSIC_ENEMY)
608 #define IS_BELT(e)              HAS_PROPERTY(e, EP_BELT)
609 #define IS_BELT_ACTIVE(e)       HAS_PROPERTY(e, EP_BELT_ACTIVE)
610 #define IS_BELT_SWITCH(e)       HAS_PROPERTY(e, EP_BELT_SWITCH)
611 #define IS_TUBE(e)              HAS_PROPERTY(e, EP_TUBE)
612 #define IS_ACID_POOL(e)         HAS_PROPERTY(e, EP_ACID_POOL)
613 #define IS_KEYGATE(e)           HAS_PROPERTY(e, EP_KEYGATE)
614 #define IS_AMOEBOID(e)          HAS_PROPERTY(e, EP_AMOEBOID)
615 #define IS_AMOEBALIVE(e)        HAS_PROPERTY(e, EP_AMOEBALIVE)
616 #define HAS_EDITOR_CONTENT(e)   HAS_PROPERTY(e, EP_HAS_EDITOR_CONTENT)
617 #define CAN_TURN_EACH_MOVE(e)   HAS_PROPERTY(e, EP_CAN_TURN_EACH_MOVE)
618 #define CAN_GROW(e)             HAS_PROPERTY(e, EP_CAN_GROW)
619 #define IS_ACTIVE_BOMB(e)       HAS_PROPERTY(e, EP_ACTIVE_BOMB)
620 #define IS_INACTIVE(e)          HAS_PROPERTY(e, EP_INACTIVE)
621
622 // macros for derived properties
623 #define IS_ACCESSIBLE_OVER(e)   HAS_PROPERTY(e, EP_ACCESSIBLE_OVER)
624 #define IS_ACCESSIBLE_INSIDE(e) HAS_PROPERTY(e, EP_ACCESSIBLE_INSIDE)
625 #define IS_ACCESSIBLE_UNDER(e)  HAS_PROPERTY(e, EP_ACCESSIBLE_UNDER)
626 #define IS_WALKABLE(e)          HAS_PROPERTY(e, EP_WALKABLE)
627 #define IS_PASSABLE(e)          HAS_PROPERTY(e, EP_PASSABLE)
628 #define IS_ACCESSIBLE(e)        HAS_PROPERTY(e, EP_ACCESSIBLE)
629 #define IS_COLLECTIBLE(e)       HAS_PROPERTY(e, EP_COLLECTIBLE)
630 #define IS_SNAPPABLE(e)         HAS_PROPERTY(e, EP_SNAPPABLE)
631 #define IS_WALL(e)              HAS_PROPERTY(e, EP_WALL)
632 #define IS_SOLID_FOR_PUSHING(e) HAS_PROPERTY(e, EP_SOLID_FOR_PUSHING)
633 #define IS_DRAGONFIRE_PROOF(e)  HAS_PROPERTY(e, EP_DRAGONFIRE_PROOF)
634 #define IS_EXPLOSION_PROOF(e)   HAS_PROPERTY(e, EP_EXPLOSION_PROOF)
635 #define CAN_SMASH(e)            HAS_PROPERTY(e, EP_CAN_SMASH)
636 #define EXPLODES_3X3_OLD(e)     HAS_PROPERTY(e, EP_EXPLODES_3X3_OLD)
637 #define CAN_EXPLODE_BY_FIRE(e)  HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE)
638 #define CAN_EXPLODE_SMASHED(e)  HAS_PROPERTY(e, EP_CAN_EXPLODE_SMASHED)
639 #define CAN_EXPLODE_IMPACT(e)   HAS_PROPERTY(e, EP_CAN_EXPLODE_IMPACT)
640 #define IS_SP_PORT(e)           HAS_PROPERTY(e, EP_SP_PORT)
641 #define CAN_EXPLODE_BY_DRAGONFIRE(e)    \
642                                 HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_DRAGONFIRE)
643 #define CAN_EXPLODE_BY_EXPLOSION(e)     \
644                                 HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION)
645 #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID)
646 #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH)
647 #define CAN_BE_CLONED_BY_ANDROID(e)     \
648                                 HAS_PROPERTY(e, EP_CAN_BE_CLONED_BY_ANDROID)
649
650 #define IS_EDITOR_CASCADE(e)    HAS_PROPERTY(e, EP_EDITOR_CASCADE)
651 #define IS_EDITOR_CASCADE_ACTIVE(e)     \
652                                 HAS_PROPERTY(e, EP_EDITOR_CASCADE_ACTIVE)
653 #define IS_EDITOR_CASCADE_INACTIVE(e)   \
654                                 HAS_PROPERTY(e, EP_EDITOR_CASCADE_INACTIVE)
655
656 #define HAS_ACTION(e)           HAS_PROPERTY(e, EP_HAS_ACTION)
657 #define CAN_CHANGE_OR_HAS_ACTION(e)     \
658                                 HAS_PROPERTY(e, EP_CAN_CHANGE_OR_HAS_ACTION)
659
660 #define IS_OBSOLETE(e)          HAS_PROPERTY(e, EP_OBSOLETE)
661
662 // special macros used in game engine
663 #define IS_FILE_ELEMENT(e)      ((e) >= 0 &&                            \
664                                  (e) <= NUM_FILE_ELEMENTS)
665
666 #define IS_DRAWABLE_ELEMENT(e)  ((e) >= 0 &&                            \
667                                  (e) <= NUM_DRAWABLE_ELEMENTS)
668
669 #define IS_RUNTIME_ELEMENT(e)   ((e) >= 0 &&                            \
670                                  (e) <= NUM_RUNTIME_ELEMENTS)
671
672 #define IS_VALID_ELEMENT(e)     ((e) >= 0 &&                            \
673                                  (e) <= MAX_NUM_ELEMENTS)
674
675 #define IS_CUSTOM_ELEMENT(e)    ((e) >= EL_CUSTOM_START &&              \
676                                  (e) <= EL_CUSTOM_END)
677
678 #define IS_GROUP_ELEMENT(e)     ((e) >= EL_GROUP_START &&               \
679                                  (e) <= EL_GROUP_END)
680
681 #define IS_CLIPBOARD_ELEMENT(e) ((e) >= EL_INTERNAL_CLIPBOARD_START &&  \
682                                  (e) <= EL_INTERNAL_CLIPBOARD_END)
683
684 #define IS_INTERNAL_ELEMENT(e)  ((e) >= EL_INTERNAL_START &&            \
685                                  (e) <= EL_INTERNAL_END)
686
687 #define IS_MM_ELEMENT(e)        ((e) >= EL_MM_START &&                  \
688                                  (e) <= EL_MM_END)
689
690 #define IS_DF_ELEMENT(e)        ((e) >= EL_DF_START &&                  \
691                                  (e) <= EL_DF_END)
692
693 #define IS_MM_MCDUFFIN(e)       ((e) >= EL_MM_MCDUFFIN_START &&         \
694                                  (e) <= EL_MM_MCDUFFIN_END)
695
696 #define IS_DF_LASER(e)          ((e) >= EL_DF_LASER_START &&            \
697                                  (e) <= EL_DF_LASER_END)
698
699 #define IS_MM_WALL(e)           (((e) >= EL_MM_WALL_START &&            \
700                                   (e) <= EL_MM_WALL_END) ||             \
701                                  ((e) >= EL_DF_WALL_START &&            \
702                                   (e) <= EL_DF_WALL_END))
703
704 #define IS_DF_WALL(e)           ((e) >= EL_DF_WALL_START &&             \
705                                  (e) <= EL_DF_WALL_END)
706
707 #define IS_MM_WALL_EDITOR(e)    ((e) == EL_MM_STEEL_WALL ||             \
708                                  (e) == EL_MM_WOODEN_WALL ||            \
709                                  (e) == EL_MM_ICE_WALL ||               \
710                                  (e) == EL_MM_AMOEBA_WALL ||            \
711                                  (e) == EL_DF_STEEL_WALL ||             \
712                                  (e) == EL_DF_WOODEN_WALL)
713
714 #define IS_ENVELOPE(e)          ((e) >= EL_ENVELOPE_1 &&                \
715                                  (e) <= EL_ENVELOPE_4)
716
717 #define IS_BALLOON_ELEMENT(e)   ((e) == EL_BALLOON ||                   \
718                                  (e) == EL_BALLOON_SWITCH_LEFT ||       \
719                                  (e) == EL_BALLOON_SWITCH_RIGHT ||      \
720                                  (e) == EL_BALLOON_SWITCH_UP ||         \
721                                  (e) == EL_BALLOON_SWITCH_DOWN ||       \
722                                  (e) == EL_BALLOON_SWITCH_ANY ||        \
723                                  (e) == EL_BALLOON_SWITCH_NONE)
724
725 #define IS_RND_KEY(e)           ((e) >= EL_KEY_1 &&                     \
726                                  (e) <= EL_KEY_4)
727 #define IS_EM_KEY(e)            ((e) >= EL_EM_KEY_1 &&                  \
728                                  (e) <= EL_EM_KEY_4)
729 #define IS_EMC_KEY(e)           ((e) >= EL_EMC_KEY_5 &&                 \
730                                  (e) <= EL_EMC_KEY_8)
731 #define IS_KEY(e)               (IS_RND_KEY(e) ||                       \
732                                  IS_EM_KEY(e) ||                        \
733                                  IS_EMC_KEY(e))
734 #define RND_KEY_NR(e)           ((e) - EL_KEY_1)
735 #define EM_KEY_NR(e)            ((e) - EL_EM_KEY_1)
736 #define EMC_KEY_NR(e)           ((e) - EL_EMC_KEY_5 + 4)
737 #define KEY_NR(e)               (IS_RND_KEY(e) ? RND_KEY_NR(e) :        \
738                                  IS_EM_KEY(e)  ? EM_KEY_NR(e)  :        \
739                                  IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
740
741 #define IS_RND_GATE(e)          ((e) >= EL_GATE_1 &&                    \
742                                  (e) <= EL_GATE_4)
743 #define IS_EM_GATE(e)           ((e) >= EL_EM_GATE_1 &&                 \
744                                  (e) <= EL_EM_GATE_4)
745 #define IS_EMC_GATE(e)          ((e) >= EL_EMC_GATE_5 &&                \
746                                  (e) <= EL_EMC_GATE_8)
747 #define IS_DC_GATE(e)           ((e) == EL_DC_GATE_WHITE)
748 #define IS_GATE(e)              (IS_RND_GATE(e) ||                      \
749                                  IS_EM_GATE(e) ||                       \
750                                  IS_EMC_GATE(e) ||                      \
751                                  IS_DC_GATE(e))
752 #define RND_GATE_NR(e)          ((e) - EL_GATE_1)
753 #define EM_GATE_NR(e)           ((e) - EL_EM_GATE_1)
754 #define EMC_GATE_NR(e)          ((e) - EL_EMC_GATE_5 + 4)
755 #define GATE_NR(e)              (IS_RND_GATE(e) ? RND_GATE_NR(e) :      \
756                                  IS_EM_GATE(e) ?  EM_GATE_NR(e) :       \
757                                  IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0)
758
759 #define IS_RND_GATE_GRAY(e)     ((e) >= EL_GATE_1_GRAY &&               \
760                                  (e) <= EL_GATE_4_GRAY)
761 #define IS_RND_GATE_GRAY_ACTIVE(e) ((e) >= EL_GATE_1_GRAY_ACTIVE &&     \
762                                  (e) <= EL_GATE_4_GRAY_ACTIVE)
763 #define IS_EM_GATE_GRAY(e)      ((e) >= EL_EM_GATE_1_GRAY &&            \
764                                  (e) <= EL_EM_GATE_4_GRAY)
765 #define IS_EM_GATE_GRAY_ACTIVE(e) ((e) >= EL_EM_GATE_1_GRAY_ACTIVE &&   \
766                                  (e) <= EL_EM_GATE_4_GRAY_ACTIVE)
767 #define IS_EMC_GATE_GRAY(e)     ((e) >= EL_EMC_GATE_5_GRAY &&           \
768                                  (e) <= EL_EMC_GATE_8_GRAY)
769 #define IS_EMC_GATE_GRAY_ACTIVE(e) ((e) >= EL_EMC_GATE_5_GRAY_ACTIVE && \
770                                  (e) <= EL_EMC_GATE_8_GRAY_ACTIVE)
771 #define IS_DC_GATE_GRAY(e)      ((e) == EL_DC_GATE_WHITE_GRAY)
772 #define IS_DC_GATE_GRAY_ACTIVE(e) ((e) == EL_DC_GATE_WHITE_GRAY_ACTIVE)
773
774 #define IS_GATE_GRAY(e)         (IS_RND_GATE_GRAY(e) ||                 \
775                                  IS_EM_GATE_GRAY(e) ||                  \
776                                  IS_EMC_GATE_GRAY(e) ||                 \
777                                  IS_DC_GATE_GRAY(e))
778 #define IS_GATE_GRAY_ACTIVE(e)  (IS_RND_GATE_GRAY_ACTIVE(e) ||          \
779                                  IS_EM_GATE_GRAY_ACTIVE(e) ||           \
780                                  IS_EMC_GATE_GRAY_ACTIVE(e) ||          \
781                                  IS_DC_GATE_GRAY_ACTIVE(e))
782 #define RND_GATE_GRAY_NR(e)     ((e) - EL_GATE_1_GRAY)
783 #define RND_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_GATE_1_GRAY_ACTIVE)
784 #define EM_GATE_GRAY_NR(e)      ((e) - EL_EM_GATE_1_GRAY)
785 #define EM_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_EM_GATE_1_GRAY_ACTIVE)
786 #define EMC_GATE_GRAY_NR(e)     ((e) - EL_EMC_GATE_5_GRAY + 4)
787 #define EMC_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_EMC_GATE_5_GRAY_ACTIVE + 4)
788 #define GATE_GRAY_NR(e)         (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) :  \
789                                  IS_EM_GATE_GRAY(e) ?  EM_GATE_GRAY_NR(e) :   \
790                                  IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0)
791
792 #define IS_ACID_POOL_OR_ACID(e) (IS_ACID_POOL(e) || (e) == EL_ACID)
793
794 #define IS_EMC_PILLAR(e)        ((e) >= EL_EMC_WALL_1 &&                \
795                                  (e) <= EL_EMC_WALL_3)
796 #define IS_SP_CHIP(e)           ((e) == EL_SP_CHIP_SINGLE ||            \
797                                  (e) == EL_SP_CHIP_LEFT ||              \
798                                  (e) == EL_SP_CHIP_RIGHT ||             \
799                                  (e) == EL_SP_CHIP_TOP ||               \
800                                  (e) == EL_SP_CHIP_BOTTOM)
801 #define IS_SP_HARDWARE_BASE(e)  ((e) == EL_SP_HARDWARE_BASE_1 ||        \
802                                  (e) == EL_SP_HARDWARE_BASE_2 ||        \
803                                  (e) == EL_SP_HARDWARE_BASE_3 ||        \
804                                  (e) == EL_SP_HARDWARE_BASE_4 ||        \
805                                  (e) == EL_SP_HARDWARE_BASE_5 ||        \
806                                  (e) == EL_SP_HARDWARE_BASE_6)
807
808 #define IS_DC_STEELWALL_2(e)    ((e) >= EL_DC_STEELWALL_2_LEFT &&       \
809                                  (e) <= EL_DC_STEELWALL_2_SINGLE)
810
811 #define MM_WALL_BASE(e)         ((e) & 0xfff0)
812 #define MM_WALL_BITS(e)         ((e) & 0x000f)
813
814 #define GFX_ELEMENT(e)          (element_info[e].gfx_element)
815
816 // !!! CHECK THIS !!!
817 #if 1
818 #define TILE_GFX_ELEMENT(x, y)                                          \
819                    (GfxElement[x][y] != EL_UNDEFINED &&                 \
820                     Tile[x][y] != EL_EXPLOSION ?                        \
821                     GfxElement[x][y] : Tile[x][y])
822 #else
823 #define TILE_GFX_ELEMENT(x, y)                                          \
824         GFX_ELEMENT(GfxElement[x][y] != EL_UNDEFINED &&                 \
825                     Tile[x][y] != EL_EXPLOSION ?                        \
826                     GfxElement[x][y] : Tile[x][y])
827 #endif
828
829 // !!! "use sound" deactivated due to problems with level "bug machine" !!!
830 // (solution: add separate "use sound of element" to level file and editor)
831 #if 0
832 #define SND_ELEMENT(e)          GFX_ELEMENT(e)
833 #else
834 #define SND_ELEMENT(e)          (e)
835 #endif
836
837 #define GROUP_NR(e)             ((e) - EL_GROUP_START)
838 #define IS_IN_GROUP(e, nr)      (element_info[e].in_group[nr] == TRUE)
839 #define IS_IN_GROUP_EL(e, ge)   (IS_IN_GROUP(e, (ge) - EL_GROUP_START))
840
841 #define IS_EQUAL_OR_IN_GROUP(e, ge)                                     \
842         (ge == EL_ANY_ELEMENT ? TRUE :                                  \
843          IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge))
844
845 #define IS_PLAYER(x, y)         (ELEM_IS_PLAYER(StorePlayer[x][y]))
846
847 #define IS_FREE(x, y)           (Tile[x][y] == EL_EMPTY && !IS_PLAYER(x, y))
848 #define IS_FREE_OR_PLAYER(x, y) (Tile[x][y] == EL_EMPTY)
849
850 #define IS_MOVING(x,y)          (MovPos[x][y] != 0)
851 #define IS_FALLING(x,y)         (MovPos[x][y] != 0 && MovDir[x][y] == MV_DOWN)
852 #define IS_BLOCKED(x,y)         (Tile[x][y] == EL_BLOCKED)
853
854 #define IS_MV_DIAGONAL(x)       ((x) & MV_HORIZONTAL && (x) & MV_VERTICAL)
855
856 #define EL_CHANGED(e)           ((e) == EL_ROCK           ? EL_EMERALD :    \
857                                  (e) == EL_BD_ROCK        ? EL_BD_DIAMOND : \
858                                  (e) == EL_EMERALD        ? EL_DIAMOND :    \
859                                  (e) == EL_EMERALD_YELLOW ? EL_DIAMOND :    \
860                                  (e) == EL_EMERALD_RED    ? EL_DIAMOND :    \
861                                  (e) == EL_EMERALD_PURPLE ? EL_DIAMOND :    \
862                                  EL_ROCK)
863 #define EL_CHANGED_BD(e)        ((e) == EL_ROCK           ? EL_BD_DIAMOND : \
864                                  (e) == EL_BD_ROCK        ? EL_BD_DIAMOND : \
865                                  EL_BD_ROCK)
866 #define EL_CHANGED_DC(e)        ((e) == EL_ROCK           ? EL_EMERALD :    \
867                                  (e) == EL_BD_ROCK        ? EL_BD_DIAMOND : \
868                                  (e) == EL_EMERALD        ? EL_DIAMOND :    \
869                                  (e) == EL_EMERALD_YELLOW ? EL_DIAMOND :    \
870                                  (e) == EL_EMERALD_RED    ? EL_DIAMOND :    \
871                                  (e) == EL_EMERALD_PURPLE ? EL_DIAMOND :    \
872                                  (e) == EL_PEARL          ? EL_BOMB    :    \
873                                  (e) == EL_CRYSTAL        ? EL_CRYSTAL :    \
874                                  EL_ROCK)
875 #define IS_DRAWABLE(e)          ((e) < EL_BLOCKED)
876 #define IS_NOT_DRAWABLE(e)      ((e) >= EL_BLOCKED)
877 #define TAPE_IS_EMPTY(x)        ((x).length == 0)
878 #define TAPE_IS_STOPPED(x)      (!(x).recording && !(x).playing)
879
880 #define PLAYERINFO(x,y)         (&stored_player[StorePlayer[x][y]-EL_PLAYER_1])
881 #define SHIELD_ON(p)            ((p)->shield_normal_time_left > 0)
882
883 #define ENEMY_PROTECTED_FIELD(x,y)      (IS_PROTECTED(Tile[x][y]) ||       \
884                                          IS_PROTECTED(Back[x][y]))
885 #define EXPLOSION_PROTECTED_FIELD(x,y)  (IS_EXPLOSION_PROOF(Tile[x][y]))
886 #define PLAYER_ENEMY_PROTECTED(x,y)     (SHIELD_ON(PLAYERINFO(x, y)) ||    \
887                                          ENEMY_PROTECTED_FIELD(x, y))
888 #define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) ||    \
889                                          EXPLOSION_PROTECTED_FIELD(x, y))
890
891 #define PLAYER_SWITCHING(p,x,y) ((p)->is_switching &&                   \
892                                  (p)->switch_x == (x) && (p)->switch_y == (y))
893
894 #define PLAYER_DROPPING(p,x,y)  ((p)->is_dropping &&                    \
895                                  (p)->drop_x == (x) && (p)->drop_y == (y))
896
897 #define PLAYER_NR_GFX(g,i)      ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1))
898
899 #define GET_PLAYER_ELEMENT(e)   ((e) >= EL_PLAYER_1 && (e) <= EL_PLAYER_4 ? \
900                                  (e) : EL_PLAYER_1)
901
902 #define GET_PLAYER_NR(e)        (GET_PLAYER_ELEMENT(e) - EL_PLAYER_1)
903
904 #define ANIM_FRAMES(g)          (graphic_info[g].anim_frames)
905 #define ANIM_DELAY(g)           (graphic_info[g].anim_delay)
906 #define ANIM_MODE(g)            (graphic_info[g].anim_mode)
907
908 #define IS_ANIM_MODE_CE(g)      (graphic_info[g].anim_mode & (ANIM_CE_VALUE |  \
909                                                               ANIM_CE_SCORE |  \
910                                                               ANIM_CE_DELAY))
911 #define IS_ANIMATED(g)          (ANIM_FRAMES(g) > 1)
912 #define IS_NEW_DELAY(f, g)      ((f) % ANIM_DELAY(g) == 0)
913 #define IS_NEW_FRAME(f, g)      (IS_ANIMATED(g) && IS_NEW_DELAY(f, g))
914 #define IS_NEXT_FRAME(f, g)     (IS_NEW_FRAME(f, g) && (f) > 0)
915
916 #define IS_LOOP_SOUND(s)        (sound_info[s].loop)
917 #define IS_LOOP_MUSIC(s)        (music_info[s].loop)
918
919 #define IS_SPECIAL_GFX_ARG(a)   ((a) >= 0 && (a) < NUM_SPECIAL_GFX_ARGS)
920
921 #define IS_GLOBAL_ANIM_PART(a)  ((a) >= 0 && (a) < NUM_GLOBAL_ANIM_PARTS)
922
923 #define EL_CASCADE_ACTIVE(e)    (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e))
924 #define EL_CASCADE_INACTIVE(e)  (IS_EDITOR_CASCADE_ACTIVE(e)   ? (e) - 1 : (e))
925 #define EL_CASCADE_TOGGLE(e)    (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 :    \
926                                  IS_EDITOR_CASCADE_ACTIVE(e)   ? (e) - 1 : (e))
927
928 #define EL_NAME(e)              ((e) >= 0 ? element_info[e].token_name : "(?)")
929 #define MV_TEXT(d)              ((d) == MV_NONE  ? "MV_NONE"  :         \
930                                  (d) == MV_LEFT  ? "MV_LEFT"  :         \
931                                  (d) == MV_RIGHT ? "MV_RIGHT" :         \
932                                  (d) == MV_UP    ? "MV_UP"    :         \
933                                  (d) == MV_DOWN  ? "MV_DOWN"  : "(various)")
934
935 #define ELEMENT_ACTIVE(e)       (ActiveElement[e])
936 #define BUTTON_ACTIVE(b)        (ActiveButton[b])
937 #define FONT_ACTIVE(f)          (ActiveFont[f])
938
939 // fundamental game speed values
940 #define MICROLEVEL_SCROLL_DELAY 50      // delay for scrolling micro level
941 #define MICROLEVEL_LABEL_DELAY  250     // delay for micro level label
942
943 // boundaries of arrays etc.
944 #define MAX_LEVEL_NAME_LEN      32
945 #define MAX_LEVEL_AUTHOR_LEN    32
946 #define MAX_ELEMENT_NAME_LEN    32
947 #define MAX_TAPES_PER_SET       1024
948 #define MAX_SCORE_ENTRIES       100
949 #define MAX_NUM_TITLE_IMAGES    5
950 #define MAX_NUM_TITLE_MESSAGES  5
951
952 #define MAX_NUM_AMOEBA          100
953
954 #define NUM_ENVELOPES           4
955 #define MIN_ENVELOPE_XSIZE      1
956 #define MIN_ENVELOPE_YSIZE      1
957 #define MAX_ENVELOPE_XSIZE      30
958 #define MAX_ENVELOPE_YSIZE      20
959 #define MAX_ENVELOPE_TEXT_LEN   (MAX_ENVELOPE_XSIZE * MAX_ENVELOPE_YSIZE)
960 #define MIN_CHANGE_PAGES        1
961 #define MAX_CHANGE_PAGES        32
962 #define MIN_ELEMENTS_IN_GROUP   1
963 #define MAX_ELEMENTS_IN_GROUP   16
964 #define MIN_ANDROID_ELEMENTS    1
965 #define MAX_ANDROID_ELEMENTS    32
966 #define MAX_ANDROID_ELEMENTS_OLD 16     // (extended since version 4.2.0.0)
967
968 // values for elements with content
969 #define MIN_ELEMENT_CONTENTS    1
970 #define STD_ELEMENT_CONTENTS    4
971 #define MAX_ELEMENT_CONTENTS    8
972
973 // values for initial player inventory
974 #define MIN_INITIAL_INVENTORY_SIZE      1
975 #define MAX_INITIAL_INVENTORY_SIZE      8
976
977 // often used screen positions
978 #define TILESIZE                32
979 #define TILEX                   TILESIZE
980 #define TILEY                   TILESIZE
981 #define TILEX_VAR               TILESIZE_VAR
982 #define TILEY_VAR               TILESIZE_VAR
983 #define MINI_TILESIZE           (TILESIZE / 2)
984 #define MINI_TILEX              MINI_TILESIZE
985 #define MINI_TILEY              MINI_TILESIZE
986 #define MICRO_TILESIZE          (TILESIZE / 8)
987 #define MICRO_TILEX             MICRO_TILESIZE
988 #define MICRO_TILEY             MICRO_TILESIZE
989 #define MIDPOSX                 (SCR_FIELDX / 2)
990 #define MIDPOSY                 (SCR_FIELDY / 2)
991 #define FXSIZE                  ((2 + SCR_FIELDX + 2) * TILEX_VAR)
992 #define FYSIZE                  ((2 + SCR_FIELDY + 2) * TILEY_VAR)
993
994 #define MICROLEVEL_XSIZE        ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
995 #define MICROLEVEL_YSIZE        ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
996 #define MICROLEVEL_XPOS         (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2)
997 #define MICROLEVEL_YPOS         (SY + 12 * TILEY - MICRO_TILEY)
998 #define MICROLABEL1_YPOS        (MICROLEVEL_YPOS - 36)
999 #define MICROLABEL2_YPOS        (MICROLEVEL_YPOS + MICROLEVEL_YSIZE + 7)
1000
1001 // values for GfxRedraw
1002 #define GFX_REDRAW_NONE                         (0)
1003 #define GFX_REDRAW_TILE                         (1 << 0)
1004 #define GFX_REDRAW_TILE_CRUMBLED                (1 << 1)
1005 #define GFX_REDRAW_TILE_CRUMBLED_NEIGHBOURS     (1 << 2)
1006 #define GFX_REDRAW_TILE_TWINKLED                (1 << 3)
1007
1008 // score for elements
1009 #define SC_EMERALD              0
1010 #define SC_DIAMOND              1
1011 #define SC_BUG                  2
1012 #define SC_SPACESHIP            3
1013 #define SC_YAMYAM               4
1014 #define SC_ROBOT                5
1015 #define SC_PACMAN               6
1016 #define SC_NUT                  7
1017 #define SC_DYNAMITE             8
1018 #define SC_KEY                  9
1019 #define SC_TIME_BONUS           10
1020 #define SC_CRYSTAL              11
1021 #define SC_PEARL                12
1022 #define SC_SHIELD               13
1023 #define SC_ELEM_BONUS           14
1024 #define SC_UNKNOWN_15           15
1025
1026 #define LEVEL_SCORE_ELEMENTS    16      // level elements with score
1027
1028
1029 // "real" level file elements
1030 #define EL_UNDEFINED                    -1
1031
1032 #define EL_EMPTY_SPACE                  0
1033 #define EL_EMPTY                        EL_EMPTY_SPACE
1034 #define EL_SAND                         1
1035 #define EL_WALL                         2
1036 #define EL_WALL_SLIPPERY                3
1037 #define EL_ROCK                         4
1038 #define EL_KEY_OBSOLETE                 5       // obsolete; now EL_KEY_1
1039 #define EL_EMERALD                      6
1040 #define EL_EXIT_CLOSED                  7
1041 #define EL_PLAYER_OBSOLETE              8       // obsolete; now EL_PLAYER_1
1042 #define EL_BUG                          9
1043 #define EL_SPACESHIP                    10
1044 #define EL_YAMYAM                       11
1045 #define EL_ROBOT                        12
1046 #define EL_STEELWALL                    13
1047 #define EL_DIAMOND                      14
1048 #define EL_AMOEBA_DEAD                  15
1049 #define EL_QUICKSAND_EMPTY              16
1050 #define EL_QUICKSAND_FULL               17
1051 #define EL_AMOEBA_DROP                  18
1052 #define EL_BOMB                         19
1053 #define EL_MAGIC_WALL                   20
1054 #define EL_SPEED_PILL                   21
1055 #define EL_ACID                         22
1056 #define EL_AMOEBA_WET                   23
1057 #define EL_AMOEBA_DRY                   24
1058 #define EL_NUT                          25
1059 #define EL_GAME_OF_LIFE                 26
1060 #define EL_BIOMAZE                      27
1061 #define EL_DYNAMITE_ACTIVE              28
1062 #define EL_STONEBLOCK                   29
1063 #define EL_ROBOT_WHEEL                  30
1064 #define EL_ROBOT_WHEEL_ACTIVE           31
1065 #define EL_KEY_1                        32
1066 #define EL_KEY_2                        33
1067 #define EL_KEY_3                        34
1068 #define EL_KEY_4                        35
1069 #define EL_GATE_1                       36
1070 #define EL_GATE_2                       37
1071 #define EL_GATE_3                       38
1072 #define EL_GATE_4                       39
1073 #define EL_GATE_1_GRAY                  40
1074 #define EL_GATE_2_GRAY                  41
1075 #define EL_GATE_3_GRAY                  42
1076 #define EL_GATE_4_GRAY                  43
1077 #define EL_DYNAMITE                     44
1078 #define EL_PACMAN                       45
1079 #define EL_INVISIBLE_WALL               46
1080 #define EL_LAMP                         47
1081 #define EL_LAMP_ACTIVE                  48
1082 #define EL_WALL_EMERALD                 49
1083 #define EL_WALL_DIAMOND                 50
1084 #define EL_AMOEBA_FULL                  51
1085 #define EL_BD_AMOEBA                    52
1086 #define EL_TIME_ORB_FULL                53
1087 #define EL_TIME_ORB_EMPTY               54
1088 #define EL_EXPANDABLE_WALL              55
1089 #define EL_BD_DIAMOND                   56
1090 #define EL_EMERALD_YELLOW               57
1091 #define EL_WALL_BD_DIAMOND              58
1092 #define EL_WALL_EMERALD_YELLOW          59
1093 #define EL_DARK_YAMYAM                  60
1094 #define EL_BD_MAGIC_WALL                61
1095 #define EL_INVISIBLE_STEELWALL          62
1096 #define EL_SOKOBAN_FIELD_PLAYER         63
1097 #define EL_DYNABOMB_INCREASE_NUMBER     64
1098 #define EL_DYNABOMB_INCREASE_SIZE       65
1099 #define EL_DYNABOMB_INCREASE_POWER      66
1100 #define EL_SOKOBAN_OBJECT               67
1101 #define EL_SOKOBAN_FIELD_EMPTY          68
1102 #define EL_SOKOBAN_FIELD_FULL           69
1103 #define EL_BD_BUTTERFLY_RIGHT           70
1104 #define EL_BD_BUTTERFLY_UP              71
1105 #define EL_BD_BUTTERFLY_LEFT            72
1106 #define EL_BD_BUTTERFLY_DOWN            73
1107 #define EL_BD_FIREFLY_RIGHT             74
1108 #define EL_BD_FIREFLY_UP                75
1109 #define EL_BD_FIREFLY_LEFT              76
1110 #define EL_BD_FIREFLY_DOWN              77
1111 #define EL_BD_BUTTERFLY_1               EL_BD_BUTTERFLY_DOWN
1112 #define EL_BD_BUTTERFLY_2               EL_BD_BUTTERFLY_LEFT
1113 #define EL_BD_BUTTERFLY_3               EL_BD_BUTTERFLY_UP
1114 #define EL_BD_BUTTERFLY_4               EL_BD_BUTTERFLY_RIGHT
1115 #define EL_BD_FIREFLY_1                 EL_BD_FIREFLY_LEFT
1116 #define EL_BD_FIREFLY_2                 EL_BD_FIREFLY_DOWN
1117 #define EL_BD_FIREFLY_3                 EL_BD_FIREFLY_RIGHT
1118 #define EL_BD_FIREFLY_4                 EL_BD_FIREFLY_UP
1119 #define EL_BD_BUTTERFLY                 78
1120 #define EL_BD_FIREFLY                   79
1121 #define EL_PLAYER_1                     80
1122 #define EL_PLAYER_2                     81
1123 #define EL_PLAYER_3                     82
1124 #define EL_PLAYER_4                     83
1125 #define EL_BUG_RIGHT                    84
1126 #define EL_BUG_UP                       85
1127 #define EL_BUG_LEFT                     86
1128 #define EL_BUG_DOWN                     87
1129 #define EL_SPACESHIP_RIGHT              88
1130 #define EL_SPACESHIP_UP                 89
1131 #define EL_SPACESHIP_LEFT               90
1132 #define EL_SPACESHIP_DOWN               91
1133 #define EL_PACMAN_RIGHT                 92
1134 #define EL_PACMAN_UP                    93
1135 #define EL_PACMAN_LEFT                  94
1136 #define EL_PACMAN_DOWN                  95
1137 #define EL_EMERALD_RED                  96
1138 #define EL_EMERALD_PURPLE               97
1139 #define EL_WALL_EMERALD_RED             98
1140 #define EL_WALL_EMERALD_PURPLE          99
1141 #define EL_ACID_POOL_TOPLEFT            100
1142 #define EL_ACID_POOL_TOPRIGHT           101
1143 #define EL_ACID_POOL_BOTTOMLEFT         102
1144 #define EL_ACID_POOL_BOTTOM             103
1145 #define EL_ACID_POOL_BOTTOMRIGHT        104
1146 #define EL_BD_WALL                      105
1147 #define EL_BD_ROCK                      106
1148 #define EL_EXIT_OPEN                    107
1149 #define EL_BLACK_ORB                    108
1150 #define EL_AMOEBA_TO_DIAMOND            109
1151 #define EL_MOLE                         110
1152 #define EL_PENGUIN                      111
1153 #define EL_SATELLITE                    112
1154 #define EL_ARROW_LEFT                   113
1155 #define EL_ARROW_RIGHT                  114
1156 #define EL_ARROW_UP                     115
1157 #define EL_ARROW_DOWN                   116
1158 #define EL_PIG                          117
1159 #define EL_DRAGON                       118
1160
1161 #define EL_EM_KEY_1_FILE_OBSOLETE       119     // obsolete; now EL_EM_KEY_1
1162
1163 #define EL_CHAR_START                   120
1164 #define EL_CHAR_ASCII0                  (EL_CHAR_START  - 32)
1165 #define EL_CHAR_ASCII0_START            (EL_CHAR_ASCII0 + 32)
1166
1167 #include "conf_chr.h"   // include auto-generated data structure definitions
1168
1169 #define EL_CHAR_ASCII0_END              (EL_CHAR_ASCII0 + 111)
1170 #define EL_CHAR_END                     (EL_CHAR_START  + 79)
1171
1172 #define EL_CHAR(c)                      (EL_CHAR_ASCII0 + MAP_FONT_ASCII(c))
1173
1174 #define EL_EXPANDABLE_WALL_HORIZONTAL   200
1175 #define EL_EXPANDABLE_WALL_VERTICAL     201
1176 #define EL_EXPANDABLE_WALL_ANY          202
1177
1178 #define EL_EM_GATE_1                    203
1179 #define EL_EM_GATE_2                    204
1180 #define EL_EM_GATE_3                    205
1181 #define EL_EM_GATE_4                    206
1182
1183 #define EL_EM_KEY_2_FILE_OBSOLETE       207     // obsolete; now EL_EM_KEY_2
1184 #define EL_EM_KEY_3_FILE_OBSOLETE       208     // obsolete; now EL_EM_KEY_3
1185 #define EL_EM_KEY_4_FILE_OBSOLETE       209     // obsolete; now EL_EM_KEY_4
1186
1187 #define EL_SP_START                     210
1188 #define EL_SP_EMPTY_SPACE               (EL_SP_START + 0)
1189 #define EL_SP_EMPTY                     EL_SP_EMPTY_SPACE
1190 #define EL_SP_ZONK                      (EL_SP_START + 1)
1191 #define EL_SP_BASE                      (EL_SP_START + 2)
1192 #define EL_SP_MURPHY                    (EL_SP_START + 3)
1193 #define EL_SP_INFOTRON                  (EL_SP_START + 4)
1194 #define EL_SP_CHIP_SINGLE               (EL_SP_START + 5)
1195 #define EL_SP_HARDWARE_GRAY             (EL_SP_START + 6)
1196 #define EL_SP_EXIT_CLOSED               (EL_SP_START + 7)
1197 #define EL_SP_DISK_ORANGE               (EL_SP_START + 8)
1198 #define EL_SP_PORT_RIGHT                (EL_SP_START + 9)
1199 #define EL_SP_PORT_DOWN                 (EL_SP_START + 10)
1200 #define EL_SP_PORT_LEFT                 (EL_SP_START + 11)
1201 #define EL_SP_PORT_UP                   (EL_SP_START + 12)
1202 #define EL_SP_GRAVITY_PORT_RIGHT        (EL_SP_START + 13)
1203 #define EL_SP_GRAVITY_PORT_DOWN         (EL_SP_START + 14)
1204 #define EL_SP_GRAVITY_PORT_LEFT         (EL_SP_START + 15)
1205 #define EL_SP_GRAVITY_PORT_UP           (EL_SP_START + 16)
1206 #define EL_SP_SNIKSNAK                  (EL_SP_START + 17)
1207 #define EL_SP_DISK_YELLOW               (EL_SP_START + 18)
1208 #define EL_SP_TERMINAL                  (EL_SP_START + 19)
1209 #define EL_SP_DISK_RED                  (EL_SP_START + 20)
1210 #define EL_SP_PORT_VERTICAL             (EL_SP_START + 21)
1211 #define EL_SP_PORT_HORIZONTAL           (EL_SP_START + 22)
1212 #define EL_SP_PORT_ANY                  (EL_SP_START + 23)
1213 #define EL_SP_ELECTRON                  (EL_SP_START + 24)
1214 #define EL_SP_BUGGY_BASE                (EL_SP_START + 25)
1215 #define EL_SP_CHIP_LEFT                 (EL_SP_START + 26)
1216 #define EL_SP_CHIP_RIGHT                (EL_SP_START + 27)
1217 #define EL_SP_HARDWARE_BASE_1           (EL_SP_START + 28)
1218 #define EL_SP_HARDWARE_GREEN            (EL_SP_START + 29)
1219 #define EL_SP_HARDWARE_BLUE             (EL_SP_START + 30)
1220 #define EL_SP_HARDWARE_RED              (EL_SP_START + 31)
1221 #define EL_SP_HARDWARE_YELLOW           (EL_SP_START + 32)
1222 #define EL_SP_HARDWARE_BASE_2           (EL_SP_START + 33)
1223 #define EL_SP_HARDWARE_BASE_3           (EL_SP_START + 34)
1224 #define EL_SP_HARDWARE_BASE_4           (EL_SP_START + 35)
1225 #define EL_SP_HARDWARE_BASE_5           (EL_SP_START + 36)
1226 #define EL_SP_HARDWARE_BASE_6           (EL_SP_START + 37)
1227 #define EL_SP_CHIP_TOP                  (EL_SP_START + 38)
1228 #define EL_SP_CHIP_BOTTOM               (EL_SP_START + 39)
1229 #define EL_SP_END                       (EL_SP_START + 39)
1230
1231 #define EL_EM_GATE_1_GRAY               250
1232 #define EL_EM_GATE_2_GRAY               251
1233 #define EL_EM_GATE_3_GRAY               252
1234 #define EL_EM_GATE_4_GRAY               253
1235
1236 #define EL_EM_DYNAMITE                  254
1237 #define EL_EM_DYNAMITE_ACTIVE           255
1238
1239 #define EL_PEARL                        256
1240 #define EL_CRYSTAL                      257
1241 #define EL_WALL_PEARL                   258
1242 #define EL_WALL_CRYSTAL                 259
1243 #define EL_DC_GATE_WHITE                260
1244 #define EL_DC_GATE_WHITE_GRAY           261
1245 #define EL_DC_KEY_WHITE                 262
1246 #define EL_SHIELD_NORMAL                263
1247 #define EL_EXTRA_TIME                   264
1248 #define EL_SWITCHGATE_OPEN              265
1249 #define EL_SWITCHGATE_CLOSED            266
1250 #define EL_SWITCHGATE_SWITCH_UP         267
1251 #define EL_SWITCHGATE_SWITCH_DOWN       268
1252
1253 #define EL_UNUSED_269                   269
1254 #define EL_UNUSED_270                   270
1255
1256 #define EL_CONVEYOR_BELT_1_LEFT          271
1257 #define EL_CONVEYOR_BELT_1_MIDDLE        272
1258 #define EL_CONVEYOR_BELT_1_RIGHT         273
1259 #define EL_CONVEYOR_BELT_1_SWITCH_LEFT   274
1260 #define EL_CONVEYOR_BELT_1_SWITCH_MIDDLE 275
1261 #define EL_CONVEYOR_BELT_1_SWITCH_RIGHT  276
1262 #define EL_CONVEYOR_BELT_2_LEFT          277
1263 #define EL_CONVEYOR_BELT_2_MIDDLE        278
1264 #define EL_CONVEYOR_BELT_2_RIGHT         279
1265 #define EL_CONVEYOR_BELT_2_SWITCH_LEFT   280
1266 #define EL_CONVEYOR_BELT_2_SWITCH_MIDDLE 281
1267 #define EL_CONVEYOR_BELT_2_SWITCH_RIGHT  282
1268 #define EL_CONVEYOR_BELT_3_LEFT          283
1269 #define EL_CONVEYOR_BELT_3_MIDDLE        284
1270 #define EL_CONVEYOR_BELT_3_RIGHT         285
1271 #define EL_CONVEYOR_BELT_3_SWITCH_LEFT   286
1272 #define EL_CONVEYOR_BELT_3_SWITCH_MIDDLE 287
1273 #define EL_CONVEYOR_BELT_3_SWITCH_RIGHT  288
1274 #define EL_CONVEYOR_BELT_4_LEFT          289
1275 #define EL_CONVEYOR_BELT_4_MIDDLE        290
1276 #define EL_CONVEYOR_BELT_4_RIGHT         291
1277 #define EL_CONVEYOR_BELT_4_SWITCH_LEFT   292
1278 #define EL_CONVEYOR_BELT_4_SWITCH_MIDDLE 293
1279 #define EL_CONVEYOR_BELT_4_SWITCH_RIGHT  294
1280 #define EL_LANDMINE                     295
1281 #define EL_ENVELOPE_OBSOLETE            296   // obsolete; now EL_ENVELOPE_1
1282 #define EL_LIGHT_SWITCH                 297
1283 #define EL_LIGHT_SWITCH_ACTIVE          298
1284 #define EL_SIGN_EXCLAMATION             299
1285 #define EL_SIGN_RADIOACTIVITY           300
1286 #define EL_SIGN_STOP                    301
1287 #define EL_SIGN_WHEELCHAIR              302
1288 #define EL_SIGN_PARKING                 303
1289 #define EL_SIGN_NO_ENTRY                304
1290 #define EL_SIGN_UNUSED_1                305
1291 #define EL_SIGN_GIVE_WAY                306
1292 #define EL_SIGN_ENTRY_FORBIDDEN         307
1293 #define EL_SIGN_EMERGENCY_EXIT          308
1294 #define EL_SIGN_YIN_YANG                309
1295 #define EL_SIGN_UNUSED_2                310
1296 #define EL_MOLE_LEFT                    311
1297 #define EL_MOLE_RIGHT                   312
1298 #define EL_MOLE_UP                      313
1299 #define EL_MOLE_DOWN                    314
1300 #define EL_STEELWALL_SLIPPERY           315
1301 #define EL_INVISIBLE_SAND               316
1302 #define EL_DX_UNKNOWN_15                317
1303 #define EL_DX_UNKNOWN_42                318
1304
1305 #define EL_UNUSED_319                   319
1306 #define EL_UNUSED_320                   320
1307
1308 #define EL_SHIELD_DEADLY                321
1309 #define EL_TIMEGATE_OPEN                322
1310 #define EL_TIMEGATE_CLOSED              323
1311 #define EL_TIMEGATE_SWITCH_ACTIVE       324
1312 #define EL_TIMEGATE_SWITCH              325
1313
1314 #define EL_BALLOON                      326
1315 #define EL_BALLOON_SWITCH_LEFT          327
1316 #define EL_BALLOON_SWITCH_RIGHT         328
1317 #define EL_BALLOON_SWITCH_UP            329
1318 #define EL_BALLOON_SWITCH_DOWN          330
1319 #define EL_BALLOON_SWITCH_ANY           331
1320
1321 #define EL_EMC_STEELWALL_1              332
1322 #define EL_EMC_STEELWALL_2              333
1323 #define EL_EMC_STEELWALL_3              334
1324 #define EL_EMC_STEELWALL_4              335
1325 #define EL_EMC_WALL_1                   336
1326 #define EL_EMC_WALL_2                   337
1327 #define EL_EMC_WALL_3                   338
1328 #define EL_EMC_WALL_4                   339
1329 #define EL_EMC_WALL_5                   340
1330 #define EL_EMC_WALL_6                   341
1331 #define EL_EMC_WALL_7                   342
1332 #define EL_EMC_WALL_8                   343
1333
1334 #define EL_TUBE_ANY                     344
1335 #define EL_TUBE_VERTICAL                345
1336 #define EL_TUBE_HORIZONTAL              346
1337 #define EL_TUBE_VERTICAL_LEFT           347
1338 #define EL_TUBE_VERTICAL_RIGHT          348
1339 #define EL_TUBE_HORIZONTAL_UP           349
1340 #define EL_TUBE_HORIZONTAL_DOWN         350
1341 #define EL_TUBE_LEFT_UP                 351
1342 #define EL_TUBE_LEFT_DOWN               352
1343 #define EL_TUBE_RIGHT_UP                353
1344 #define EL_TUBE_RIGHT_DOWN              354
1345 #define EL_SPRING                       355
1346 #define EL_TRAP                         356
1347 #define EL_DX_SUPABOMB                  357
1348
1349 #define EL_UNUSED_358                   358
1350 #define EL_UNUSED_359                   359
1351
1352 // ---------- begin of custom elements section --------------------------------
1353 #define EL_CUSTOM_START                 360
1354
1355 #include "conf_cus.h"   // include auto-generated data structure definitions
1356
1357 #define NUM_CUSTOM_ELEMENTS             256
1358 #define EL_CUSTOM_END                   615
1359 // ---------- end of custom elements section ----------------------------------
1360
1361 #define EL_EM_KEY_1                     616
1362 #define EL_EM_KEY_2                     617
1363 #define EL_EM_KEY_3                     618
1364 #define EL_EM_KEY_4                     619
1365 #define EL_ENVELOPE_1                   620
1366 #define EL_ENVELOPE_2                   621
1367 #define EL_ENVELOPE_3                   622
1368 #define EL_ENVELOPE_4                   623
1369
1370 // ---------- begin of group elements section ---------------------------------
1371 #define EL_GROUP_START                  624
1372
1373 #include "conf_grp.h"   // include auto-generated data structure definitions
1374
1375 #define NUM_GROUP_ELEMENTS              32
1376 #define EL_GROUP_END                    655
1377 // ---------- end of custom elements section ----------------------------------
1378
1379 #define EL_UNKNOWN                      656
1380 #define EL_TRIGGER_ELEMENT              657
1381 #define EL_TRIGGER_PLAYER               658
1382
1383 // SP style elements
1384 #define EL_SP_GRAVITY_ON_PORT_RIGHT     659
1385 #define EL_SP_GRAVITY_ON_PORT_DOWN      660
1386 #define EL_SP_GRAVITY_ON_PORT_LEFT      661
1387 #define EL_SP_GRAVITY_ON_PORT_UP        662
1388 #define EL_SP_GRAVITY_OFF_PORT_RIGHT    663
1389 #define EL_SP_GRAVITY_OFF_PORT_DOWN     664
1390 #define EL_SP_GRAVITY_OFF_PORT_LEFT     665
1391 #define EL_SP_GRAVITY_OFF_PORT_UP       666
1392
1393 // EMC style elements
1394 #define EL_BALLOON_SWITCH_NONE          667
1395 #define EL_EMC_GATE_5                   668
1396 #define EL_EMC_GATE_6                   669
1397 #define EL_EMC_GATE_7                   670
1398 #define EL_EMC_GATE_8                   671
1399 #define EL_EMC_GATE_5_GRAY              672
1400 #define EL_EMC_GATE_6_GRAY              673
1401 #define EL_EMC_GATE_7_GRAY              674
1402 #define EL_EMC_GATE_8_GRAY              675
1403 #define EL_EMC_KEY_5                    676
1404 #define EL_EMC_KEY_6                    677
1405 #define EL_EMC_KEY_7                    678
1406 #define EL_EMC_KEY_8                    679
1407 #define EL_EMC_ANDROID                  680
1408 #define EL_EMC_GRASS                    681
1409 #define EL_EMC_MAGIC_BALL               682
1410 #define EL_EMC_MAGIC_BALL_ACTIVE        683
1411 #define EL_EMC_MAGIC_BALL_SWITCH        684
1412 #define EL_EMC_MAGIC_BALL_SWITCH_ACTIVE 685
1413 #define EL_EMC_SPRING_BUMPER            686
1414 #define EL_EMC_PLANT                    687
1415 #define EL_EMC_LENSES                   688
1416 #define EL_EMC_MAGNIFIER                689
1417 #define EL_EMC_WALL_9                   690
1418 #define EL_EMC_WALL_10                  691
1419 #define EL_EMC_WALL_11                  692
1420 #define EL_EMC_WALL_12                  693
1421 #define EL_EMC_WALL_13                  694
1422 #define EL_EMC_WALL_14                  695
1423 #define EL_EMC_WALL_15                  696
1424 #define EL_EMC_WALL_16                  697
1425 #define EL_EMC_WALL_SLIPPERY_1          698
1426 #define EL_EMC_WALL_SLIPPERY_2          699
1427 #define EL_EMC_WALL_SLIPPERY_3          700
1428 #define EL_EMC_WALL_SLIPPERY_4          701
1429 #define EL_EMC_FAKE_GRASS               702
1430 #define EL_EMC_FAKE_ACID                703
1431 #define EL_EMC_DRIPPER                  704
1432
1433 #define EL_TRIGGER_CE_VALUE             705
1434 #define EL_TRIGGER_CE_SCORE             706
1435 #define EL_CURRENT_CE_VALUE             707
1436 #define EL_CURRENT_CE_SCORE             708
1437
1438 #define EL_YAMYAM_LEFT                  709
1439 #define EL_YAMYAM_RIGHT                 710
1440 #define EL_YAMYAM_UP                    711
1441 #define EL_YAMYAM_DOWN                  712
1442
1443 #define EL_BD_EXPANDABLE_WALL           713
1444
1445 #define EL_PREV_CE_8                    714
1446 #define EL_PREV_CE_7                    715
1447 #define EL_PREV_CE_6                    716
1448 #define EL_PREV_CE_5                    717
1449 #define EL_PREV_CE_4                    718
1450 #define EL_PREV_CE_3                    719
1451 #define EL_PREV_CE_2                    720
1452 #define EL_PREV_CE_1                    721
1453 #define EL_SELF                         722
1454 #define EL_NEXT_CE_1                    723
1455 #define EL_NEXT_CE_2                    724
1456 #define EL_NEXT_CE_3                    725
1457 #define EL_NEXT_CE_4                    726
1458 #define EL_NEXT_CE_5                    727
1459 #define EL_NEXT_CE_6                    728
1460 #define EL_NEXT_CE_7                    729
1461 #define EL_NEXT_CE_8                    730
1462 #define EL_ANY_ELEMENT                  731
1463
1464 #define EL_STEEL_CHAR_START             732
1465 #define EL_STEEL_CHAR_ASCII0            (EL_STEEL_CHAR_START  - 32)
1466 #define EL_STEEL_CHAR_ASCII0_START      (EL_STEEL_CHAR_ASCII0 + 32)
1467
1468 // (auto-generated data structure definitions included with normal chars)
1469
1470 #define EL_STEEL_CHAR_ASCII0_END        (EL_STEEL_CHAR_ASCII0 + 111)
1471 #define EL_STEEL_CHAR_END               (EL_STEEL_CHAR_START  + 79)
1472
1473 #define EL_STEEL_CHAR(c)                (EL_STEEL_CHAR_ASCII0+MAP_FONT_ASCII(c))
1474
1475 #define EL_SPERMS                       812
1476 #define EL_BULLET                       813
1477 #define EL_HEART                        814
1478 #define EL_CROSS                        815
1479 #define EL_FRANKIE                      816
1480 #define EL_SIGN_SPERMS                  817
1481 #define EL_SIGN_BULLET                  818
1482 #define EL_SIGN_HEART                   819
1483 #define EL_SIGN_CROSS                   820
1484 #define EL_SIGN_FRANKIE                 821
1485
1486 #define EL_STEEL_EXIT_CLOSED            822
1487 #define EL_STEEL_EXIT_OPEN              823
1488
1489 #define EL_DC_STEELWALL_1_LEFT          824
1490 #define EL_DC_STEELWALL_1_RIGHT         825
1491 #define EL_DC_STEELWALL_1_TOP           826
1492 #define EL_DC_STEELWALL_1_BOTTOM        827
1493 #define EL_DC_STEELWALL_1_HORIZONTAL    828
1494 #define EL_DC_STEELWALL_1_VERTICAL      829
1495 #define EL_DC_STEELWALL_1_TOPLEFT       830
1496 #define EL_DC_STEELWALL_1_TOPRIGHT      831
1497 #define EL_DC_STEELWALL_1_BOTTOMLEFT    832
1498 #define EL_DC_STEELWALL_1_BOTTOMRIGHT   833
1499 #define EL_DC_STEELWALL_1_TOPLEFT_2     834
1500 #define EL_DC_STEELWALL_1_TOPRIGHT_2    835
1501 #define EL_DC_STEELWALL_1_BOTTOMLEFT_2  836
1502 #define EL_DC_STEELWALL_1_BOTTOMRIGHT_2 837
1503
1504 #define EL_DC_STEELWALL_2_LEFT          838
1505 #define EL_DC_STEELWALL_2_RIGHT         839
1506 #define EL_DC_STEELWALL_2_TOP           840
1507 #define EL_DC_STEELWALL_2_BOTTOM        841
1508 #define EL_DC_STEELWALL_2_HORIZONTAL    842
1509 #define EL_DC_STEELWALL_2_VERTICAL      843
1510 #define EL_DC_STEELWALL_2_MIDDLE        844
1511 #define EL_DC_STEELWALL_2_SINGLE        845
1512
1513 #define EL_DC_SWITCHGATE_SWITCH_UP      846
1514 #define EL_DC_SWITCHGATE_SWITCH_DOWN    847
1515 #define EL_DC_TIMEGATE_SWITCH           848
1516 #define EL_DC_TIMEGATE_SWITCH_ACTIVE    849
1517
1518 #define EL_DC_LANDMINE                  850
1519
1520 #define EL_EXPANDABLE_STEELWALL            851
1521 #define EL_EXPANDABLE_STEELWALL_HORIZONTAL 852
1522 #define EL_EXPANDABLE_STEELWALL_VERTICAL   853
1523 #define EL_EXPANDABLE_STEELWALL_ANY        854
1524
1525 #define EL_EM_EXIT_CLOSED               855
1526 #define EL_EM_EXIT_OPEN                 856
1527 #define EL_EM_STEEL_EXIT_CLOSED         857
1528 #define EL_EM_STEEL_EXIT_OPEN           858
1529
1530 #define EL_DC_GATE_FAKE_GRAY            859
1531
1532 #define EL_DC_MAGIC_WALL                860
1533
1534 #define EL_QUICKSAND_FAST_EMPTY         861
1535 #define EL_QUICKSAND_FAST_FULL          862
1536
1537 #define EL_FROM_LEVEL_TEMPLATE          863
1538
1539 #define EL_MM_START                     864
1540 #define EL_MM_START_1                   EL_MM_START
1541
1542 #define EL_MM_EMPTY_SPACE               (EL_MM_START + 0)
1543 #define EL_MM_EMPTY                     EL_MM_EMPTY_SPACE
1544 #define EL_MM_MIRROR_START              (EL_MM_START + 1)
1545 #define EL_MM_MIRROR_1                  (EL_MM_MIRROR_START + 0)
1546 #define EL_MM_MIRROR_2                  (EL_MM_MIRROR_START + 1)
1547 #define EL_MM_MIRROR_3                  (EL_MM_MIRROR_START + 2)
1548 #define EL_MM_MIRROR_4                  (EL_MM_MIRROR_START + 3)
1549 #define EL_MM_MIRROR_5                  (EL_MM_MIRROR_START + 4)
1550 #define EL_MM_MIRROR_6                  (EL_MM_MIRROR_START + 5)
1551 #define EL_MM_MIRROR_7                  (EL_MM_MIRROR_START + 6)
1552 #define EL_MM_MIRROR_8                  (EL_MM_MIRROR_START + 7)
1553 #define EL_MM_MIRROR_9                  (EL_MM_MIRROR_START + 8)
1554 #define EL_MM_MIRROR_10                 (EL_MM_MIRROR_START + 9)
1555 #define EL_MM_MIRROR_11                 (EL_MM_MIRROR_START + 10)
1556 #define EL_MM_MIRROR_12                 (EL_MM_MIRROR_START + 11)
1557 #define EL_MM_MIRROR_13                 (EL_MM_MIRROR_START + 12)
1558 #define EL_MM_MIRROR_14                 (EL_MM_MIRROR_START + 13)
1559 #define EL_MM_MIRROR_15                 (EL_MM_MIRROR_START + 14)
1560 #define EL_MM_MIRROR_16                 (EL_MM_MIRROR_START + 15)
1561 #define EL_MM_MIRROR_END                EL_MM_MIRROR_15
1562 #define EL_MM_STEEL_GRID_FIXED_START    (EL_MM_START + 17)
1563 #define EL_MM_STEEL_GRID_FIXED_1        (EL_MM_STEEL_GRID_FIXED_START + 0)
1564 #define EL_MM_STEEL_GRID_FIXED_2        (EL_MM_STEEL_GRID_FIXED_START + 1)
1565 #define EL_MM_STEEL_GRID_FIXED_3        (EL_MM_STEEL_GRID_FIXED_START + 2)
1566 #define EL_MM_STEEL_GRID_FIXED_4        (EL_MM_STEEL_GRID_FIXED_START + 3)
1567 #define EL_MM_STEEL_GRID_FIXED_END      EL_MM_STEEL_GRID_FIXED_03
1568 #define EL_MM_MCDUFFIN_START            (EL_MM_START + 21)
1569 #define EL_MM_MCDUFFIN_RIGHT            (EL_MM_MCDUFFIN_START + 0)
1570 #define EL_MM_MCDUFFIN_UP               (EL_MM_MCDUFFIN_START + 1)
1571 #define EL_MM_MCDUFFIN_LEFT             (EL_MM_MCDUFFIN_START + 2)
1572 #define EL_MM_MCDUFFIN_DOWN             (EL_MM_MCDUFFIN_START + 3)
1573 #define EL_MM_MCDUFFIN_END              EL_MM_MCDUFFIN_DOWN
1574 #define EL_MM_EXIT_CLOSED               (EL_MM_START + 25)
1575 #define EL_MM_EXIT_OPENING_1            (EL_MM_START + 26)
1576 #define EL_MM_EXIT_OPENING_2            (EL_MM_START + 27)
1577 #define EL_MM_EXIT_OPEN                 (EL_MM_START + 28)
1578 #define EL_MM_KETTLE                    (EL_MM_START + 29)
1579 #define EL_MM_BOMB                      (EL_MM_START + 30)
1580 #define EL_MM_PRISM                     (EL_MM_START + 31)
1581 #define EL_MM_WALL_START                (EL_MM_START + 32)
1582 #define EL_MM_WALL_EMPTY                EL_MM_WALL_START
1583 #define EL_MM_WALL_00                   EL_MM_WALL_START
1584 #define EL_MM_STEEL_WALL_START          EL_MM_WALL_00
1585 #define EL_MM_STEEL_WALL_1              EL_MM_STEEL_WALL_START
1586 #define EL_MM_WALL_15                   (EL_MM_START + 47)
1587 #define EL_MM_STEEL_WALL_END            EL_MM_WALL_15
1588 #define EL_MM_WALL_16                   (EL_MM_START + 48)
1589 #define EL_MM_WOODEN_WALL_START         EL_MM_WALL_16
1590 #define EL_MM_WOODEN_WALL_1             EL_MM_WOODEN_WALL_START
1591 #define EL_MM_WALL_31                   (EL_MM_START + 63)
1592 #define EL_MM_WOODEN_WALL_END           EL_MM_WALL_31
1593 #define EL_MM_WALL_32                   (EL_MM_START + 64)
1594 #define EL_MM_ICE_WALL_START            EL_MM_WALL_32
1595 #define EL_MM_ICE_WALL_1                EL_MM_ICE_WALL_START
1596 #define EL_MM_WALL_47                   (EL_MM_START + 79)
1597 #define EL_MM_ICE_WALL_END              EL_MM_WALL_47
1598 #define EL_MM_WALL_48                   (EL_MM_START + 80)
1599 #define EL_MM_AMOEBA_WALL_START         EL_MM_WALL_48
1600 #define EL_MM_AMOEBA_WALL_1             EL_MM_AMOEBA_WALL_START
1601 #define EL_MM_WALL_63                   (EL_MM_START + 95)
1602 #define EL_MM_AMOEBA_WALL_END           EL_MM_WALL_63
1603 #define EL_MM_WALL_END                  EL_MM_WALL_63
1604 #define EL_MM_WOODEN_BLOCK              (EL_MM_START + 96)
1605 #define EL_MM_GRAY_BALL                 (EL_MM_START + 97)
1606 #define EL_MM_TELEPORTER_START          (EL_MM_START + 98)
1607 #define EL_MM_TELEPORTER_1              (EL_MM_TELEPORTER_START + 0)
1608 #define EL_MM_TELEPORTER_2              (EL_MM_TELEPORTER_START + 1)
1609 #define EL_MM_TELEPORTER_3              (EL_MM_TELEPORTER_START + 2)
1610 #define EL_MM_TELEPORTER_4              (EL_MM_TELEPORTER_START + 3)
1611 #define EL_MM_TELEPORTER_5              (EL_MM_TELEPORTER_START + 4)
1612 #define EL_MM_TELEPORTER_6              (EL_MM_TELEPORTER_START + 5)
1613 #define EL_MM_TELEPORTER_7              (EL_MM_TELEPORTER_START + 6)
1614 #define EL_MM_TELEPORTER_8              (EL_MM_TELEPORTER_START + 7)
1615 #define EL_MM_TELEPORTER_9              (EL_MM_TELEPORTER_START + 8)
1616 #define EL_MM_TELEPORTER_10             (EL_MM_TELEPORTER_START + 9)
1617 #define EL_MM_TELEPORTER_11             (EL_MM_TELEPORTER_START + 10)
1618 #define EL_MM_TELEPORTER_12             (EL_MM_TELEPORTER_START + 11)
1619 #define EL_MM_TELEPORTER_13             (EL_MM_TELEPORTER_START + 12)
1620 #define EL_MM_TELEPORTER_14             (EL_MM_TELEPORTER_START + 13)
1621 #define EL_MM_TELEPORTER_15             (EL_MM_TELEPORTER_START + 14)
1622 #define EL_MM_TELEPORTER_16             (EL_MM_TELEPORTER_START + 15)
1623 #define EL_MM_TELEPORTER_END            EL_MM_TELEPORTER_15
1624 #define EL_MM_FUSE_ACTIVE               (EL_MM_START + 114)
1625 #define EL_MM_PACMAN_START              (EL_MM_START + 115)
1626 #define EL_MM_PACMAN_RIGHT              (EL_MM_PACMAN_START + 0)
1627 #define EL_MM_PACMAN_UP                 (EL_MM_PACMAN_START + 1)
1628 #define EL_MM_PACMAN_LEFT               (EL_MM_PACMAN_START + 2)
1629 #define EL_MM_PACMAN_DOWN               (EL_MM_PACMAN_START + 3)
1630 #define EL_MM_PACMAN_END                EL_MM_PACMAN_DOWN
1631 #define EL_MM_POLARIZER_START           (EL_MM_START + 119)
1632 #define EL_MM_POLARIZER_1               (EL_MM_POLARIZER_START + 0)
1633 #define EL_MM_POLARIZER_2               (EL_MM_POLARIZER_START + 1)
1634 #define EL_MM_POLARIZER_3               (EL_MM_POLARIZER_START + 2)
1635 #define EL_MM_POLARIZER_4               (EL_MM_POLARIZER_START + 3)
1636 #define EL_MM_POLARIZER_5               (EL_MM_POLARIZER_START + 4)
1637 #define EL_MM_POLARIZER_6               (EL_MM_POLARIZER_START + 5)
1638 #define EL_MM_POLARIZER_7               (EL_MM_POLARIZER_START + 6)
1639 #define EL_MM_POLARIZER_8               (EL_MM_POLARIZER_START + 7)
1640 #define EL_MM_POLARIZER_9               (EL_MM_POLARIZER_START + 8)
1641 #define EL_MM_POLARIZER_10              (EL_MM_POLARIZER_START + 9)
1642 #define EL_MM_POLARIZER_11              (EL_MM_POLARIZER_START + 10)
1643 #define EL_MM_POLARIZER_12              (EL_MM_POLARIZER_START + 11)
1644 #define EL_MM_POLARIZER_13              (EL_MM_POLARIZER_START + 12)
1645 #define EL_MM_POLARIZER_14              (EL_MM_POLARIZER_START + 13)
1646 #define EL_MM_POLARIZER_15              (EL_MM_POLARIZER_START + 14)
1647 #define EL_MM_POLARIZER_16              (EL_MM_POLARIZER_START + 15)
1648 #define EL_MM_POLARIZER_END             EL_MM_POLARIZER_15
1649 #define EL_MM_POLARIZER_CROSS_START     (EL_MM_START + 135)
1650 #define EL_MM_POLARIZER_CROSS_1         (EL_MM_POLARIZER_CROSS_START + 0)
1651 #define EL_MM_POLARIZER_CROSS_2         (EL_MM_POLARIZER_CROSS_START + 1)
1652 #define EL_MM_POLARIZER_CROSS_3         (EL_MM_POLARIZER_CROSS_START + 2)
1653 #define EL_MM_POLARIZER_CROSS_4         (EL_MM_POLARIZER_CROSS_START + 3)
1654 #define EL_MM_POLARIZER_CROSS_END       EL_MM_POLARIZER_CROSS_03
1655 #define EL_MM_MIRROR_FIXED_START        (EL_MM_START + 139)
1656 #define EL_MM_MIRROR_FIXED_1            (EL_MM_MIRROR_FIXED_START + 0)
1657 #define EL_MM_MIRROR_FIXED_2            (EL_MM_MIRROR_FIXED_START + 1)
1658 #define EL_MM_MIRROR_FIXED_3            (EL_MM_MIRROR_FIXED_START + 2)
1659 #define EL_MM_MIRROR_FIXED_4            (EL_MM_MIRROR_FIXED_START + 3)
1660 #define EL_MM_MIRROR_FIXED_END          EL_MM_MIRROR_FIXED_03
1661 #define EL_MM_STEEL_LOCK                (EL_MM_START + 143)
1662 #define EL_MM_KEY                       (EL_MM_START + 144)
1663 #define EL_MM_LIGHTBULB                 (EL_MM_START + 145)
1664 #define EL_MM_LIGHTBULB_ACTIVE          (EL_MM_START + 146)
1665 #define EL_MM_LIGHTBALL                 (EL_MM_START + 147)
1666 #define EL_MM_STEEL_BLOCK               (EL_MM_START + 148)
1667 #define EL_MM_WOODEN_LOCK               (EL_MM_START + 149)
1668 #define EL_MM_FUEL_FULL                 (EL_MM_START + 150)
1669 #define EL_MM_WOODEN_GRID_FIXED_START   (EL_MM_START + 151)
1670 #define EL_MM_WOODEN_GRID_FIXED_1       (EL_MM_WOODEN_GRID_FIXED_START + 0)
1671 #define EL_MM_WOODEN_GRID_FIXED_2       (EL_MM_WOODEN_GRID_FIXED_START + 1)
1672 #define EL_MM_WOODEN_GRID_FIXED_3       (EL_MM_WOODEN_GRID_FIXED_START + 2)
1673 #define EL_MM_WOODEN_GRID_FIXED_4       (EL_MM_WOODEN_GRID_FIXED_START + 3)
1674 #define EL_MM_WOODEN_GRID_FIXED_END     EL_MM_WOODEN_GRID_FIXED_03
1675 #define EL_MM_FUEL_EMPTY                (EL_MM_START + 155)
1676
1677 #define EL_MM_UNUSED_156                (EL_MM_START + 156)
1678 #define EL_MM_UNUSED_157                (EL_MM_START + 157)
1679 #define EL_MM_UNUSED_158                (EL_MM_START + 158)
1680 #define EL_MM_UNUSED_159                (EL_MM_START + 159)
1681
1682 #define EL_MM_END_1                     (EL_MM_START + 159)
1683 #define EL_MM_START_2                   (EL_MM_START + 160)
1684
1685 #define EL_DF_START                     EL_MM_START_2
1686 #define EL_DF_START2                    (EL_DF_START - 240)
1687
1688 #define EL_DF_MIRROR_START              EL_DF_START
1689 #define EL_DF_MIRROR_1                  (EL_DF_MIRROR_START + 0)
1690 #define EL_DF_MIRROR_2                  (EL_DF_MIRROR_START + 1)
1691 #define EL_DF_MIRROR_3                  (EL_DF_MIRROR_START + 2)
1692 #define EL_DF_MIRROR_4                  (EL_DF_MIRROR_START + 3)
1693 #define EL_DF_MIRROR_5                  (EL_DF_MIRROR_START + 4)
1694 #define EL_DF_MIRROR_6                  (EL_DF_MIRROR_START + 5)
1695 #define EL_DF_MIRROR_7                  (EL_DF_MIRROR_START + 6)
1696 #define EL_DF_MIRROR_8                  (EL_DF_MIRROR_START + 7)
1697 #define EL_DF_MIRROR_9                  (EL_DF_MIRROR_START + 8)
1698 #define EL_DF_MIRROR_10                 (EL_DF_MIRROR_START + 9)
1699 #define EL_DF_MIRROR_11                 (EL_DF_MIRROR_START + 10)
1700 #define EL_DF_MIRROR_12                 (EL_DF_MIRROR_START + 11)
1701 #define EL_DF_MIRROR_13                 (EL_DF_MIRROR_START + 12)
1702 #define EL_DF_MIRROR_14                 (EL_DF_MIRROR_START + 13)
1703 #define EL_DF_MIRROR_15                 (EL_DF_MIRROR_START + 14)
1704 #define EL_DF_MIRROR_16                 (EL_DF_MIRROR_START + 15)
1705 #define EL_DF_MIRROR_END                EL_DF_MIRROR_15
1706
1707 #define EL_DF_WOODEN_GRID_FIXED_START   (EL_DF_START2 + 256)
1708 #define EL_DF_WOODEN_GRID_FIXED_1       (EL_DF_WOODEN_GRID_FIXED_START + 0)
1709 #define EL_DF_WOODEN_GRID_FIXED_2       (EL_DF_WOODEN_GRID_FIXED_START + 1)
1710 #define EL_DF_WOODEN_GRID_FIXED_3       (EL_DF_WOODEN_GRID_FIXED_START + 2)
1711 #define EL_DF_WOODEN_GRID_FIXED_4       (EL_DF_WOODEN_GRID_FIXED_START + 3)
1712 #define EL_DF_WOODEN_GRID_FIXED_5       (EL_DF_WOODEN_GRID_FIXED_START + 4)
1713 #define EL_DF_WOODEN_GRID_FIXED_6       (EL_DF_WOODEN_GRID_FIXED_START + 5)
1714 #define EL_DF_WOODEN_GRID_FIXED_7       (EL_DF_WOODEN_GRID_FIXED_START + 6)
1715 #define EL_DF_WOODEN_GRID_FIXED_8       (EL_DF_WOODEN_GRID_FIXED_START + 7)
1716 #define EL_DF_WOODEN_GRID_FIXED_END     EL_DF_WOODEN_GRID_FIXED_07
1717
1718 #define EL_DF_STEEL_GRID_FIXED_START    (EL_DF_START2 + 264)
1719 #define EL_DF_STEEL_GRID_FIXED_1        (EL_DF_STEEL_GRID_FIXED_START + 0)
1720 #define EL_DF_STEEL_GRID_FIXED_2        (EL_DF_STEEL_GRID_FIXED_START + 1)
1721 #define EL_DF_STEEL_GRID_FIXED_3        (EL_DF_STEEL_GRID_FIXED_START + 2)
1722 #define EL_DF_STEEL_GRID_FIXED_4        (EL_DF_STEEL_GRID_FIXED_START + 3)
1723 #define EL_DF_STEEL_GRID_FIXED_5        (EL_DF_STEEL_GRID_FIXED_START + 4)
1724 #define EL_DF_STEEL_GRID_FIXED_6        (EL_DF_STEEL_GRID_FIXED_START + 5)
1725 #define EL_DF_STEEL_GRID_FIXED_7        (EL_DF_STEEL_GRID_FIXED_START + 6)
1726 #define EL_DF_STEEL_GRID_FIXED_8        (EL_DF_STEEL_GRID_FIXED_START + 7)
1727 #define EL_DF_STEEL_GRID_FIXED_END      EL_DF_STEEL_GRID_FIXED_07
1728
1729 #define EL_DF_WOODEN_WALL_START         (EL_DF_START2 + 272)
1730 #define EL_DF_WOODEN_WALL_1             (EL_DF_WOODEN_WALL_START + 0)
1731 #define EL_DF_WOODEN_WALL_END           (EL_DF_WOODEN_WALL_START + 15)
1732
1733 #define EL_DF_STEEL_WALL_START          (EL_DF_START2 + 288)
1734 #define EL_DF_STEEL_WALL_1              (EL_DF_STEEL_WALL_START + 0)
1735 #define EL_DF_STEEL_WALL_END            (EL_DF_STEEL_WALL_START + 15)
1736
1737 #define EL_DF_WALL_START                EL_DF_WOODEN_WALL_START
1738 #define EL_DF_WALL_END                  EL_DF_STEEL_WALL_END
1739
1740 #define EL_DF_EMPTY                     (EL_DF_START2 + 304)
1741 #define EL_DF_CELL                      (EL_DF_START2 + 305)
1742 #define EL_DF_MINE                      (EL_DF_START2 + 306)
1743 #define EL_DF_REFRACTOR                 (EL_DF_START2 + 307)
1744
1745 #define EL_DF_LASER_START               (EL_DF_START2 + 308)
1746 #define EL_DF_LASER_RIGHT               (EL_DF_LASER_START + 0)
1747 #define EL_DF_LASER_UP                  (EL_DF_LASER_START + 1)
1748 #define EL_DF_LASER_LEFT                (EL_DF_LASER_START + 2)
1749 #define EL_DF_LASER_DOWN                (EL_DF_LASER_START + 3)
1750 #define EL_DF_LASER_END                 EL_DF_LASER_DOWN
1751
1752 #define EL_DF_RECEIVER_START            (EL_DF_START2 + 312)
1753 #define EL_DF_RECEIVER_RIGHT            (EL_DF_RECEIVER_START + 0)
1754 #define EL_DF_RECEIVER_UP               (EL_DF_RECEIVER_START + 1)
1755 #define EL_DF_RECEIVER_LEFT             (EL_DF_RECEIVER_START + 2)
1756 #define EL_DF_RECEIVER_DOWN             (EL_DF_RECEIVER_START + 3)
1757 #define EL_DF_RECEIVER_END              EL_DF_RECEIVER_DOWN
1758
1759 #define EL_DF_FIBRE_OPTIC_START         (EL_DF_START2 + 316)
1760 #define EL_DF_FIBRE_OPTIC_RED_1         (EL_DF_FIBRE_OPTIC_START + 0)
1761 #define EL_DF_FIBRE_OPTIC_RED_2         (EL_DF_FIBRE_OPTIC_START + 1)
1762 #define EL_DF_FIBRE_OPTIC_YELLOW_1      (EL_DF_FIBRE_OPTIC_START + 2)
1763 #define EL_DF_FIBRE_OPTIC_YELLOW_2      (EL_DF_FIBRE_OPTIC_START + 3)
1764 #define EL_DF_FIBRE_OPTIC_GREEN_1       (EL_DF_FIBRE_OPTIC_START + 4)
1765 #define EL_DF_FIBRE_OPTIC_GREEN_2       (EL_DF_FIBRE_OPTIC_START + 5)
1766 #define EL_DF_FIBRE_OPTIC_BLUE_1        (EL_DF_FIBRE_OPTIC_START + 6)
1767 #define EL_DF_FIBRE_OPTIC_BLUE_2        (EL_DF_FIBRE_OPTIC_START + 7)
1768 #define EL_DF_FIBRE_OPTIC_END           EL_DF_FIBRE_OPTIC_07
1769
1770 #define EL_DF_MIRROR_ROTATING_START     (EL_DF_START2 + 324)
1771 #define EL_DF_MIRROR_ROTATING_1         (EL_DF_MIRROR_ROTATING_START + 0)
1772 #define EL_DF_MIRROR_ROTATING_2         (EL_DF_MIRROR_ROTATING_START + 1)
1773 #define EL_DF_MIRROR_ROTATING_3         (EL_DF_MIRROR_ROTATING_START + 2)
1774 #define EL_DF_MIRROR_ROTATING_4         (EL_DF_MIRROR_ROTATING_START + 3)
1775 #define EL_DF_MIRROR_ROTATING_5         (EL_DF_MIRROR_ROTATING_START + 4)
1776 #define EL_DF_MIRROR_ROTATING_6         (EL_DF_MIRROR_ROTATING_START + 5)
1777 #define EL_DF_MIRROR_ROTATING_7         (EL_DF_MIRROR_ROTATING_START + 6)
1778 #define EL_DF_MIRROR_ROTATING_8         (EL_DF_MIRROR_ROTATING_START + 7)
1779 #define EL_DF_MIRROR_ROTATING_9         (EL_DF_MIRROR_ROTATING_START + 8)
1780 #define EL_DF_MIRROR_ROTATING_10        (EL_DF_MIRROR_ROTATING_START + 9)
1781 #define EL_DF_MIRROR_ROTATING_11        (EL_DF_MIRROR_ROTATING_START + 10)
1782 #define EL_DF_MIRROR_ROTATING_12        (EL_DF_MIRROR_ROTATING_START + 11)
1783 #define EL_DF_MIRROR_ROTATING_13        (EL_DF_MIRROR_ROTATING_START + 12)
1784 #define EL_DF_MIRROR_ROTATING_14        (EL_DF_MIRROR_ROTATING_START + 13)
1785 #define EL_DF_MIRROR_ROTATING_15        (EL_DF_MIRROR_ROTATING_START + 14)
1786 #define EL_DF_MIRROR_ROTATING_16        (EL_DF_MIRROR_ROTATING_START + 15)
1787 #define EL_DF_MIRROR_ROTATING_END       EL_DF_MIRROR_ROTATING_15
1788
1789 #define EL_DF_WOODEN_GRID_ROTATING_START (EL_DF_START2 + 340)
1790 #define EL_DF_WOODEN_GRID_ROTATING_1    (EL_DF_WOODEN_GRID_ROTATING_START + 0)
1791 #define EL_DF_WOODEN_GRID_ROTATING_2    (EL_DF_WOODEN_GRID_ROTATING_START + 1)
1792 #define EL_DF_WOODEN_GRID_ROTATING_3    (EL_DF_WOODEN_GRID_ROTATING_START + 2)
1793 #define EL_DF_WOODEN_GRID_ROTATING_4    (EL_DF_WOODEN_GRID_ROTATING_START + 3)
1794 #define EL_DF_WOODEN_GRID_ROTATING_5    (EL_DF_WOODEN_GRID_ROTATING_START + 4)
1795 #define EL_DF_WOODEN_GRID_ROTATING_6    (EL_DF_WOODEN_GRID_ROTATING_START + 5)
1796 #define EL_DF_WOODEN_GRID_ROTATING_7    (EL_DF_WOODEN_GRID_ROTATING_START + 6)
1797 #define EL_DF_WOODEN_GRID_ROTATING_8    (EL_DF_WOODEN_GRID_ROTATING_START + 7)
1798 #define EL_DF_WOODEN_GRID_ROTATING_END  EL_DF_WOODEN_GRID_ROTATING_07
1799
1800 #define EL_DF_STEEL_GRID_ROTATING_START (EL_DF_START2 + 348)
1801 #define EL_DF_STEEL_GRID_ROTATING_1     (EL_DF_STEEL_GRID_ROTATING_START + 0)
1802 #define EL_DF_STEEL_GRID_ROTATING_2     (EL_DF_STEEL_GRID_ROTATING_START + 1)
1803 #define EL_DF_STEEL_GRID_ROTATING_3     (EL_DF_STEEL_GRID_ROTATING_START + 2)
1804 #define EL_DF_STEEL_GRID_ROTATING_4     (EL_DF_STEEL_GRID_ROTATING_START + 3)
1805 #define EL_DF_STEEL_GRID_ROTATING_5     (EL_DF_STEEL_GRID_ROTATING_START + 4)
1806 #define EL_DF_STEEL_GRID_ROTATING_6     (EL_DF_STEEL_GRID_ROTATING_START + 5)
1807 #define EL_DF_STEEL_GRID_ROTATING_7     (EL_DF_STEEL_GRID_ROTATING_START + 6)
1808 #define EL_DF_STEEL_GRID_ROTATING_8     (EL_DF_STEEL_GRID_ROTATING_START + 7)
1809 #define EL_DF_STEEL_GRID_ROTATING_END   EL_DF_STEEL_GRID_ROTATING_07
1810
1811 #define EL_DF_END                       (EL_DF_START2 + 355)
1812
1813 #define EL_MM_TELEPORTER_RED_START      (EL_DF_START2 + 356)
1814 #define EL_MM_TELEPORTER_RED_1          (EL_MM_TELEPORTER_RED_START + 0)
1815 #define EL_MM_TELEPORTER_RED_2          (EL_MM_TELEPORTER_RED_START + 1)
1816 #define EL_MM_TELEPORTER_RED_3          (EL_MM_TELEPORTER_RED_START + 2)
1817 #define EL_MM_TELEPORTER_RED_4          (EL_MM_TELEPORTER_RED_START + 3)
1818 #define EL_MM_TELEPORTER_RED_5          (EL_MM_TELEPORTER_RED_START + 4)
1819 #define EL_MM_TELEPORTER_RED_6          (EL_MM_TELEPORTER_RED_START + 5)
1820 #define EL_MM_TELEPORTER_RED_7          (EL_MM_TELEPORTER_RED_START + 6)
1821 #define EL_MM_TELEPORTER_RED_8          (EL_MM_TELEPORTER_RED_START + 7)
1822 #define EL_MM_TELEPORTER_RED_9          (EL_MM_TELEPORTER_RED_START + 8)
1823 #define EL_MM_TELEPORTER_RED_10         (EL_MM_TELEPORTER_RED_START + 9)
1824 #define EL_MM_TELEPORTER_RED_11         (EL_MM_TELEPORTER_RED_START + 10)
1825 #define EL_MM_TELEPORTER_RED_12         (EL_MM_TELEPORTER_RED_START + 11)
1826 #define EL_MM_TELEPORTER_RED_13         (EL_MM_TELEPORTER_RED_START + 12)
1827 #define EL_MM_TELEPORTER_RED_14         (EL_MM_TELEPORTER_RED_START + 13)
1828 #define EL_MM_TELEPORTER_RED_15         (EL_MM_TELEPORTER_RED_START + 14)
1829 #define EL_MM_TELEPORTER_RED_16         (EL_MM_TELEPORTER_RED_START + 15)
1830 #define EL_MM_TELEPORTER_RED_END        EL_MM_TELEPORTER_RED_16
1831 #define EL_MM_TELEPORTER_YELLOW_START   (EL_DF_START2 + 372)
1832 #define EL_MM_TELEPORTER_YELLOW_1       (EL_MM_TELEPORTER_YELLOW_START + 0)
1833 #define EL_MM_TELEPORTER_YELLOW_2       (EL_MM_TELEPORTER_YELLOW_START + 1)
1834 #define EL_MM_TELEPORTER_YELLOW_3       (EL_MM_TELEPORTER_YELLOW_START + 2)
1835 #define EL_MM_TELEPORTER_YELLOW_4       (EL_MM_TELEPORTER_YELLOW_START + 3)
1836 #define EL_MM_TELEPORTER_YELLOW_5       (EL_MM_TELEPORTER_YELLOW_START + 4)
1837 #define EL_MM_TELEPORTER_YELLOW_6       (EL_MM_TELEPORTER_YELLOW_START + 5)
1838 #define EL_MM_TELEPORTER_YELLOW_7       (EL_MM_TELEPORTER_YELLOW_START + 6)
1839 #define EL_MM_TELEPORTER_YELLOW_8       (EL_MM_TELEPORTER_YELLOW_START + 7)
1840 #define EL_MM_TELEPORTER_YELLOW_9       (EL_MM_TELEPORTER_YELLOW_START + 8)
1841 #define EL_MM_TELEPORTER_YELLOW_10      (EL_MM_TELEPORTER_YELLOW_START + 9)
1842 #define EL_MM_TELEPORTER_YELLOW_11      (EL_MM_TELEPORTER_YELLOW_START + 10)
1843 #define EL_MM_TELEPORTER_YELLOW_12      (EL_MM_TELEPORTER_YELLOW_START + 11)
1844 #define EL_MM_TELEPORTER_YELLOW_13      (EL_MM_TELEPORTER_YELLOW_START + 12)
1845 #define EL_MM_TELEPORTER_YELLOW_14      (EL_MM_TELEPORTER_YELLOW_START + 13)
1846 #define EL_MM_TELEPORTER_YELLOW_15      (EL_MM_TELEPORTER_YELLOW_START + 14)
1847 #define EL_MM_TELEPORTER_YELLOW_16      (EL_MM_TELEPORTER_YELLOW_START + 15)
1848 #define EL_MM_TELEPORTER_YELLOW_END     EL_MM_TELEPORTER_YELLOW_16
1849 #define EL_MM_TELEPORTER_GREEN_START    (EL_DF_START2 + 388)
1850 #define EL_MM_TELEPORTER_GREEN_1        (EL_MM_TELEPORTER_GREEN_START + 0)
1851 #define EL_MM_TELEPORTER_GREEN_2        (EL_MM_TELEPORTER_GREEN_START + 1)
1852 #define EL_MM_TELEPORTER_GREEN_3        (EL_MM_TELEPORTER_GREEN_START + 2)
1853 #define EL_MM_TELEPORTER_GREEN_4        (EL_MM_TELEPORTER_GREEN_START + 3)
1854 #define EL_MM_TELEPORTER_GREEN_5        (EL_MM_TELEPORTER_GREEN_START + 4)
1855 #define EL_MM_TELEPORTER_GREEN_6        (EL_MM_TELEPORTER_GREEN_START + 5)
1856 #define EL_MM_TELEPORTER_GREEN_7        (EL_MM_TELEPORTER_GREEN_START + 6)
1857 #define EL_MM_TELEPORTER_GREEN_8        (EL_MM_TELEPORTER_GREEN_START + 7)
1858 #define EL_MM_TELEPORTER_GREEN_9        (EL_MM_TELEPORTER_GREEN_START + 8)
1859 #define EL_MM_TELEPORTER_GREEN_10       (EL_MM_TELEPORTER_GREEN_START + 9)
1860 #define EL_MM_TELEPORTER_GREEN_11       (EL_MM_TELEPORTER_GREEN_START + 10)
1861 #define EL_MM_TELEPORTER_GREEN_12       (EL_MM_TELEPORTER_GREEN_START + 11)
1862 #define EL_MM_TELEPORTER_GREEN_13       (EL_MM_TELEPORTER_GREEN_START + 12)
1863 #define EL_MM_TELEPORTER_GREEN_14       (EL_MM_TELEPORTER_GREEN_START + 13)
1864 #define EL_MM_TELEPORTER_GREEN_15       (EL_MM_TELEPORTER_GREEN_START + 14)
1865 #define EL_MM_TELEPORTER_GREEN_16       (EL_MM_TELEPORTER_GREEN_START + 15)
1866 #define EL_MM_TELEPORTER_GREEN_END      EL_MM_TELEPORTER_GREEN_16
1867 #define EL_MM_TELEPORTER_BLUE_START     (EL_DF_START2 + 404)
1868 #define EL_MM_TELEPORTER_BLUE_1         (EL_MM_TELEPORTER_BLUE_START + 0)
1869 #define EL_MM_TELEPORTER_BLUE_2         (EL_MM_TELEPORTER_BLUE_START + 1)
1870 #define EL_MM_TELEPORTER_BLUE_3         (EL_MM_TELEPORTER_BLUE_START + 2)
1871 #define EL_MM_TELEPORTER_BLUE_4         (EL_MM_TELEPORTER_BLUE_START + 3)
1872 #define EL_MM_TELEPORTER_BLUE_5         (EL_MM_TELEPORTER_BLUE_START + 4)
1873 #define EL_MM_TELEPORTER_BLUE_6         (EL_MM_TELEPORTER_BLUE_START + 5)
1874 #define EL_MM_TELEPORTER_BLUE_7         (EL_MM_TELEPORTER_BLUE_START + 6)
1875 #define EL_MM_TELEPORTER_BLUE_8         (EL_MM_TELEPORTER_BLUE_START + 7)
1876 #define EL_MM_TELEPORTER_BLUE_9         (EL_MM_TELEPORTER_BLUE_START + 8)
1877 #define EL_MM_TELEPORTER_BLUE_10        (EL_MM_TELEPORTER_BLUE_START + 9)
1878 #define EL_MM_TELEPORTER_BLUE_11        (EL_MM_TELEPORTER_BLUE_START + 10)
1879 #define EL_MM_TELEPORTER_BLUE_12        (EL_MM_TELEPORTER_BLUE_START + 11)
1880 #define EL_MM_TELEPORTER_BLUE_13        (EL_MM_TELEPORTER_BLUE_START + 12)
1881 #define EL_MM_TELEPORTER_BLUE_14        (EL_MM_TELEPORTER_BLUE_START + 13)
1882 #define EL_MM_TELEPORTER_BLUE_15        (EL_MM_TELEPORTER_BLUE_START + 14)
1883 #define EL_MM_TELEPORTER_BLUE_16        (EL_MM_TELEPORTER_BLUE_START + 15)
1884 #define EL_MM_TELEPORTER_BLUE_END       EL_MM_TELEPORTER_BLUE_16
1885
1886 #define EL_MM_MCDUFFIN                  1204
1887 #define EL_MM_PACMAN                    1205
1888 #define EL_MM_FUSE                      1206
1889 #define EL_MM_STEEL_WALL                1207
1890 #define EL_MM_WOODEN_WALL               1208
1891 #define EL_MM_ICE_WALL                  1209
1892 #define EL_MM_AMOEBA_WALL               1210
1893 #define EL_DF_LASER                     1211
1894 #define EL_DF_RECEIVER                  1212
1895 #define EL_DF_STEEL_WALL                1213
1896 #define EL_DF_WOODEN_WALL               1214
1897
1898 #define EL_MM_END_2                     (EL_DF_START2 + 430)
1899 #define EL_MM_END                       EL_MM_END_2
1900
1901 #define EL_SPRING_LEFT                  1215
1902 #define EL_SPRING_RIGHT                 1216
1903
1904 #define NUM_FILE_ELEMENTS               1217
1905
1906
1907 // "real" (and therefore drawable) runtime elements
1908 #define EL_FIRST_RUNTIME_REAL           NUM_FILE_ELEMENTS
1909
1910 #define EL_DYNABOMB_PLAYER_1_ACTIVE     (EL_FIRST_RUNTIME_REAL + 0)
1911 #define EL_DYNABOMB_PLAYER_2_ACTIVE     (EL_FIRST_RUNTIME_REAL + 1)
1912 #define EL_DYNABOMB_PLAYER_3_ACTIVE     (EL_FIRST_RUNTIME_REAL + 2)
1913 #define EL_DYNABOMB_PLAYER_4_ACTIVE     (EL_FIRST_RUNTIME_REAL + 3)
1914 #define EL_SP_DISK_RED_ACTIVE           (EL_FIRST_RUNTIME_REAL + 4)
1915 #define EL_SWITCHGATE_OPENING           (EL_FIRST_RUNTIME_REAL + 5)
1916 #define EL_SWITCHGATE_CLOSING           (EL_FIRST_RUNTIME_REAL + 6)
1917 #define EL_TIMEGATE_OPENING             (EL_FIRST_RUNTIME_REAL + 7)
1918 #define EL_TIMEGATE_CLOSING             (EL_FIRST_RUNTIME_REAL + 8)
1919 #define EL_PEARL_BREAKING               (EL_FIRST_RUNTIME_REAL + 9)
1920 #define EL_TRAP_ACTIVE                  (EL_FIRST_RUNTIME_REAL + 10)
1921 #define EL_INVISIBLE_STEELWALL_ACTIVE   (EL_FIRST_RUNTIME_REAL + 11)
1922 #define EL_INVISIBLE_WALL_ACTIVE        (EL_FIRST_RUNTIME_REAL + 12)
1923 #define EL_INVISIBLE_SAND_ACTIVE        (EL_FIRST_RUNTIME_REAL + 13)
1924 #define EL_CONVEYOR_BELT_1_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 14)
1925 #define EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 15)
1926 #define EL_CONVEYOR_BELT_1_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 16)
1927 #define EL_CONVEYOR_BELT_2_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 17)
1928 #define EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 18)
1929 #define EL_CONVEYOR_BELT_2_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 19)
1930 #define EL_CONVEYOR_BELT_3_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 20)
1931 #define EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 21)
1932 #define EL_CONVEYOR_BELT_3_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 22)
1933 #define EL_CONVEYOR_BELT_4_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 23)
1934 #define EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 24)
1935 #define EL_CONVEYOR_BELT_4_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 25)
1936 #define EL_EXIT_OPENING                 (EL_FIRST_RUNTIME_REAL + 26)
1937 #define EL_EXIT_CLOSING                 (EL_FIRST_RUNTIME_REAL + 27)
1938 #define EL_STEEL_EXIT_OPENING           (EL_FIRST_RUNTIME_REAL + 28)
1939 #define EL_STEEL_EXIT_CLOSING           (EL_FIRST_RUNTIME_REAL + 29)
1940 #define EL_EM_EXIT_OPENING              (EL_FIRST_RUNTIME_REAL + 30)
1941 #define EL_EM_EXIT_CLOSING              (EL_FIRST_RUNTIME_REAL + 31)
1942 #define EL_EM_STEEL_EXIT_OPENING        (EL_FIRST_RUNTIME_REAL + 32)
1943 #define EL_EM_STEEL_EXIT_CLOSING        (EL_FIRST_RUNTIME_REAL + 33)
1944 #define EL_SP_EXIT_OPENING              (EL_FIRST_RUNTIME_REAL + 34)
1945 #define EL_SP_EXIT_CLOSING              (EL_FIRST_RUNTIME_REAL + 35)
1946 #define EL_SP_EXIT_OPEN                 (EL_FIRST_RUNTIME_REAL + 36)
1947 #define EL_SP_TERMINAL_ACTIVE           (EL_FIRST_RUNTIME_REAL + 37)
1948 #define EL_SP_BUGGY_BASE_ACTIVATING     (EL_FIRST_RUNTIME_REAL + 38)
1949 #define EL_SP_BUGGY_BASE_ACTIVE         (EL_FIRST_RUNTIME_REAL + 39)
1950 #define EL_SP_MURPHY_CLONE              (EL_FIRST_RUNTIME_REAL + 40)
1951 #define EL_AMOEBA_DROPPING              (EL_FIRST_RUNTIME_REAL + 41)
1952 #define EL_QUICKSAND_EMPTYING           (EL_FIRST_RUNTIME_REAL + 42)
1953 #define EL_QUICKSAND_FAST_EMPTYING      (EL_FIRST_RUNTIME_REAL + 43)
1954 #define EL_MAGIC_WALL_ACTIVE            (EL_FIRST_RUNTIME_REAL + 44)
1955 #define EL_BD_MAGIC_WALL_ACTIVE         (EL_FIRST_RUNTIME_REAL + 45)
1956 #define EL_DC_MAGIC_WALL_ACTIVE         (EL_FIRST_RUNTIME_REAL + 46)
1957 #define EL_MAGIC_WALL_FULL              (EL_FIRST_RUNTIME_REAL + 47)
1958 #define EL_BD_MAGIC_WALL_FULL           (EL_FIRST_RUNTIME_REAL + 48)
1959 #define EL_DC_MAGIC_WALL_FULL           (EL_FIRST_RUNTIME_REAL + 49)
1960 #define EL_MAGIC_WALL_EMPTYING          (EL_FIRST_RUNTIME_REAL + 50)
1961 #define EL_BD_MAGIC_WALL_EMPTYING       (EL_FIRST_RUNTIME_REAL + 51)
1962 #define EL_DC_MAGIC_WALL_EMPTYING       (EL_FIRST_RUNTIME_REAL + 52)
1963 #define EL_MAGIC_WALL_DEAD              (EL_FIRST_RUNTIME_REAL + 53)
1964 #define EL_BD_MAGIC_WALL_DEAD           (EL_FIRST_RUNTIME_REAL + 54)
1965 #define EL_DC_MAGIC_WALL_DEAD           (EL_FIRST_RUNTIME_REAL + 55)
1966 #define EL_EMC_FAKE_GRASS_ACTIVE        (EL_FIRST_RUNTIME_REAL + 56)
1967 #define EL_GATE_1_GRAY_ACTIVE           (EL_FIRST_RUNTIME_REAL + 57)
1968 #define EL_GATE_2_GRAY_ACTIVE           (EL_FIRST_RUNTIME_REAL + 58)
1969 #define EL_GATE_3_GRAY_ACTIVE           (EL_FIRST_RUNTIME_REAL + 59)
1970 #define EL_GATE_4_GRAY_ACTIVE           (EL_FIRST_RUNTIME_REAL + 60)
1971 #define EL_EM_GATE_1_GRAY_ACTIVE        (EL_FIRST_RUNTIME_REAL + 61)
1972 #define EL_EM_GATE_2_GRAY_ACTIVE        (EL_FIRST_RUNTIME_REAL + 62)
1973 #define EL_EM_GATE_3_GRAY_ACTIVE        (EL_FIRST_RUNTIME_REAL + 63)
1974 #define EL_EM_GATE_4_GRAY_ACTIVE        (EL_FIRST_RUNTIME_REAL + 64)
1975 #define EL_EMC_GATE_5_GRAY_ACTIVE       (EL_FIRST_RUNTIME_REAL + 65)
1976 #define EL_EMC_GATE_6_GRAY_ACTIVE       (EL_FIRST_RUNTIME_REAL + 66)
1977 #define EL_EMC_GATE_7_GRAY_ACTIVE       (EL_FIRST_RUNTIME_REAL + 67)
1978 #define EL_EMC_GATE_8_GRAY_ACTIVE       (EL_FIRST_RUNTIME_REAL + 68)
1979 #define EL_DC_GATE_WHITE_GRAY_ACTIVE    (EL_FIRST_RUNTIME_REAL + 69)
1980 #define EL_EMC_DRIPPER_ACTIVE           (EL_FIRST_RUNTIME_REAL + 70)
1981 #define EL_EMC_SPRING_BUMPER_ACTIVE     (EL_FIRST_RUNTIME_REAL + 71)
1982 #define EL_MM_EXIT_OPENING              (EL_FIRST_RUNTIME_REAL + 72)
1983 #define EL_MM_EXIT_CLOSING              (EL_FIRST_RUNTIME_REAL + 73)
1984 #define EL_MM_GRAY_BALL_OPENING         (EL_FIRST_RUNTIME_REAL + 74)
1985 #define EL_MM_ICE_WALL_SHRINKING        (EL_FIRST_RUNTIME_REAL + 75)
1986 #define EL_MM_AMOEBA_WALL_GROWING       (EL_FIRST_RUNTIME_REAL + 76)
1987 #define EL_MM_PACMAN_EATING_RIGHT       (EL_FIRST_RUNTIME_REAL + 77)
1988 #define EL_MM_PACMAN_EATING_UP          (EL_FIRST_RUNTIME_REAL + 78)
1989 #define EL_MM_PACMAN_EATING_LEFT        (EL_FIRST_RUNTIME_REAL + 79)
1990 #define EL_MM_PACMAN_EATING_DOWN        (EL_FIRST_RUNTIME_REAL + 80)
1991
1992 #define NUM_DRAWABLE_ELEMENTS           (EL_FIRST_RUNTIME_REAL + 81)
1993
1994 #define EL_MM_RUNTIME_START             EL_MM_EXIT_OPENING
1995 #define EL_MM_RUNTIME_END               EL_MM_AMOEBA_WALL_GROWING
1996
1997 // "unreal" (and therefore not drawable) runtime elements
1998 #define EL_FIRST_RUNTIME_UNREAL         (NUM_DRAWABLE_ELEMENTS)
1999
2000 #define EL_BLOCKED                      (EL_FIRST_RUNTIME_UNREAL + 0)
2001 #define EL_EXPLOSION                    (EL_FIRST_RUNTIME_UNREAL + 1)
2002 #define EL_NUT_BREAKING                 (EL_FIRST_RUNTIME_UNREAL + 2)
2003 #define EL_DIAMOND_BREAKING             (EL_FIRST_RUNTIME_UNREAL + 3)
2004 #define EL_ACID_SPLASH_LEFT             (EL_FIRST_RUNTIME_UNREAL + 4)
2005 #define EL_ACID_SPLASH_RIGHT            (EL_FIRST_RUNTIME_UNREAL + 5)
2006 #define EL_AMOEBA_GROWING               (EL_FIRST_RUNTIME_UNREAL + 6)
2007 #define EL_AMOEBA_SHRINKING             (EL_FIRST_RUNTIME_UNREAL + 7)
2008 #define EL_EXPANDABLE_WALL_GROWING      (EL_FIRST_RUNTIME_UNREAL + 8)
2009 #define EL_EXPANDABLE_STEELWALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 9)
2010 #define EL_FLAMES                       (EL_FIRST_RUNTIME_UNREAL + 10)
2011 #define EL_PLAYER_IS_LEAVING            (EL_FIRST_RUNTIME_UNREAL + 11)
2012 #define EL_PLAYER_IS_EXPLODING_1        (EL_FIRST_RUNTIME_UNREAL + 12)
2013 #define EL_PLAYER_IS_EXPLODING_2        (EL_FIRST_RUNTIME_UNREAL + 13)
2014 #define EL_PLAYER_IS_EXPLODING_3        (EL_FIRST_RUNTIME_UNREAL + 14)
2015 #define EL_PLAYER_IS_EXPLODING_4        (EL_FIRST_RUNTIME_UNREAL + 15)
2016 #define EL_QUICKSAND_FILLING            (EL_FIRST_RUNTIME_UNREAL + 16)
2017 #define EL_QUICKSAND_FAST_FILLING       (EL_FIRST_RUNTIME_UNREAL + 17)
2018 #define EL_MAGIC_WALL_FILLING           (EL_FIRST_RUNTIME_UNREAL + 18)
2019 #define EL_BD_MAGIC_WALL_FILLING        (EL_FIRST_RUNTIME_UNREAL + 19)
2020 #define EL_DC_MAGIC_WALL_FILLING        (EL_FIRST_RUNTIME_UNREAL + 20)
2021 #define EL_ELEMENT_SNAPPING             (EL_FIRST_RUNTIME_UNREAL + 21)
2022 #define EL_DIAGONAL_SHRINKING           (EL_FIRST_RUNTIME_UNREAL + 22)
2023 #define EL_DIAGONAL_GROWING             (EL_FIRST_RUNTIME_UNREAL + 23)
2024
2025 #define NUM_RUNTIME_ELEMENTS            (EL_FIRST_RUNTIME_UNREAL + 24)
2026
2027 // dummy elements (never used as game elements, only used as graphics)
2028 #define EL_FIRST_DUMMY                  NUM_RUNTIME_ELEMENTS
2029
2030 #define EL_STEELWALL_TOPLEFT            (EL_FIRST_DUMMY + 0)
2031 #define EL_STEELWALL_TOPRIGHT           (EL_FIRST_DUMMY + 1)
2032 #define EL_STEELWALL_BOTTOMLEFT         (EL_FIRST_DUMMY + 2)
2033 #define EL_STEELWALL_BOTTOMRIGHT        (EL_FIRST_DUMMY + 3)
2034 #define EL_STEELWALL_HORIZONTAL         (EL_FIRST_DUMMY + 4)
2035 #define EL_STEELWALL_VERTICAL           (EL_FIRST_DUMMY + 5)
2036 #define EL_INVISIBLE_STEELWALL_TOPLEFT     (EL_FIRST_DUMMY + 6)
2037 #define EL_INVISIBLE_STEELWALL_TOPRIGHT    (EL_FIRST_DUMMY + 7)
2038 #define EL_INVISIBLE_STEELWALL_BOTTOMLEFT  (EL_FIRST_DUMMY + 8)
2039 #define EL_INVISIBLE_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 9)
2040 #define EL_INVISIBLE_STEELWALL_HORIZONTAL  (EL_FIRST_DUMMY + 10)
2041 #define EL_INVISIBLE_STEELWALL_VERTICAL    (EL_FIRST_DUMMY + 11)
2042 #define EL_DYNABOMB                     (EL_FIRST_DUMMY + 12)
2043 #define EL_DYNABOMB_ACTIVE              (EL_FIRST_DUMMY + 13)
2044 #define EL_DYNABOMB_PLAYER_1            (EL_FIRST_DUMMY + 14)
2045 #define EL_DYNABOMB_PLAYER_2            (EL_FIRST_DUMMY + 15)
2046 #define EL_DYNABOMB_PLAYER_3            (EL_FIRST_DUMMY + 16)
2047 #define EL_DYNABOMB_PLAYER_4            (EL_FIRST_DUMMY + 17)
2048 #define EL_SHIELD_NORMAL_ACTIVE         (EL_FIRST_DUMMY + 18)
2049 #define EL_SHIELD_DEADLY_ACTIVE         (EL_FIRST_DUMMY + 19)
2050 #define EL_AMOEBA                       (EL_FIRST_DUMMY + 20)
2051 #define EL_MM_LIGHTBALL_RED             (EL_FIRST_DUMMY + 21)
2052 #define EL_MM_LIGHTBALL_BLUE            (EL_FIRST_DUMMY + 22)
2053 #define EL_MM_LIGHTBALL_YELLOW          (EL_FIRST_DUMMY + 23)
2054 #define EL_MM_MASK_MCDUFFIN_RIGHT       (EL_FIRST_DUMMY + 24)
2055 #define EL_MM_MASK_MCDUFFIN_UP          (EL_FIRST_DUMMY + 25)
2056 #define EL_MM_MASK_MCDUFFIN_LEFT        (EL_FIRST_DUMMY + 26)
2057 #define EL_MM_MASK_MCDUFFIN_DOWN        (EL_FIRST_DUMMY + 27)
2058 #define EL_MM_MASK_GRID_1               (EL_FIRST_DUMMY + 28)
2059 #define EL_MM_MASK_GRID_2               (EL_FIRST_DUMMY + 29)
2060 #define EL_MM_MASK_GRID_3               (EL_FIRST_DUMMY + 30)
2061 #define EL_MM_MASK_GRID_4               (EL_FIRST_DUMMY + 31)
2062 #define EL_MM_MASK_RECTANGLE            (EL_FIRST_DUMMY + 32)
2063 #define EL_MM_MASK_CIRCLE               (EL_FIRST_DUMMY + 33)
2064 #define EL_DEFAULT                      (EL_FIRST_DUMMY + 34)
2065 #define EL_BD_DEFAULT                   (EL_FIRST_DUMMY + 35)
2066 #define EL_SP_DEFAULT                   (EL_FIRST_DUMMY + 36)
2067 #define EL_SB_DEFAULT                   (EL_FIRST_DUMMY + 37)
2068 #define EL_MM_DEFAULT                   (EL_FIRST_DUMMY + 38)
2069 #define EL_GRAPHIC_1                    (EL_FIRST_DUMMY + 39)
2070 #define EL_GRAPHIC_2                    (EL_FIRST_DUMMY + 40)
2071 #define EL_GRAPHIC_3                    (EL_FIRST_DUMMY + 41)
2072 #define EL_GRAPHIC_4                    (EL_FIRST_DUMMY + 42)
2073 #define EL_GRAPHIC_5                    (EL_FIRST_DUMMY + 43)
2074 #define EL_GRAPHIC_6                    (EL_FIRST_DUMMY + 44)
2075 #define EL_GRAPHIC_7                    (EL_FIRST_DUMMY + 45)
2076 #define EL_GRAPHIC_8                    (EL_FIRST_DUMMY + 46)
2077
2078 #define EL_MM_DUMMY_START               EL_MM_MASK_MCDUFFIN_RIGHT
2079 #define EL_MM_DUMMY_END                 EL_MM_MASK_CIRCLE
2080
2081 // internal elements (only used for internal purposes like copying)
2082 #define EL_FIRST_INTERNAL               (EL_FIRST_DUMMY + 47)
2083
2084 #define EL_INTERNAL_CLIPBOARD_CUSTOM    (EL_FIRST_INTERNAL + 0)
2085 #define EL_INTERNAL_CLIPBOARD_CHANGE    (EL_FIRST_INTERNAL + 1)
2086 #define EL_INTERNAL_CLIPBOARD_GROUP     (EL_FIRST_INTERNAL + 2)
2087 #define EL_INTERNAL_DUMMY               (EL_FIRST_INTERNAL + 3)
2088
2089 #define EL_INTERNAL_CASCADE_BD                  (EL_FIRST_INTERNAL + 4)
2090 #define EL_INTERNAL_CASCADE_BD_ACTIVE           (EL_FIRST_INTERNAL + 5)
2091 #define EL_INTERNAL_CASCADE_EM                  (EL_FIRST_INTERNAL + 6)
2092 #define EL_INTERNAL_CASCADE_EM_ACTIVE           (EL_FIRST_INTERNAL + 7)
2093 #define EL_INTERNAL_CASCADE_EMC                 (EL_FIRST_INTERNAL + 8)
2094 #define EL_INTERNAL_CASCADE_EMC_ACTIVE          (EL_FIRST_INTERNAL + 9)
2095 #define EL_INTERNAL_CASCADE_RND                 (EL_FIRST_INTERNAL + 10)
2096 #define EL_INTERNAL_CASCADE_RND_ACTIVE          (EL_FIRST_INTERNAL + 11)
2097 #define EL_INTERNAL_CASCADE_SB                  (EL_FIRST_INTERNAL + 12)
2098 #define EL_INTERNAL_CASCADE_SB_ACTIVE           (EL_FIRST_INTERNAL + 13)
2099 #define EL_INTERNAL_CASCADE_SP                  (EL_FIRST_INTERNAL + 14)
2100 #define EL_INTERNAL_CASCADE_SP_ACTIVE           (EL_FIRST_INTERNAL + 15)
2101 #define EL_INTERNAL_CASCADE_DC                  (EL_FIRST_INTERNAL + 16)
2102 #define EL_INTERNAL_CASCADE_DC_ACTIVE           (EL_FIRST_INTERNAL + 17)
2103 #define EL_INTERNAL_CASCADE_DX                  (EL_FIRST_INTERNAL + 18)
2104 #define EL_INTERNAL_CASCADE_DX_ACTIVE           (EL_FIRST_INTERNAL + 19)
2105 #define EL_INTERNAL_CASCADE_MM                  (EL_FIRST_INTERNAL + 20)
2106 #define EL_INTERNAL_CASCADE_MM_ACTIVE           (EL_FIRST_INTERNAL + 21)
2107 #define EL_INTERNAL_CASCADE_DF                  (EL_FIRST_INTERNAL + 22)
2108 #define EL_INTERNAL_CASCADE_DF_ACTIVE           (EL_FIRST_INTERNAL + 23)
2109 #define EL_INTERNAL_CASCADE_CHARS               (EL_FIRST_INTERNAL + 24)
2110 #define EL_INTERNAL_CASCADE_CHARS_ACTIVE        (EL_FIRST_INTERNAL + 25)
2111 #define EL_INTERNAL_CASCADE_STEEL_CHARS         (EL_FIRST_INTERNAL + 26)
2112 #define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE  (EL_FIRST_INTERNAL + 27)
2113 #define EL_INTERNAL_CASCADE_CE                  (EL_FIRST_INTERNAL + 28)
2114 #define EL_INTERNAL_CASCADE_CE_ACTIVE           (EL_FIRST_INTERNAL + 29)
2115 #define EL_INTERNAL_CASCADE_GE                  (EL_FIRST_INTERNAL + 30)
2116 #define EL_INTERNAL_CASCADE_GE_ACTIVE           (EL_FIRST_INTERNAL + 31)
2117 #define EL_INTERNAL_CASCADE_REF                 (EL_FIRST_INTERNAL + 32)
2118 #define EL_INTERNAL_CASCADE_REF_ACTIVE          (EL_FIRST_INTERNAL + 33)
2119 #define EL_INTERNAL_CASCADE_USER                (EL_FIRST_INTERNAL + 34)
2120 #define EL_INTERNAL_CASCADE_USER_ACTIVE         (EL_FIRST_INTERNAL + 35)
2121 #define EL_INTERNAL_CASCADE_DYNAMIC             (EL_FIRST_INTERNAL + 36)
2122 #define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE      (EL_FIRST_INTERNAL + 37)
2123
2124 #define EL_INTERNAL_CLIPBOARD_START     (EL_FIRST_INTERNAL + 0)
2125 #define EL_INTERNAL_CLIPBOARD_END       (EL_FIRST_INTERNAL + 2)
2126 #define EL_INTERNAL_START               (EL_FIRST_INTERNAL + 0)
2127 #define EL_INTERNAL_END                 (EL_FIRST_INTERNAL + 37)
2128
2129 #define MAX_NUM_ELEMENTS                (EL_FIRST_INTERNAL + 38)
2130
2131
2132 // values for graphics/sounds action types
2133 enum
2134 {
2135   ACTION_DEFAULT = 0,
2136   ACTION_WAITING,
2137   ACTION_FALLING,
2138   ACTION_MOVING,
2139   ACTION_DIGGING,
2140   ACTION_SNAPPING,
2141   ACTION_COLLECTING,
2142   ACTION_DROPPING,
2143   ACTION_PUSHING,
2144   ACTION_WALKING,
2145   ACTION_PASSING,
2146   ACTION_IMPACT,
2147   ACTION_BREAKING,
2148   ACTION_ACTIVATING,
2149   ACTION_DEACTIVATING,
2150   ACTION_OPENING,
2151   ACTION_CLOSING,
2152   ACTION_ATTACKING,
2153   ACTION_GROWING,
2154   ACTION_SHRINKING,
2155   ACTION_ACTIVE,
2156   ACTION_FILLING,
2157   ACTION_EMPTYING,
2158   ACTION_CHANGING,
2159   ACTION_EXPLODING,
2160   ACTION_BORING,
2161   ACTION_BORING_1,
2162   ACTION_BORING_2,
2163   ACTION_BORING_3,
2164   ACTION_BORING_4,
2165   ACTION_BORING_5,
2166   ACTION_BORING_6,
2167   ACTION_BORING_7,
2168   ACTION_BORING_8,
2169   ACTION_BORING_9,
2170   ACTION_BORING_10,
2171   ACTION_SLEEPING,
2172   ACTION_SLEEPING_1,
2173   ACTION_SLEEPING_2,
2174   ACTION_SLEEPING_3,
2175   ACTION_AWAKENING,
2176   ACTION_DYING,
2177   ACTION_TURNING,
2178   ACTION_TURNING_FROM_LEFT,
2179   ACTION_TURNING_FROM_RIGHT,
2180   ACTION_TURNING_FROM_UP,
2181   ACTION_TURNING_FROM_DOWN,
2182   ACTION_SMASHED_BY_ROCK,
2183   ACTION_SMASHED_BY_SPRING,
2184   ACTION_EATING,
2185   ACTION_TWINKLING,
2186   ACTION_SPLASHING,
2187   ACTION_HITTING,
2188   ACTION_PAGE_1,
2189   ACTION_PAGE_2,
2190   ACTION_PAGE_3,
2191   ACTION_PAGE_4,
2192   ACTION_PAGE_5,
2193   ACTION_PAGE_6,
2194   ACTION_PAGE_7,
2195   ACTION_PAGE_8,
2196   ACTION_PAGE_9,
2197   ACTION_PAGE_10,
2198   ACTION_PAGE_11,
2199   ACTION_PAGE_12,
2200   ACTION_PAGE_13,
2201   ACTION_PAGE_14,
2202   ACTION_PAGE_15,
2203   ACTION_PAGE_16,
2204   ACTION_PAGE_17,
2205   ACTION_PAGE_18,
2206   ACTION_PAGE_19,
2207   ACTION_PAGE_20,
2208   ACTION_PAGE_21,
2209   ACTION_PAGE_22,
2210   ACTION_PAGE_23,
2211   ACTION_PAGE_24,
2212   ACTION_PAGE_25,
2213   ACTION_PAGE_26,
2214   ACTION_PAGE_27,
2215   ACTION_PAGE_28,
2216   ACTION_PAGE_29,
2217   ACTION_PAGE_30,
2218   ACTION_PAGE_31,
2219   ACTION_PAGE_32,
2220   ACTION_PART_1,
2221   ACTION_PART_2,
2222   ACTION_PART_3,
2223   ACTION_PART_4,
2224   ACTION_PART_5,
2225   ACTION_PART_6,
2226   ACTION_PART_7,
2227   ACTION_PART_8,
2228   ACTION_PART_9,
2229   ACTION_PART_10,
2230   ACTION_PART_11,
2231   ACTION_PART_12,
2232   ACTION_PART_13,
2233   ACTION_PART_14,
2234   ACTION_PART_15,
2235   ACTION_PART_16,
2236   ACTION_PART_17,
2237   ACTION_PART_18,
2238   ACTION_PART_19,
2239   ACTION_PART_20,
2240   ACTION_PART_21,
2241   ACTION_PART_22,
2242   ACTION_PART_23,
2243   ACTION_PART_24,
2244   ACTION_PART_25,
2245   ACTION_PART_26,
2246   ACTION_PART_27,
2247   ACTION_PART_28,
2248   ACTION_PART_29,
2249   ACTION_PART_30,
2250   ACTION_PART_31,
2251   ACTION_PART_32,
2252   ACTION_OTHER,
2253
2254   NUM_ACTIONS
2255 };
2256
2257 #define ACTION_BORING_LAST              ACTION_BORING_10
2258 #define ACTION_SLEEPING_LAST            ACTION_SLEEPING_3
2259
2260
2261 // values for special image configuration suffixes (must match game mode)
2262 enum
2263 {
2264   GFX_SPECIAL_ARG_DEFAULT = 0,
2265   GFX_SPECIAL_ARG_LOADING,
2266   GFX_SPECIAL_ARG_TITLE_INITIAL,
2267   GFX_SPECIAL_ARG_TITLE_INITIAL_1,
2268   GFX_SPECIAL_ARG_TITLE_INITIAL_2,
2269   GFX_SPECIAL_ARG_TITLE_INITIAL_3,
2270   GFX_SPECIAL_ARG_TITLE_INITIAL_4,
2271   GFX_SPECIAL_ARG_TITLE_INITIAL_5,
2272   GFX_SPECIAL_ARG_TITLE,
2273   GFX_SPECIAL_ARG_TITLE_1,
2274   GFX_SPECIAL_ARG_TITLE_2,
2275   GFX_SPECIAL_ARG_TITLE_3,
2276   GFX_SPECIAL_ARG_TITLE_4,
2277   GFX_SPECIAL_ARG_TITLE_5,
2278   GFX_SPECIAL_ARG_MAIN,
2279   GFX_SPECIAL_ARG_LEVELS,
2280   GFX_SPECIAL_ARG_LEVELNR,
2281   GFX_SPECIAL_ARG_SCORES,
2282   GFX_SPECIAL_ARG_EDITOR,
2283   GFX_SPECIAL_ARG_INFO,
2284   GFX_SPECIAL_ARG_SETUP,
2285   GFX_SPECIAL_ARG_PLAYING,
2286   GFX_SPECIAL_ARG_DOOR,
2287   GFX_SPECIAL_ARG_TAPE,
2288   GFX_SPECIAL_ARG_PANEL,
2289   GFX_SPECIAL_ARG_PREVIEW,
2290   GFX_SPECIAL_ARG_CRUMBLED,
2291   GFX_SPECIAL_ARG_MAINONLY,
2292   GFX_SPECIAL_ARG_TYPENAME,
2293   GFX_SPECIAL_ARG_SUBMENU,
2294   GFX_SPECIAL_ARG_MENU,
2295   GFX_SPECIAL_ARG_TOONS,
2296   GFX_SPECIAL_ARG_SCORESOLD,
2297   GFX_SPECIAL_ARG_SCORESNEW,
2298   GFX_SPECIAL_ARG_NO_TITLE,
2299   GFX_SPECIAL_ARG_FADING,
2300   GFX_SPECIAL_ARG_QUIT,
2301
2302   NUM_SPECIAL_GFX_ARGS
2303 };
2304
2305 // these additional definitions are currently only used for draw offsets
2306 enum
2307 {
2308   GFX_SPECIAL_ARG_INFO_MAIN = 0,
2309   GFX_SPECIAL_ARG_INFO_TITLE,
2310   GFX_SPECIAL_ARG_INFO_ELEMENTS,
2311   GFX_SPECIAL_ARG_INFO_MUSIC,
2312   GFX_SPECIAL_ARG_INFO_CREDITS,
2313   GFX_SPECIAL_ARG_INFO_PROGRAM,
2314   GFX_SPECIAL_ARG_INFO_VERSION,
2315   GFX_SPECIAL_ARG_INFO_LEVELSET,
2316
2317   NUM_SPECIAL_GFX_INFO_ARGS
2318 };
2319
2320 // these additional definitions are currently only used for draw offsets
2321 // (must match SETUP_MODE_* values as defined in src/screens.c)
2322 // (should also match corresponding entries in src/conf_gfx.c)
2323 enum
2324 {
2325   GFX_SPECIAL_ARG_SETUP_MAIN = 0,
2326   GFX_SPECIAL_ARG_SETUP_GAME,
2327   GFX_SPECIAL_ARG_SETUP_ENGINES,
2328   GFX_SPECIAL_ARG_SETUP_EDITOR,
2329   GFX_SPECIAL_ARG_SETUP_GRAPHICS,
2330   GFX_SPECIAL_ARG_SETUP_SOUND,
2331   GFX_SPECIAL_ARG_SETUP_ARTWORK,
2332   GFX_SPECIAL_ARG_SETUP_INPUT,
2333   GFX_SPECIAL_ARG_SETUP_TOUCH,
2334   GFX_SPECIAL_ARG_SETUP_SHORTCUTS,
2335   GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1,
2336   GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2,
2337   GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3,
2338   GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4,
2339   GFX_SPECIAL_ARG_SETUP_SHORTCUTS_5,
2340   GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK,
2341   GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER,
2342
2343   NUM_SPECIAL_GFX_SETUP_ARGS
2344 };
2345
2346 // values for image configuration suffixes
2347 enum
2348 {
2349   GFX_ARG_X = 0,
2350   GFX_ARG_Y,
2351   GFX_ARG_XPOS,
2352   GFX_ARG_YPOS,
2353   GFX_ARG_WIDTH,
2354   GFX_ARG_HEIGHT,
2355   GFX_ARG_VERTICAL,
2356   GFX_ARG_OFFSET,
2357   GFX_ARG_XOFFSET,
2358   GFX_ARG_YOFFSET,
2359   GFX_ARG_2ND_MOVEMENT_TILE,
2360   GFX_ARG_2ND_VERTICAL,
2361   GFX_ARG_2ND_OFFSET,
2362   GFX_ARG_2ND_XOFFSET,
2363   GFX_ARG_2ND_YOFFSET,
2364   GFX_ARG_2ND_SWAP_TILES,
2365   GFX_ARG_FRAMES,
2366   GFX_ARG_FRAMES_PER_LINE,
2367   GFX_ARG_START_FRAME,
2368   GFX_ARG_DELAY,
2369   GFX_ARG_ANIM_MODE,
2370   GFX_ARG_GLOBAL_SYNC,
2371   GFX_ARG_CRUMBLED_LIKE,
2372   GFX_ARG_DIGGABLE_LIKE,
2373   GFX_ARG_BORDER_SIZE,
2374   GFX_ARG_STEP_OFFSET,
2375   GFX_ARG_STEP_XOFFSET,
2376   GFX_ARG_STEP_YOFFSET,
2377   GFX_ARG_STEP_DELAY,
2378   GFX_ARG_DIRECTION,
2379   GFX_ARG_POSITION,
2380   GFX_ARG_DRAW_XOFFSET,
2381   GFX_ARG_DRAW_YOFFSET,
2382   GFX_ARG_DRAW_MASKED,
2383   GFX_ARG_DRAW_ORDER,
2384   GFX_ARG_INIT_DELAY_FIXED,
2385   GFX_ARG_INIT_DELAY_RANDOM,
2386   GFX_ARG_INIT_DELAY_ACTION,
2387   GFX_ARG_ANIM_DELAY_FIXED,
2388   GFX_ARG_ANIM_DELAY_RANDOM,
2389   GFX_ARG_ANIM_DELAY_ACTION,
2390   GFX_ARG_POST_DELAY_FIXED,
2391   GFX_ARG_POST_DELAY_RANDOM,
2392   GFX_ARG_POST_DELAY_ACTION,
2393   GFX_ARG_INIT_EVENT,
2394   GFX_ARG_INIT_EVENT_ACTION,
2395   GFX_ARG_ANIM_EVENT,
2396   GFX_ARG_ANIM_EVENT_ACTION,
2397   GFX_ARG_NAME,
2398   GFX_ARG_SCALE_UP_FACTOR,
2399   GFX_ARG_TILE_SIZE,
2400   GFX_ARG_CLONE_FROM,
2401   GFX_ARG_FADE_MODE,
2402   GFX_ARG_FADE_DELAY,
2403   GFX_ARG_POST_DELAY,
2404   GFX_ARG_AUTO_DELAY,
2405   GFX_ARG_AUTO_DELAY_UNIT,
2406   GFX_ARG_ALIGN,
2407   GFX_ARG_VALIGN,
2408   GFX_ARG_SORT_PRIORITY,
2409   GFX_ARG_CLASS,
2410   GFX_ARG_STYLE,
2411   GFX_ARG_ACTIVE_XOFFSET,
2412   GFX_ARG_ACTIVE_YOFFSET,
2413   GFX_ARG_PRESSED_XOFFSET,
2414   GFX_ARG_PRESSED_YOFFSET,
2415
2416   NUM_GFX_ARGS
2417 };
2418
2419 // values for sound configuration suffixes
2420 enum
2421 {
2422   SND_ARG_MODE_LOOP = 0,
2423   SND_ARG_VOLUME,
2424   SND_ARG_PRIORITY,
2425
2426   NUM_SND_ARGS
2427 };
2428
2429 // values for music configuration suffixes
2430 enum
2431 {
2432   MUS_ARG_MODE_LOOP = 0,
2433
2434   NUM_MUS_ARGS
2435 };
2436
2437 // values for font configuration (definitions must match those from main.c)
2438 enum
2439 {
2440   FONT_INITIAL_1 = MAIN_FONT_INITIAL_1,
2441   FONT_INITIAL_2 = MAIN_FONT_INITIAL_2,
2442   FONT_INITIAL_3 = MAIN_FONT_INITIAL_3,
2443   FONT_INITIAL_4 = MAIN_FONT_INITIAL_4,
2444   FONT_TITLE_1,
2445   FONT_TITLE_2,
2446   FONT_MENU_1_ACTIVE,
2447   FONT_MENU_2_ACTIVE,
2448   FONT_MENU_1,
2449   FONT_MENU_2,
2450   FONT_TEXT_1_ACTIVE,
2451   FONT_TEXT_2_ACTIVE,
2452   FONT_TEXT_3_ACTIVE,
2453   FONT_TEXT_4_ACTIVE,
2454   FONT_TEXT_1,
2455   FONT_TEXT_2,
2456   FONT_TEXT_3,
2457   FONT_TEXT_4,
2458   FONT_ENVELOPE_1,
2459   FONT_ENVELOPE_2,
2460   FONT_ENVELOPE_3,
2461   FONT_ENVELOPE_4,
2462   FONT_REQUEST,
2463   FONT_INPUT_1_ACTIVE,
2464   FONT_INPUT_2_ACTIVE,
2465   FONT_INPUT_1,
2466   FONT_INPUT_2,
2467   FONT_OPTION_OFF_NARROW,
2468   FONT_OPTION_OFF,
2469   FONT_OPTION_ON_NARROW,
2470   FONT_OPTION_ON,
2471   FONT_VALUE_1,
2472   FONT_VALUE_2,
2473   FONT_VALUE_OLD_NARROW,
2474   FONT_VALUE_OLD,
2475   FONT_VALUE_NARROW,
2476   FONT_LEVEL_NUMBER_ACTIVE,
2477   FONT_LEVEL_NUMBER,
2478   FONT_TAPE_RECORDER,
2479   FONT_GAME_INFO,
2480   FONT_INFO_ELEMENTS,
2481   FONT_INFO_LEVELSET,
2482   FONT_MAIN_NETWORK_PLAYERS,
2483
2484   NUM_FONTS
2485 };
2486
2487 #define NUM_INITIAL_FONTS               4
2488
2489 // values for toon animation configuration
2490 #define MAX_NUM_TOONS                   20
2491
2492 // values for global animation configuration (must match those from main.c)
2493 #define NUM_GLOBAL_ANIMS                MAX_GLOBAL_ANIMS
2494 #define NUM_GLOBAL_ANIM_PARTS           MAX_GLOBAL_ANIM_PARTS
2495 #define NUM_GLOBAL_ANIM_PARTS_ALL       (NUM_GLOBAL_ANIM_PARTS + 1)
2496 #define NUM_GLOBAL_ANIM_TOKENS          (2 * NUM_GLOBAL_ANIMS)
2497
2498 #define GLOBAL_ANIM_ID_GRAPHIC_FIRST    0
2499 #define GLOBAL_ANIM_ID_GRAPHIC_LAST     (NUM_GLOBAL_ANIMS - 1)
2500 #define GLOBAL_ANIM_ID_CONTROL_FIRST    (NUM_GLOBAL_ANIMS)
2501 #define GLOBAL_ANIM_ID_CONTROL_LAST     (2 * NUM_GLOBAL_ANIMS - 1)
2502
2503 #define GLOBAL_ANIM_ID_PART_FIRST       0
2504 #define GLOBAL_ANIM_ID_PART_LAST        (NUM_GLOBAL_ANIM_PARTS - 1)
2505 #define GLOBAL_ANIM_ID_PART_BASE        (NUM_GLOBAL_ANIM_PARTS)
2506
2507 // values for global border graphics
2508 #define IMG_GLOBAL_BORDER_FIRST         IMG_GLOBAL_BORDER
2509 #define IMG_GLOBAL_BORDER_LAST          IMG_GLOBAL_BORDER_PLAYING
2510
2511 // values for game_status (must match special image configuration suffixes)
2512 #define GAME_MODE_DEFAULT               GFX_SPECIAL_ARG_DEFAULT
2513 #define GAME_MODE_LOADING               GFX_SPECIAL_ARG_LOADING
2514 #define GAME_MODE_TITLE_INITIAL         GFX_SPECIAL_ARG_TITLE_INITIAL
2515 #define GAME_MODE_TITLE_INITIAL_1       GFX_SPECIAL_ARG_TITLE_INITIAL_1
2516 #define GAME_MODE_TITLE_INITIAL_2       GFX_SPECIAL_ARG_TITLE_INITIAL_2
2517 #define GAME_MODE_TITLE_INITIAL_3       GFX_SPECIAL_ARG_TITLE_INITIAL_3
2518 #define GAME_MODE_TITLE_INITIAL_4       GFX_SPECIAL_ARG_TITLE_INITIAL_4
2519 #define GAME_MODE_TITLE_INITIAL_5       GFX_SPECIAL_ARG_TITLE_INITIAL_5
2520 #define GAME_MODE_TITLE                 GFX_SPECIAL_ARG_TITLE
2521 #define GAME_MODE_TITLE_1               GFX_SPECIAL_ARG_TITLE_1
2522 #define GAME_MODE_TITLE_2               GFX_SPECIAL_ARG_TITLE_2
2523 #define GAME_MODE_TITLE_3               GFX_SPECIAL_ARG_TITLE_3
2524 #define GAME_MODE_TITLE_4               GFX_SPECIAL_ARG_TITLE_4
2525 #define GAME_MODE_TITLE_5               GFX_SPECIAL_ARG_TITLE_5
2526 #define GAME_MODE_MAIN                  GFX_SPECIAL_ARG_MAIN
2527 #define GAME_MODE_LEVELS                GFX_SPECIAL_ARG_LEVELS
2528 #define GAME_MODE_LEVELNR               GFX_SPECIAL_ARG_LEVELNR
2529 #define GAME_MODE_SCORES                GFX_SPECIAL_ARG_SCORES
2530 #define GAME_MODE_EDITOR                GFX_SPECIAL_ARG_EDITOR
2531 #define GAME_MODE_INFO                  GFX_SPECIAL_ARG_INFO
2532 #define GAME_MODE_SETUP                 GFX_SPECIAL_ARG_SETUP
2533 #define GAME_MODE_PLAYING               GFX_SPECIAL_ARG_PLAYING
2534 #define GAME_MODE_PSEUDO_DOOR           GFX_SPECIAL_ARG_DOOR
2535 #define GAME_MODE_PSEUDO_TAPE           GFX_SPECIAL_ARG_TAPE
2536 #define GAME_MODE_PSEUDO_PANEL          GFX_SPECIAL_ARG_PANEL
2537 #define GAME_MODE_PSEUDO_PREVIEW        GFX_SPECIAL_ARG_PREVIEW
2538 #define GAME_MODE_PSEUDO_CRUMBLED       GFX_SPECIAL_ARG_CRUMBLED
2539 #define GAME_MODE_PSEUDO_MAINONLY       GFX_SPECIAL_ARG_MAINONLY
2540 #define GAME_MODE_PSEUDO_TYPENAME       GFX_SPECIAL_ARG_TYPENAME
2541 #define GAME_MODE_PSEUDO_SUBMENU        GFX_SPECIAL_ARG_SUBMENU
2542 #define GAME_MODE_PSEUDO_MENU           GFX_SPECIAL_ARG_MENU
2543 #define GAME_MODE_PSEUDO_TOONS          GFX_SPECIAL_ARG_TOONS
2544 #define GAME_MODE_PSEUDO_SCORESOLD      GFX_SPECIAL_ARG_SCORESOLD
2545 #define GAME_MODE_PSEUDO_SCORESNEW      GFX_SPECIAL_ARG_SCORESNEW
2546 #define GAME_MODE_PSEUDO_NO_TITLE       GFX_SPECIAL_ARG_NO_TITLE
2547 #define GAME_MODE_PSEUDO_FADING         GFX_SPECIAL_ARG_FADING
2548 #define GAME_MODE_QUIT                  GFX_SPECIAL_ARG_QUIT
2549
2550 #define NUM_GAME_MODES                  NUM_SPECIAL_GFX_ARGS
2551
2552 // special definitions currently only used for custom artwork configuration
2553 #define MUSIC_PREFIX_BACKGROUND         0
2554 #define NUM_MUSIC_PREFIXES              1
2555
2556 // definitions for demo animation lists
2557 #define HELPANIM_LIST_NEXT              -1
2558 #define HELPANIM_LIST_END               -999
2559
2560
2561 // program information and versioning definitions
2562 #define PROGRAM_VERSION_SUPER           4
2563 #define PROGRAM_VERSION_MAJOR           2
2564 #define PROGRAM_VERSION_MINOR           0
2565 #define PROGRAM_VERSION_PATCH           3
2566 #define PROGRAM_VERSION_EXTRA           ""
2567
2568 #define PROGRAM_TITLE_STRING            "Rocks'n'Diamonds"
2569 #define PROGRAM_AUTHOR_STRING           "Holger Schemel"
2570 #define PROGRAM_EMAIL_STRING            "info@artsoft.org"
2571 #define PROGRAM_WEBSITE_STRING          "https://www.artsoft.org/"
2572 #define PROGRAM_COPYRIGHT_STRING        "Copyright \xa9""1995-2020 by Holger Schemel"
2573 #define PROGRAM_COMPANY_STRING          "A Game by Artsoft Entertainment"
2574
2575 #define PROGRAM_ICON_FILENAME           "RocksIcon32x32.png"
2576
2577 #define COOKIE_PREFIX                   "ROCKSNDIAMONDS"
2578
2579 #define USERDATA_DIRECTORY_OTHER        "userdata"
2580
2581 /* file version numbers for resource files (levels, tapes, score, setup, etc.)
2582 ** currently supported/known file version numbers:
2583 **      1.0 (old)
2584 **      1.2 (still in use)
2585 **      1.4 (still in use)
2586 **      2.0 (actual)
2587 */
2588 #define FILE_VERSION_1_0                VERSION_IDENT(1,0,0,0)
2589 #define FILE_VERSION_1_2                VERSION_IDENT(1,2,0,0)
2590 #define FILE_VERSION_1_4                VERSION_IDENT(1,4,0,0)
2591 #define FILE_VERSION_2_0                VERSION_IDENT(2,0,0,0)
2592 #define FILE_VERSION_3_0                VERSION_IDENT(3,0,0,0)
2593
2594 /* file version does not change for every program version, but is changed
2595    when new features are introduced that are incompatible with older file
2596    versions, so that they can be treated accordingly */
2597 #define FILE_VERSION_ACTUAL             FILE_VERSION_3_0
2598
2599 #define GAME_VERSION_1_0                FILE_VERSION_1_0
2600 #define GAME_VERSION_1_2                FILE_VERSION_1_2
2601 #define GAME_VERSION_1_4                FILE_VERSION_1_4
2602 #define GAME_VERSION_2_0                FILE_VERSION_2_0
2603 #define GAME_VERSION_3_0                FILE_VERSION_3_0
2604
2605 #define GAME_VERSION_ACTUAL             VERSION_IDENT(PROGRAM_VERSION_SUPER, \
2606                                                       PROGRAM_VERSION_MAJOR, \
2607                                                       PROGRAM_VERSION_MINOR, \
2608                                                       PROGRAM_VERSION_PATCH)
2609
2610 // values for game_emulation
2611 #define EMU_NONE                        0
2612 #define EMU_BOULDERDASH                 1
2613 #define EMU_SOKOBAN                     2
2614 #define EMU_SUPAPLEX                    3
2615
2616 // values for level file type identifier
2617 #define LEVEL_FILE_TYPE_UNKNOWN         0
2618 #define LEVEL_FILE_TYPE_RND             1
2619 #define LEVEL_FILE_TYPE_BD              2
2620 #define LEVEL_FILE_TYPE_EM              3
2621 #define LEVEL_FILE_TYPE_SP              4
2622 #define LEVEL_FILE_TYPE_DX              5
2623 #define LEVEL_FILE_TYPE_SB              6
2624 #define LEVEL_FILE_TYPE_DC              7
2625 #define LEVEL_FILE_TYPE_MM              8
2626
2627 #define NUM_LEVEL_FILE_TYPES            9
2628
2629 // values for game engine type identifier
2630 #define GAME_ENGINE_TYPE_UNKNOWN        LEVEL_FILE_TYPE_UNKNOWN
2631 #define GAME_ENGINE_TYPE_RND            LEVEL_FILE_TYPE_RND
2632 #define GAME_ENGINE_TYPE_EM             LEVEL_FILE_TYPE_EM
2633 #define GAME_ENGINE_TYPE_SP             LEVEL_FILE_TYPE_SP
2634 #define GAME_ENGINE_TYPE_MM             LEVEL_FILE_TYPE_MM
2635
2636 #define NUM_ENGINE_TYPES                4
2637
2638 // values for automatically playing tapes
2639 #define AUTOPLAY_NONE                   0
2640 #define AUTOPLAY_PLAY                   (1 << 0)
2641 #define AUTOPLAY_FFWD                   (1 << 1)
2642 #define AUTOPLAY_WARP                   (1 << 2)
2643 #define AUTOPLAY_TEST                   (1 << 3)
2644 #define AUTOPLAY_FIX                    (1 << 4)
2645 #define AUTOPLAY_WARP_NO_DISPLAY        AUTOPLAY_TEST
2646
2647 #define AUTOPLAY_MODE_NONE              0
2648 #define AUTOPLAY_MODE_PLAY              (AUTOPLAY_MODE_NONE | AUTOPLAY_PLAY)
2649 #define AUTOPLAY_MODE_FFWD              (AUTOPLAY_MODE_PLAY | AUTOPLAY_FFWD)
2650 #define AUTOPLAY_MODE_WARP              (AUTOPLAY_MODE_FFWD | AUTOPLAY_WARP)
2651 #define AUTOPLAY_MODE_TEST              (AUTOPLAY_MODE_WARP | AUTOPLAY_TEST)
2652 #define AUTOPLAY_MODE_FIX               (AUTOPLAY_MODE_TEST | AUTOPLAY_FIX)
2653 #define AUTOPLAY_MODE_WARP_NO_DISPLAY   AUTOPLAY_MODE_TEST
2654
2655
2656 struct BorderInfo
2657 {
2658   boolean draw_masked[NUM_SPECIAL_GFX_ARGS];
2659   boolean draw_masked_when_fading;
2660 };
2661
2662 struct RequestButtonInfo
2663 {
2664   struct TextPosInfo yes;
2665   struct TextPosInfo no;
2666   struct TextPosInfo confirm;
2667
2668   struct TextPosInfo player_1;
2669   struct TextPosInfo player_2;
2670   struct TextPosInfo player_3;
2671   struct TextPosInfo player_4;
2672
2673   struct TextPosInfo touch_yes;
2674   struct TextPosInfo touch_no;
2675   struct TextPosInfo touch_confirm;
2676 };
2677
2678 struct MenuMainButtonInfo
2679 {
2680   struct MenuPosInfo name;
2681   struct MenuPosInfo levels;
2682   struct MenuPosInfo scores;
2683   struct MenuPosInfo editor;
2684   struct MenuPosInfo info;
2685   struct MenuPosInfo game;
2686   struct MenuPosInfo setup;
2687   struct MenuPosInfo quit;
2688
2689   struct MenuPosInfo prev_level;
2690   struct MenuPosInfo next_level;
2691
2692   struct MenuPosInfo first_level;
2693   struct MenuPosInfo last_level;
2694   struct MenuPosInfo level_number;
2695
2696   struct MenuPosInfo insert_solution;
2697   struct MenuPosInfo play_solution;
2698
2699   struct MenuPosInfo switch_ecs_aga;
2700 };
2701
2702 struct MenuMainTextInfo
2703 {
2704   struct TextPosInfo name;
2705   struct TextPosInfo levels;
2706   struct TextPosInfo scores;
2707   struct TextPosInfo editor;
2708   struct TextPosInfo info;
2709   struct TextPosInfo game;
2710   struct TextPosInfo setup;
2711   struct TextPosInfo quit;
2712
2713   struct TextPosInfo first_level;
2714   struct TextPosInfo last_level;
2715   struct TextPosInfo level_number;
2716   struct TextPosInfo level_info_1;
2717   struct TextPosInfo level_info_2;
2718   struct TextPosInfo level_name;
2719   struct TextPosInfo level_author;
2720   struct TextPosInfo level_year;
2721   struct TextPosInfo level_imported_from;
2722   struct TextPosInfo level_imported_by;
2723   struct TextPosInfo level_tested_by;
2724   struct TextPosInfo title_1;
2725   struct TextPosInfo title_2;
2726   struct TextPosInfo title_3;
2727 };
2728
2729 struct MenuMainInputInfo
2730 {
2731   struct TextPosInfo name;
2732 };
2733
2734 struct MenuMainInfo
2735 {
2736   struct MenuMainButtonInfo button;
2737   struct MenuMainTextInfo text;
2738   struct MenuMainInputInfo input;
2739
2740   struct TextPosInfo preview_players;
2741   struct TextPosInfo network_players;
2742 };
2743
2744 struct MenuSetupButtonInfo
2745 {
2746   struct MenuPosInfo prev_player;
2747   struct MenuPosInfo next_player;
2748
2749   struct MenuPosInfo touch_back;
2750   struct MenuPosInfo touch_next;
2751   struct MenuPosInfo touch_back2;
2752   struct MenuPosInfo touch_next2;
2753 };
2754
2755 struct MenuSetupInfo
2756 {
2757   struct MenuSetupButtonInfo button;
2758 };
2759
2760 struct TitleFadingInfo
2761 {
2762   int fade_mode;
2763   int fade_delay;
2764   int post_delay;
2765   int auto_delay;
2766   int auto_delay_unit;
2767 };
2768
2769 struct TitleMessageInfo
2770 {
2771   int x, y;
2772   int width, height;
2773   int chars, lines;
2774   int align, valign;
2775   int font;
2776   boolean autowrap;
2777   boolean centered;
2778   boolean parse_comments;
2779   int sort_priority;
2780
2781   int fade_mode;
2782   int fade_delay;
2783   int post_delay;
2784   int auto_delay;
2785   int auto_delay_unit;
2786 };
2787
2788 struct InitInfo
2789 {
2790   struct MenuPosInfo busy;
2791 };
2792
2793 struct MenuInfo
2794 {
2795   int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
2796   int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
2797   int draw_xoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
2798   int draw_yoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
2799   int draw_xoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2800   int draw_yoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2801
2802   int scrollbar_xoffset;
2803
2804   struct MenuPosInfo list_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2805
2806   int list_size[NUM_SPECIAL_GFX_ARGS];
2807   int list_size_info[NUM_SPECIAL_GFX_INFO_ARGS];
2808
2809   int left_spacing[NUM_SPECIAL_GFX_ARGS];
2810   int left_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2811   int left_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2812   int right_spacing[NUM_SPECIAL_GFX_ARGS];
2813   int right_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2814   int right_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2815   int top_spacing[NUM_SPECIAL_GFX_ARGS];
2816   int top_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2817   int top_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2818   int bottom_spacing[NUM_SPECIAL_GFX_ARGS];
2819   int bottom_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2820   int bottom_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2821
2822   int paragraph_spacing[NUM_SPECIAL_GFX_ARGS];
2823   int paragraph_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2824   int paragraph_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2825   int headline1_spacing[NUM_SPECIAL_GFX_ARGS];
2826   int headline1_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2827   int headline1_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2828   int headline2_spacing[NUM_SPECIAL_GFX_ARGS];
2829   int headline2_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2830   int headline2_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2831   int line_spacing[NUM_SPECIAL_GFX_ARGS];
2832   int line_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2833   int line_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2834   int extra_spacing[NUM_SPECIAL_GFX_ARGS];
2835   int extra_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS];
2836   int extra_spacing_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
2837
2838   struct TitleFadingInfo enter_menu;
2839   struct TitleFadingInfo leave_menu;
2840   struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS];
2841   struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS];
2842   struct TitleFadingInfo next_screen[NUM_SPECIAL_GFX_ARGS];
2843
2844   int sound[NUM_SPECIAL_GFX_ARGS];
2845   int music[NUM_SPECIAL_GFX_ARGS];
2846
2847   struct MenuMainInfo main;
2848   struct MenuSetupInfo setup;
2849 };
2850
2851 struct DoorInfo
2852 {
2853   struct DoorPartPosInfo part_1;
2854   struct DoorPartPosInfo part_2;
2855   struct DoorPartPosInfo part_3;
2856   struct DoorPartPosInfo part_4;
2857   struct DoorPartPosInfo part_5;
2858   struct DoorPartPosInfo part_6;
2859   struct DoorPartPosInfo part_7;
2860   struct DoorPartPosInfo part_8;
2861
2862   struct DoorPartPosInfo panel;
2863
2864   int width;
2865   int height;
2866   int step_offset;
2867   int step_delay;
2868   int post_delay;
2869   int anim_mode;
2870 };
2871
2872 struct RequestInfo
2873 {
2874   struct RequestButtonInfo button;
2875   int x, y;
2876   int width, height;
2877   int border_size;
2878   int line_spacing;
2879   int step_offset;
2880   int step_delay;
2881   int anim_mode;
2882   int align;
2883   int valign;
2884   boolean autowrap;
2885   boolean centered;
2886   boolean wrap_single_words;
2887 };
2888
2889 struct PreviewInfo
2890 {
2891   int x, y;
2892   int align, valign;
2893   int xsize, ysize;
2894   int xoffset, yoffset;
2895   int tile_size;
2896   int step_offset;
2897   int step_delay;
2898   int anim_mode;
2899
2900   boolean redefined;            // redefined by custom artwork
2901 };
2902
2903 struct EditorTabsInfo
2904 {
2905   int x;
2906   int y;
2907   int yoffset2;
2908   int width;
2909   int height;
2910   int draw_xoffset;
2911   int draw_yoffset;
2912 };
2913
2914 struct EditorSettingsInfo
2915 {
2916   struct MenuPosInfo headline;
2917
2918   struct XY element_graphic;
2919   struct XY element_name;
2920
2921   struct EditorTabsInfo tabs;
2922
2923   struct XY tooltip;
2924 };
2925
2926 struct EditorGadgetInfo
2927 {
2928   int normal_spacing;
2929   int small_spacing;
2930   int tiny_spacing;
2931   int line_spacing;
2932   int text_spacing;
2933   int tab_spacing;
2934
2935   struct Rect separator_line;
2936 };
2937
2938 struct EditorButtonInfo
2939 {
2940   struct XYTileSize prev_level;
2941   struct XYTileSize next_level;
2942
2943   struct XYTileSize properties;
2944   struct XYTileSize element_left;
2945   struct XYTileSize element_middle;
2946   struct XYTileSize element_right;
2947   struct XYTileSize palette;
2948
2949   struct XYTileSize draw_single;
2950   struct XYTileSize draw_connected;
2951   struct XYTileSize draw_line;
2952   struct XYTileSize draw_arc;
2953   struct XYTileSize draw_rectangle;
2954   struct XYTileSize draw_filled_box;
2955   struct XYTileSize rotate_up;
2956   struct XYTileSize draw_text;
2957   struct XYTileSize flood_fill;
2958   struct XYTileSize rotate_left;
2959   struct XYTileSize zoom_level;
2960   struct XYTileSize rotate_right;
2961   struct XYTileSize draw_random;
2962   struct XYTileSize grab_brush;
2963   struct XYTileSize rotate_down;
2964   struct XYTileSize pick_element;
2965
2966   struct XYTileSize ce_copy_from;
2967   struct XYTileSize ce_copy_to;
2968   struct XYTileSize ce_swap;
2969   struct XYTileSize ce_copy;
2970   struct XYTileSize ce_paste;
2971
2972   struct XYTileSize undo;
2973   struct XYTileSize conf;
2974   struct XYTileSize save;
2975   struct XYTileSize clear;
2976   struct XYTileSize test;
2977   struct XYTileSize exit;
2978 };
2979
2980 struct EditorInputInfo
2981 {
2982   struct XY level_number;
2983 };
2984
2985 struct EditorPaletteInfo
2986 {
2987   int x, y;
2988   int cols, rows;
2989   int tile_size;
2990   boolean show_as_separate_screen;
2991   boolean show_on_element_buttons;
2992
2993   struct XYTileSize element_left;
2994   struct XYTileSize element_middle;
2995   struct XYTileSize element_right;
2996 };
2997
2998 struct EditorDrawingAreaInfo
2999 {
3000   int tile_size;
3001 };
3002
3003 struct EditorInfo
3004 {
3005   struct EditorSettingsInfo settings;
3006   struct EditorGadgetInfo gadget;
3007   struct EditorButtonInfo button;
3008   struct EditorInputInfo input;
3009   struct EditorPaletteInfo palette;
3010   struct EditorDrawingAreaInfo drawingarea;
3011 };
3012
3013 struct ViewportInfo
3014 {
3015   struct RectWithBorder window[NUM_SPECIAL_GFX_ARGS];
3016   struct RectWithBorder playfield[NUM_SPECIAL_GFX_ARGS];
3017   struct RectWithBorder door_1[NUM_SPECIAL_GFX_ARGS];
3018   struct RectWithBorder door_2[NUM_SPECIAL_GFX_ARGS];
3019 };
3020
3021 struct HiScore
3022 {
3023   char Name[MAX_PLAYER_NAME_LEN + 1];
3024   int Score;
3025 };
3026
3027 struct Content
3028 {
3029   int e[3][3];
3030 };
3031
3032 struct EnvelopeInfo
3033 {
3034   int xsize;
3035   int ysize;
3036
3037   boolean autowrap;
3038   boolean centered;
3039
3040   char text[MAX_ENVELOPE_TEXT_LEN + 1];
3041 };
3042
3043 struct LevelFileInfo
3044 {
3045   int nr;
3046   int type;
3047   boolean packed;
3048   char *basename;
3049   char *filename;
3050 };
3051
3052 struct DateInfo
3053 {
3054   int year;
3055   int month;
3056   int day;
3057
3058   enum
3059   {
3060     DATE_SRC_CLOCK,
3061     DATE_SRC_LEVELFILE
3062   } src;
3063 };
3064
3065 struct LevelInfo
3066 {
3067   struct LevelFileInfo file_info;
3068
3069   int game_engine_type;
3070
3071   // level stored in native format for the alternative native game engines
3072   struct LevelInfo_EM *native_em_level;
3073   struct LevelInfo_SP *native_sp_level;
3074   struct LevelInfo_MM *native_mm_level;
3075
3076   int file_version;     // file format version the level is stored with
3077   int game_version;     // game release version the level was created with
3078
3079   struct DateInfo creation_date;
3080
3081   boolean encoding_16bit_field;         // level contains 16-bit elements
3082   boolean encoding_16bit_yamyam;        // yamyam contains 16-bit elements
3083   boolean encoding_16bit_amoeba;        // amoeba contains 16-bit elements
3084
3085   int fieldx, fieldy;
3086
3087   int time;                             // available time (seconds)
3088   int gems_needed;
3089   boolean auto_count_gems;
3090
3091   char name[MAX_LEVEL_NAME_LEN + 1];
3092   char author[MAX_LEVEL_AUTHOR_LEN + 1];
3093
3094   int random_seed;
3095
3096   struct EnvelopeInfo envelope[NUM_ENVELOPES];
3097
3098   int score[LEVEL_SCORE_ELEMENTS];
3099
3100   struct Content yamyam_content[MAX_ELEMENT_CONTENTS];
3101   int num_yamyam_contents;
3102
3103   int amoeba_speed;
3104   int amoeba_content;
3105
3106   int game_of_life[4];
3107   int biomaze[4];
3108
3109   int time_magic_wall;
3110   int time_wheel;
3111   int time_light;
3112   int time_timegate;
3113
3114   int shield_normal_time;
3115   int shield_deadly_time;
3116
3117   int extra_time;
3118   int time_orb_time;
3119
3120   int extra_time_score;
3121
3122   int start_element[MAX_PLAYERS];
3123   boolean use_start_element[MAX_PLAYERS];
3124
3125   int artwork_element[MAX_PLAYERS];
3126   boolean use_artwork_element[MAX_PLAYERS];
3127
3128   int explosion_element[MAX_PLAYERS];
3129   boolean use_explosion_element[MAX_PLAYERS];
3130
3131   // values for the new EMC elements
3132   int android_move_time;
3133   int android_clone_time;
3134   boolean ball_random;
3135   boolean ball_active_initial;
3136   int ball_time;
3137   int lenses_score;
3138   int magnify_score;
3139   int slurp_score;
3140   int lenses_time;
3141   int magnify_time;
3142   int wind_direction_initial;
3143
3144   struct Content ball_content[MAX_ELEMENT_CONTENTS];
3145   int num_ball_contents;
3146
3147   int num_android_clone_elements;
3148   int android_clone_element[MAX_ANDROID_ELEMENTS];
3149
3150   int can_move_into_acid_bits;  // bitfield to store property for elements
3151   int dont_collide_with_bits;   // bitfield to store property for elements
3152
3153   int initial_player_stepsize[MAX_PLAYERS];     // initial player speed
3154   boolean initial_player_gravity[MAX_PLAYERS];
3155
3156   boolean use_initial_inventory[MAX_PLAYERS];
3157   int initial_inventory_size[MAX_PLAYERS];
3158   int initial_inventory_content[MAX_PLAYERS][MAX_INITIAL_INVENTORY_SIZE];
3159
3160   boolean em_slippery_gems;     // EM style "gems slip from wall" behaviour
3161   boolean em_explodes_by_fire;  // EM style chain explosion behaviour
3162   boolean use_spring_bug;       // for compatibility with old levels
3163   boolean use_time_orb_bug;     // for compatibility with old levels
3164   boolean use_life_bugs;        // for compatibility with old levels
3165   boolean instant_relocation;   // no visual delay when relocating player
3166   boolean shifted_relocation;   // no level centering when relocating player
3167   boolean lazy_relocation;      // only redraw off-screen player relocation
3168   boolean can_pass_to_walkable; // player can pass to empty or walkable tile
3169   boolean grow_into_diggable;   // amoeba can grow into anything diggable
3170   boolean sb_fields_needed;     // all Sokoban fields must be solved
3171   boolean sb_objects_needed;    // all Sokoban objects must be solved
3172   boolean auto_exit_sokoban;    // automatically finish solved Sokoban levels
3173   boolean solved_by_one_player; // level is solved if one player enters exit
3174
3175   boolean continuous_snapping;  // repeated snapping without releasing key
3176   boolean block_snap_field;     // snapping blocks field to show animation
3177   boolean block_last_field;     // player blocks previous field while moving
3178   boolean sp_block_last_field;  // player blocks previous field while moving
3179
3180   // values for MM/DF elements
3181   boolean mm_laser_red, mm_laser_green, mm_laser_blue;
3182   boolean df_laser_red, df_laser_green, df_laser_blue;
3183   int mm_time_fuse;
3184   int mm_time_bomb;
3185   int mm_time_ball;
3186   int mm_time_block;
3187
3188   // ('int' instead of 'boolean' because used as selectbox value in editor)
3189   int use_step_counter;         // count steps instead of seconds for level
3190
3191   short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3192
3193   boolean use_custom_template;  // use custom properties from template file
3194
3195   boolean file_has_custom_elements;     // set when level file contains CEs
3196
3197   boolean no_valid_file;        // set when level file missing or invalid
3198   boolean no_level_file;        // set when falling back to level template
3199
3200   boolean changed;              // set when level was changed in the editor
3201
3202   // runtime flags to handle bugs in old levels (not stored in level file)
3203   boolean use_action_after_change_bug;
3204 };
3205
3206 struct NetworkLevelInfo
3207 {
3208   char *leveldir_identifier;            // network levelset identifier
3209
3210   struct LevelFileInfo file_info;       // file info for level file
3211   struct LevelFileInfo tmpl_info;       // file info for level template
3212
3213   boolean use_network_level_files;      // use levels from network server
3214   boolean use_custom_template;          // use CEs from level template
3215 };
3216
3217 struct GlobalInfo
3218 {
3219   char *autoplay_leveldir;
3220   int autoplay_level[MAX_TAPES_PER_SET];
3221   boolean autoplay_all;
3222   boolean autoplay_mode;
3223
3224   char *patchtapes_mode;
3225   char *patchtapes_leveldir;
3226   int patchtapes_level[MAX_TAPES_PER_SET];
3227   boolean patchtapes_all;
3228
3229   char *convert_leveldir;
3230   int convert_level_nr;
3231
3232   char *create_images_dir;
3233
3234   int num_toons;
3235
3236   float frames_per_second;
3237   boolean show_frames_per_second;
3238
3239   // global values for fading screens and masking borders
3240   int border_status;
3241
3242   // values for global animations
3243   int anim_status;
3244   int anim_status_next;
3245
3246   boolean use_envelope_request;
3247 };
3248
3249 struct ElementChangeInfo
3250 {
3251   boolean can_change;           // use or ignore this change info
3252
3253   boolean has_event[NUM_CHANGE_EVENTS];         // change events
3254
3255   int trigger_player;           // player triggering change
3256   int trigger_side;             // side triggering change
3257   int trigger_page;             // page triggering change
3258
3259   int target_element;           // target element after change
3260
3261   int delay_fixed;              // added frame delay before changed (fixed)
3262   int delay_random;             // added frame delay before changed (random)
3263   int delay_frames;             // either 1 (frames) or 50 (seconds; 50 fps)
3264
3265   int initial_trigger_element;  // initial element triggering change
3266
3267   struct Content target_content;// elements for extended change target
3268   boolean use_target_content;   // use extended change target
3269   boolean only_if_complete;     // only use complete target content
3270   boolean use_random_replace;   // use random value for replacing elements
3271   int random_percentage;        // random value for replacing elements
3272   int replace_when;             // type of elements that can be replaced
3273
3274   boolean explode;              // explode instead of change
3275
3276   boolean has_action;           // execute action on specified condition
3277   int action_type;              // type of action
3278   int action_mode;              // mode of action
3279   int action_arg;               // parameter of action
3280   int action_element;           // element related to action
3281
3282   // ---------- internal values used at runtime when playing ----------
3283
3284   int trigger_element;          // element triggering change
3285
3286   /* functions that are called before, while and after the change of an
3287      element -- currently only used for non-custom elements */
3288   void (*pre_change_function)(int x, int y);
3289   void (*change_function)(int x, int y);
3290   void (*post_change_function)(int x, int y);
3291
3292   short actual_trigger_element; // element that actually triggered change
3293   int actual_trigger_side;      // element side that triggered the change
3294   int actual_trigger_player;    // player which actually triggered change
3295   int actual_trigger_player_bits; // player bits of triggering players
3296   int actual_trigger_ce_value;  // CE value of element that triggered change
3297   int actual_trigger_ce_score;  // CE score of element that triggered change
3298
3299   boolean can_change_or_has_action;     // can_change | has_action
3300
3301   // ---------- internal values used in level editor ----------
3302
3303   int direct_action;            // change triggered by actions on element
3304   int other_action;             // change triggered by other element actions
3305 };
3306
3307 struct ElementGroupInfo
3308 {
3309   int num_elements;                     // number of elements in this group
3310   int element[MAX_ELEMENTS_IN_GROUP];   // list of elements in this group
3311
3312   int choice_mode;              // how to choose element from group
3313
3314   // ---------- internal values used at runtime when playing ----------
3315
3316   /* the following is the same as above, but with recursively resolved group
3317      elements (group elements may also contain further group elements!) */
3318   int num_elements_resolved;
3319   short element_resolved[NUM_FILE_ELEMENTS];
3320
3321   int choice_pos;               // current element choice position
3322 };
3323
3324 struct ElementNameInfo
3325 {
3326   // ---------- token and description strings ----------
3327
3328   char *token_name;             // element token used in config files
3329   char *class_name;             // element class used in config files
3330   char *editor_description;     // pre-defined description for level editor
3331 };
3332
3333 struct ElementInfo
3334 {
3335   // ---------- token and description strings ----------
3336
3337   char *token_name;             // element token used in config files
3338   char *class_name;             // element class used in config files
3339   char *editor_description;     // pre-defined description for level editor
3340   char *custom_description;     // alternative description from config file
3341   char description[MAX_ELEMENT_NAME_LEN + 1];   // for custom/group elements
3342
3343   // ---------- graphic and sound definitions ----------
3344
3345   int graphic[NUM_ACTIONS];     // default graphics for several actions
3346   int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
3347                                 // special graphics for left/right/up/down
3348
3349   int crumbled[NUM_ACTIONS];    // crumbled graphics for several actions
3350   int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
3351                                 // crumbled graphics for left/right/up/down
3352
3353   int special_graphic[NUM_SPECIAL_GFX_ARGS];
3354                                 // special graphics for certain screens
3355
3356   int sound[NUM_ACTIONS];       // default sounds for several actions
3357
3358   // ---------- special element property values ----------
3359
3360   unsigned int properties[NUM_EP_BITFIELDS];    // element base properties
3361
3362   boolean use_gfx_element;      // use custom graphic element
3363   int gfx_element_initial;      // initial optional custom graphic element
3364
3365   int access_direction;         // accessible from which direction
3366
3367   int collect_score_initial;    // initial score value for collecting
3368   int collect_count_initial;    // initial count value for collecting
3369
3370   int ce_value_fixed_initial;   // initial value for custom variable (fix)
3371   int ce_value_random_initial;  // initial value for custom variable (rnd)
3372   boolean use_last_ce_value;    // use value from element before change
3373
3374   int push_delay_fixed;         // constant delay before pushing
3375   int push_delay_random;        // additional random delay before pushing
3376   int drop_delay_fixed;         // constant delay after dropping
3377   int drop_delay_random;        // additional random delay after dropping
3378   int move_delay_fixed;         // constant delay after moving
3379   int move_delay_random;        // additional random delay after moving
3380
3381   int move_pattern;             // direction movable element moves to
3382   int move_direction_initial;   // initial direction element moves to
3383   int move_stepsize;            // step size element moves with
3384
3385   int move_enter_element;       // element that can be entered (and removed)
3386   int move_leave_element;       // element that can be left behind
3387   int move_leave_type;          // change (limited) or leave (unlimited)
3388
3389   int slippery_type;            // how/where other elements slip away
3390
3391   struct Content content;       // new elements after explosion
3392
3393   int explosion_type;           // type of explosion, like 3x3, 3+3 or 1x1
3394   int explosion_delay;          // duration of explosion of this element
3395   int ignition_delay;           // delay for explosion by other explosion
3396
3397   struct ElementChangeInfo *change_page; // actual list of change pages
3398   struct ElementChangeInfo *change;      // pointer to current change page
3399
3400   int num_change_pages;         // actual number of change pages
3401   int current_change_page;      // currently edited change page
3402
3403   struct ElementGroupInfo *group;       // pointer to element group info
3404
3405   // ---------- internal values used at runtime when playing ----------
3406
3407   boolean has_change_event[NUM_CHANGE_EVENTS];
3408
3409   int event_page_nr[NUM_CHANGE_EVENTS]; // page number for each event
3410   struct ElementChangeInfo *event_page[NUM_CHANGE_EVENTS]; // page for event
3411
3412   boolean in_group[NUM_GROUP_ELEMENTS];
3413
3414   int gfx_element;              // runtime optional custom graphic element
3415
3416   int collect_score;            // runtime score value for collecting
3417
3418   // count of this element on playfield, calculated after each frame
3419   int element_count;
3420
3421   // ---------- internal values used in level editor ----------
3422
3423   int access_type;              // walkable or passable
3424   int access_layer;             // accessible over/inside/under
3425   int access_protected;         // protection against deadly elements
3426   int walk_to_action;           // diggable/collectible/pushable
3427   int smash_targets;            // can smash player/enemies/everything
3428   int deadliness;               // deadly when running/colliding/touching
3429
3430   boolean can_explode_by_fire;  // element explodes by fire
3431   boolean can_explode_smashed;  // element explodes when smashed
3432   boolean can_explode_impact;   // element explodes on impact
3433
3434   boolean modified_settings;    // set for all modified custom elements
3435 };
3436
3437 struct FontInfo
3438 {
3439   char *token_name;             // font token used in config files
3440
3441   int graphic;                  // default graphic for this font
3442   int special_graphic[NUM_SPECIAL_GFX_ARGS];
3443                                 // special graphics for certain screens
3444   int special_bitmap_id[NUM_SPECIAL_GFX_ARGS];
3445                                 // internal bitmap ID for special graphics
3446 };
3447
3448 struct GlobalAnimNameInfo
3449 {
3450   char *token_name;             // global animation token in config files
3451 };
3452
3453 struct GlobalAnimInfo
3454 {
3455   char *token_name;             // global animation token in config files
3456
3457   // global animation graphic and control definitions
3458   int graphic[NUM_GLOBAL_ANIM_PARTS_ALL][NUM_SPECIAL_GFX_ARGS];
3459
3460   // global animation sound and music definitions
3461   int sound[NUM_GLOBAL_ANIM_PARTS_ALL][NUM_SPECIAL_GFX_ARGS];
3462   int music[NUM_GLOBAL_ANIM_PARTS_ALL][NUM_SPECIAL_GFX_ARGS];
3463 };
3464
3465 struct GlobalAnimEventListInfo
3466 {
3467   int *event_value;
3468   int num_event_values;
3469 };
3470
3471 struct GlobalAnimEventInfo
3472 {
3473   struct GlobalAnimEventListInfo **event_list;
3474   int num_event_lists;
3475 };
3476
3477 struct GraphicInfo
3478 {
3479   Bitmap **bitmaps;             // bitmaps in all required sizes
3480   Bitmap *bitmap;               // bitmap in default size
3481
3482   int src_image_width;          // scaled bitmap size, but w/o small images
3483   int src_image_height;         // scaled bitmap size, but w/o small images
3484
3485   int src_x, src_y;             // start position of animation frames
3486   int width, height;            // width/height of each animation frame
3487
3488   int offset_x, offset_y;       // x/y offset to next animation frame
3489   int offset2_x, offset2_y;     // x/y offset to second movement tile
3490
3491   boolean double_movement;      // animation has second movement tile
3492   int swap_double_tiles;        // explicitely force or forbid tile swapping
3493
3494   int anim_frames;
3495   int anim_frames_per_line;
3496   int anim_start_frame;
3497   int anim_delay;               // important: delay of 1 means "no delay"!
3498   int anim_mode;
3499
3500   boolean anim_global_sync;
3501
3502   int crumbled_like;            // element for cloning crumble graphics
3503   int diggable_like;            // element for cloning digging graphics
3504
3505   int border_size;              // border size for "crumbled" graphics
3506
3507   int scale_up_factor;          // optional factor for scaling image up
3508   int tile_size;                // optional explicitly defined tile size
3509
3510   int clone_from;               // graphic for cloning *all* settings
3511
3512   int init_delay_fixed;         // optional initial delay values for global
3513   int init_delay_random;        // animations (pause interval before start)
3514   int init_delay_action;        // optional action called on animation start
3515   int anim_delay_fixed;         // optional delay values for bored/sleeping
3516   int anim_delay_random;        // and global animations (animation length)
3517   int anim_delay_action;        // optional action called on animation end
3518   int post_delay_fixed;         // optional delay values after bored/global
3519   int post_delay_random;        // animations (pause before next animation)
3520   int post_delay_action;        // optional action called after post delay
3521
3522   int init_event;               // optional event triggering animation start
3523   int init_event_action;        // optional action called on animation start
3524   int anim_event;               // optional event triggering animation end
3525   int anim_event_action;        // optional action called on animation end
3526
3527   int step_offset;              // optional step offset of toon animations
3528   int step_xoffset;             // optional step offset of toon animations
3529   int step_yoffset;             // optional step offset of toon animations
3530   int step_delay;               // optional step delay of toon animations
3531   int direction;                // optional move direction of toon animations
3532   int position;                 // optional draw position of toon animations
3533   int x;                        // optional draw position of toon animations
3534   int y;                        // optional draw position of toon animations
3535
3536   int draw_xoffset;             // optional offset for drawing font chars
3537   int draw_yoffset;             // optional offset for drawing font chars
3538
3539   int draw_masked;              // optional setting for drawing envelope gfx
3540   int draw_order;               // optional draw order for global animations
3541
3542   int fade_mode;                // optional setting for drawing title screens
3543   int fade_delay;               // optional setting for drawing title screens
3544   int post_delay;               // optional setting for drawing title screens
3545   int auto_delay;               // optional setting for drawing title screens
3546   int auto_delay_unit;          // optional setting for drawing title screens
3547   int align, valign;            // optional setting for drawing title screens
3548   int sort_priority;            // optional setting for drawing title screens
3549
3550   int class;
3551   int style;
3552
3553   int active_xoffset;
3554   int active_yoffset;
3555   int pressed_xoffset;
3556   int pressed_yoffset;
3557
3558   boolean use_image_size;       // use image size as default width and height
3559 };
3560
3561 struct SoundInfo
3562 {
3563   boolean loop;
3564   int volume;
3565   int priority;
3566 };
3567
3568 struct MusicInfo
3569 {
3570   boolean loop;
3571 };
3572
3573 struct MusicPrefixInfo
3574 {
3575   char *prefix;
3576   boolean is_loop_music;
3577 };
3578
3579 struct MusicFileInfo
3580 {
3581   char *basename;
3582
3583   char *title_header;
3584   char *artist_header;
3585   char *album_header;
3586   char *year_header;
3587
3588   char *title;
3589   char *artist;
3590   char *album;
3591   char *year;
3592
3593   int music;
3594
3595   boolean is_sound;
3596
3597   struct MusicFileInfo *next;
3598 };
3599
3600 struct ElementActionInfo
3601 {
3602   char *suffix;
3603   int value;
3604   boolean is_loop_sound;
3605 };
3606
3607 struct ElementDirectionInfo
3608 {
3609   char *suffix;
3610   int value;
3611 };
3612
3613 struct SpecialSuffixInfo
3614 {
3615   char *suffix;
3616   int value;
3617 };
3618
3619 struct HelpAnimInfo
3620 {
3621   int element;
3622   int action;
3623   int direction;
3624
3625   int delay;
3626 };
3627
3628
3629 extern Bitmap                  *bitmap_db_field;
3630 extern Bitmap                  *bitmap_db_panel;
3631 extern Bitmap                  *bitmap_db_door_1;
3632 extern Bitmap                  *bitmap_db_door_2;
3633 extern Bitmap                  *bitmap_db_store_1;
3634 extern Bitmap                  *bitmap_db_store_2;
3635 extern DrawBuffer              *fieldbuffer;
3636 extern DrawBuffer              *drawto_field;
3637
3638 extern int                      game_status;
3639 extern boolean                  game_status_last_screen;
3640 extern boolean                  level_editor_test_game;
3641 extern boolean                  network_playing;
3642
3643 extern int                      key_joystick_mapping;
3644
3645 extern short                    Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3646 extern short                    Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3647 extern short                    MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3648 extern short                    MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3649 extern short                    MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3650 extern short                    ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3651 extern short                    ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3652 extern short                    CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3653 extern short                    Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3654 extern short                    Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3655 extern short                    StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3656 extern short                    Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3657 extern boolean                  Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3658 extern boolean                  Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3659 extern short                    ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3660 extern short                    ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3661 extern short                    WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3662 extern short                    WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3663 extern short                    CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3664 extern short                    CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3665 extern short                    AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3666 extern short                    AmoebaCnt[MAX_NUM_AMOEBA];
3667 extern short                    AmoebaCnt2[MAX_NUM_AMOEBA];
3668 extern short                    ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3669 extern short                    ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3670 extern short                    ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3671 extern int                      RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3672 extern int                      PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3673
3674 extern int                      GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3675 extern int                      GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3676 extern int                      GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3677 extern int                      GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3678 extern int                      GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3679 extern int                      GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
3680
3681 extern int                      ActiveElement[MAX_NUM_ELEMENTS];
3682 extern int                      ActiveButton[NUM_IMAGE_FILES];
3683 extern int                      ActiveFont[NUM_FONTS];
3684
3685 extern int                      lev_fieldx, lev_fieldy;
3686 extern int                      scroll_x, scroll_y;
3687
3688 extern int                      WIN_XSIZE, WIN_YSIZE;
3689 extern int                      SCR_FIELDX, SCR_FIELDY;
3690 extern int                      REAL_SX, REAL_SY;
3691 extern int                      SX, SY;
3692 extern int                      DX, DY;
3693 extern int                      VX, VY;
3694 extern int                      EX, EY;
3695 extern int                      dDX, dDY;
3696 extern int                      FULL_SXSIZE, FULL_SYSIZE;
3697 extern int                      SXSIZE, SYSIZE;
3698 extern int                      DXSIZE, DYSIZE;
3699 extern int                      VXSIZE, VYSIZE;
3700 extern int                      EXSIZE, EYSIZE;
3701 extern int                      TILESIZE_VAR;
3702
3703 extern int                      FADE_SX, FADE_SY;
3704 extern int                      FADE_SXSIZE, FADE_SYSIZE;
3705
3706 extern int                      FX, FY;
3707 extern int                      ScrollStepSize;
3708 extern int                      ScreenMovDir, ScreenMovPos, ScreenGfxPos;
3709 extern int                      BorderElement;
3710 extern int                      MenuFrameDelay;
3711 extern int                      GameFrameDelay;
3712 extern int                      FfwdFrameDelay;
3713 extern int                      BX1, BY1;
3714 extern int                      BX2, BY2;
3715 extern int                      SBX_Left, SBX_Right;
3716 extern int                      SBY_Upper, SBY_Lower;
3717
3718 extern int                      TimeFrames, TimePlayed, TimeLeft, TapeTime;
3719
3720 extern boolean                  network_player_action_received;
3721
3722 extern int                      graphics_action_mapping[];
3723
3724 extern struct LevelInfo         level, level_template;
3725 extern struct HiScore           highscore[];
3726 extern struct TapeInfo          tape;
3727 extern struct GlobalInfo        global;
3728 extern struct BorderInfo        border;
3729 extern struct ViewportInfo      viewport;
3730 extern struct TitleFadingInfo   fading;
3731 extern struct TitleFadingInfo   fading_none;
3732 extern struct TitleFadingInfo   title_initial_first_default;
3733 extern struct TitleFadingInfo   title_initial_default;
3734 extern struct TitleFadingInfo   title_first_default;
3735 extern struct TitleFadingInfo   title_default;
3736 extern struct TitleMessageInfo  titlescreen_initial_first_default;
3737 extern struct TitleMessageInfo  titlescreen_initial_first[];
3738 extern struct TitleMessageInfo  titlescreen_initial_default;
3739 extern struct TitleMessageInfo  titlescreen_initial[];
3740 extern struct TitleMessageInfo  titlescreen_first_default;
3741 extern struct TitleMessageInfo  titlescreen_first[];
3742 extern struct TitleMessageInfo  titlescreen_default;
3743 extern struct TitleMessageInfo  titlescreen[];
3744 extern struct TitleMessageInfo  titlemessage_initial_first_default;
3745 extern struct TitleMessageInfo  titlemessage_initial_first[];
3746 extern struct TitleMessageInfo  titlemessage_initial_default;
3747 extern struct TitleMessageInfo  titlemessage_initial[];
3748 extern struct TitleMessageInfo  titlemessage_first_default;
3749 extern struct TitleMessageInfo  titlemessage_first[];
3750 extern struct TitleMessageInfo  titlemessage_default;
3751 extern struct TitleMessageInfo  titlemessage[];
3752 extern struct TitleMessageInfo  readme;
3753 extern struct InitInfo          init, init_last;
3754 extern struct MenuInfo          menu;
3755 extern struct DoorInfo          door_1, door_2;
3756 extern struct RequestInfo       request;
3757 extern struct PreviewInfo       preview;
3758 extern struct EditorInfo        editor;
3759 extern struct ElementInfo       element_info[];
3760 extern struct ElementNameInfo   element_name_info[];
3761 extern struct ElementActionInfo element_action_info[];
3762 extern struct ElementDirectionInfo element_direction_info[];
3763 extern struct SpecialSuffixInfo special_suffix_info[];
3764 extern struct TokenIntPtrInfo   image_config_vars[];
3765 extern struct FontInfo          font_info[];
3766 extern struct GlobalAnimInfo    global_anim_info[];
3767 extern struct GlobalAnimNameInfo global_anim_name_info[];
3768 extern struct GlobalAnimEventInfo global_anim_event_info;
3769 extern struct MusicPrefixInfo   music_prefix_info[];
3770 extern struct GraphicInfo      *graphic_info;
3771 extern struct SoundInfo        *sound_info;
3772 extern struct MusicInfo        *music_info;
3773 extern struct MusicFileInfo    *music_file_info;
3774 extern struct HelpAnimInfo     *helpanim_info;
3775 extern SetupFileHash           *helptext_info;
3776 extern SetupFileHash           *image_config_hash;
3777 extern SetupFileHash           *element_token_hash;
3778 extern SetupFileHash           *graphic_token_hash;
3779 extern SetupFileHash           *font_token_hash;
3780 extern SetupFileHash           *hide_setup_hash;
3781 extern struct ConfigTypeInfo    image_config_suffix[];
3782 extern struct ConfigTypeInfo    sound_config_suffix[];
3783 extern struct ConfigTypeInfo    music_config_suffix[];
3784 extern struct ConfigInfo        image_config[];
3785 extern struct ConfigInfo        sound_config[];
3786 extern struct ConfigInfo        music_config[];
3787 extern struct ConfigInfo        helpanim_config[];
3788 extern struct ConfigInfo        helptext_config[];
3789
3790 #endif  // MAIN_H