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