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