1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
14 #include "libgame/libgame.h"
23 Bitmap *bitmap_db_cross;
24 Bitmap *bitmap_db_field;
25 Bitmap *bitmap_db_panel;
26 Bitmap *bitmap_db_door;
27 Bitmap *bitmap_db_toons;
28 DrawBuffer *fieldbuffer;
29 DrawBuffer *drawto_field;
32 boolean level_editor_test_game = FALSE;
33 boolean network_playing = FALSE;
35 #if defined(TARGET_SDL)
36 boolean network_server = FALSE;
37 SDL_Thread *server_thread;
40 int key_joystick_mapping = 0;
42 boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
43 int redraw_x1 = 0, redraw_y1 = 0;
45 short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
46 short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
47 short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
48 short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
49 short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
50 short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
51 short CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
52 short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
53 short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
54 short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
55 short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
56 boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
57 boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
58 short ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
59 short ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
60 short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
61 short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
62 short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
63 short CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
64 short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
65 short AmoebaCnt[MAX_NUM_AMOEBA];
66 short AmoebaCnt2[MAX_NUM_AMOEBA];
67 short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
68 short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
69 short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
70 int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
71 int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
73 int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
74 int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
75 int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
76 int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
77 int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
78 int GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
80 int ActiveElement[MAX_NUM_ELEMENTS];
81 int ActiveButton[NUM_IMAGE_FILES];
82 int ActiveFont[NUM_FONTS];
84 int lev_fieldx, lev_fieldy;
85 int scroll_x, scroll_y;
89 int ScreenMovDir = MV_NONE, ScreenMovPos = 0;
91 int BorderElement = EL_STEELWALL;
92 int GameFrameDelay = GAME_FRAME_DELAY;
93 int FfwdFrameDelay = FFWD_FRAME_DELAY;
95 int BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1;
96 int SBX_Left, SBX_Right;
97 int SBY_Upper, SBY_Lower;
102 int TimeFrames, TimePlayed, TimeLeft, TapeTime;
104 boolean network_player_action_received = FALSE;
106 struct LevelSetInfo levelset;
107 struct LevelInfo level, level_template;
108 struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
109 struct HiScore highscore[MAX_SCORE_ENTRIES];
110 struct TapeInfo tape;
111 struct SetupInfo setup;
112 struct GameInfo game;
113 struct GlobalInfo global;
114 struct BorderInfo border;
115 struct TitleFadingInfo fading;
116 struct TitleFadingInfo title_initial_default;
117 struct TitleFadingInfo title_default;
118 struct TitleMessageInfo titlemessage_initial_default;
119 struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES];
120 struct TitleMessageInfo titlemessage_default;
121 struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES];
122 struct TitleMessageInfo readme;
123 struct InitInfo init;
124 struct MenuInfo menu;
125 struct DoorInfo door_1, door_2;
126 struct PreviewInfo preview;
127 struct GraphicInfo *graphic_info = NULL;
128 struct SoundInfo *sound_info = NULL;
129 struct MusicInfo *music_info = NULL;
130 struct MusicFileInfo *music_file_info = NULL;
131 struct HelpAnimInfo *helpanim_info = NULL;
132 SetupFileHash *helptext_info = NULL;
133 SetupFileHash *image_config_hash = NULL;
134 SetupFileHash *element_token_hash = NULL;
135 SetupFileHash *graphic_token_hash = NULL;
136 SetupFileHash *font_token_hash = NULL;
139 /* ------------------------------------------------------------------------- */
140 /* element definitions */
141 /* ------------------------------------------------------------------------- */
143 struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1];
145 /* this contains predefined structure elements to initialize "element_info" */
146 struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
148 /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */
150 /* ----------------------------------------------------------------------- */
151 /* "real" level file elements */
152 /* ----------------------------------------------------------------------- */
202 "bug (random start direction)"
207 "spaceship (random start direction)"
212 "yam yam (random start direction)"
242 "quicksand (with rock)"
272 "dropping amoeba (EM style)"
287 "Conway's wall of life"
310 "robot_wheel.active",
312 "magic wheel (running)"
357 "gray door (opened by key 1)"
362 "gray door (opened by key 2)"
367 "gray door (opened by key 3)"
372 "gray door (opened by key 4)"
382 "pac man (random start direction)"
387 "invisible normal wall"
412 "amoeba with content"
432 "growing wall (horizontal, visible)"
447 "wall with BD style diamond"
450 "wall_emerald_yellow",
452 "wall with yellow emerald"
462 "magic wall (BD style)"
465 "invisible_steelwall",
467 "invisible steel wall"
470 "sokoban_field_player",
472 "sokoban field with player"
475 "dynabomb_increase_number",
477 "increases number of bombs"
480 "dynabomb_increase_size",
482 "increases explosion size"
485 "dynabomb_increase_power",
487 "increases power of explosion"
495 "sokoban_field_empty",
497 "sokoban empty field"
500 "sokoban_field_full",
502 "sokoban field with object"
505 "bd_butterfly.right",
507 "butterfly (starts moving right)"},
511 "butterfly (starts moving up)"
516 "butterfly (starts moving left)"},
520 "butterfly (starts moving down)"},
524 "firefly (starts moving right)"
529 "firefly (starts moving up)"
534 "firefly (starts moving left)"
539 "firefly (starts moving down)"
544 "butterfly (random start direction)"
549 "firefly (random start direction)"
574 "bug (starts moving right)"
579 "bug (starts moving up)"
584 "bug (starts moving left)"
589 "bug (starts moving down)"
594 "spaceship (starts moving right)"},
598 "spaceship (starts moving up)"
603 "spaceship (starts moving left)"},
607 "spaceship (starts moving down)"},
611 "pac man (starts moving right)"
616 "pac man (starts moving up)"
621 "pac man (starts moving left)"
626 "pac man (starts moving down)"
641 "wall with red emerald"
644 "wall_emerald_purple",
646 "wall with purple emerald"
651 "acid pool (top left)"
654 "acid_pool_topright",
656 "acid pool (top right)"
659 "acid_pool_bottomleft",
661 "acid pool (bottom left)"
669 "acid_pool_bottomright",
671 "acid pool (bottom right)"
676 "normal wall (BD style)"
701 "mole (random start direction)"
741 "fire breathing dragon"
744 "em_key_1_file_obsolete",
1054 "char_bracketright",
1149 "expandable_wall_horizontal",
1151 "growing wall (horizontal)"
1154 "expandable_wall_vertical",
1156 "growing wall (vertical)"
1159 "expandable_wall_any",
1161 "growing wall (any direction)"
1184 "em_key_2_file_obsolete",
1189 "em_key_3_file_obsolete",
1194 "em_key_4_file_obsolete",
1246 "port (leading right)"
1251 "port (leading down)"
1256 "port (leading left)"
1264 "sp_gravity_port_right",
1266 "gravity-on/off port (leading right)"
1269 "sp_gravity_port_down",
1271 "gravity-on/off port (leading down)"
1274 "sp_gravity_port_left",
1276 "gravity-on/off port (leading left)"
1279 "sp_gravity_port_up",
1281 "gravity-on/off port (leading up)"
1309 "sp_port_horizontal",
1316 "port (any direction)"
1339 "sp_hardware_base_1",
1344 "sp_hardware_green",
1359 "sp_hardware_yellow",
1364 "sp_hardware_base_2",
1369 "sp_hardware_base_3",
1374 "sp_hardware_base_4",
1379 "sp_hardware_base_5",
1384 "sp_hardware_base_6",
1401 "gray door (EM style, key 1)"
1406 "gray door (EM style, key 2)"
1411 "gray door (EM style, key 3)"
1416 "gray door (EM style, key 4)"
1421 "dynamite (EM style)"
1424 "em_dynamite.active",
1426 "burning dynamite (EM style)"
1454 "dc_gate_white_gray",
1456 "gray door (opened by white key)"
1476 "switch gate (open)"
1479 "switchgate_closed",
1481 "switch gate (closed)"
1484 "switchgate_switch_up",
1485 "switchgate_switch",
1486 "switch for switch gate"
1489 "switchgate_switch_down",
1490 "switchgate_switch",
1491 "switch for switch gate"
1504 "conveyor_belt_1_left",
1506 "conveyor belt 1 (left)"
1509 "conveyor_belt_1_middle",
1511 "conveyor belt 1 (middle)"
1514 "conveyor_belt_1_right",
1516 "conveyor belt 1 (right)"
1519 "conveyor_belt_1_switch_left",
1520 "conveyor_belt_switch",
1521 "switch for conveyor belt 1 (left)"
1524 "conveyor_belt_1_switch_middle",
1525 "conveyor_belt_switch",
1526 "switch for conveyor belt 1 (middle)"
1529 "conveyor_belt_1_switch_right",
1530 "conveyor_belt_switch",
1531 "switch for conveyor belt 1 (right)"
1534 "conveyor_belt_2_left",
1536 "conveyor belt 2 (left)"
1539 "conveyor_belt_2_middle",
1541 "conveyor belt 2 (middle)"
1544 "conveyor_belt_2_right",
1546 "conveyor belt 2 (right)"
1549 "conveyor_belt_2_switch_left",
1550 "conveyor_belt_switch",
1551 "switch for conveyor belt 2 (left)"
1554 "conveyor_belt_2_switch_middle",
1555 "conveyor_belt_switch",
1556 "switch for conveyor belt 2 (middle)"
1559 "conveyor_belt_2_switch_right",
1560 "conveyor_belt_switch",
1561 "switch for conveyor belt 2 (right)"
1564 "conveyor_belt_3_left",
1566 "conveyor belt 3 (left)"
1569 "conveyor_belt_3_middle",
1571 "conveyor belt 3 (middle)"
1574 "conveyor_belt_3_right",
1576 "conveyor belt 3 (right)"
1579 "conveyor_belt_3_switch_left",
1580 "conveyor_belt_switch",
1581 "switch for conveyor belt 3 (left)"
1584 "conveyor_belt_3_switch_middle",
1585 "conveyor_belt_switch",
1586 "switch for conveyor belt 3 (middle)"
1589 "conveyor_belt_3_switch_right",
1590 "conveyor_belt_switch",
1591 "switch for conveyor belt 3 (right)"
1594 "conveyor_belt_4_left",
1596 "conveyor belt 4 (left)"
1599 "conveyor_belt_4_middle",
1601 "conveyor belt 4 (middle)"
1604 "conveyor_belt_4_right",
1606 "conveyor belt 4 (right)"
1609 "conveyor_belt_4_switch_left",
1610 "conveyor_belt_switch",
1611 "switch for conveyor belt 4 (left)"
1614 "conveyor_belt_4_switch_middle",
1615 "conveyor_belt_switch",
1616 "switch for conveyor belt 4 (middle)"
1619 "conveyor_belt_4_switch_right",
1620 "conveyor_belt_switch",
1621 "switch for conveyor belt 4 (right)"
1626 "land mine (not removable)"
1629 "envelope_obsolete",
1631 "envelope (OBSOLETE)"
1636 "light switch (off)"
1639 "light_switch.active",
1646 "sign (exclamation)"
1649 "sign_radioactivity",
1651 "sign (radio activity)"
1661 "sign (wheel chair)"
1684 "sign_entry_forbidden",
1686 "sign (entry forbidden)"
1689 "sign_emergency_exit",
1691 "sign (emergency exit)"
1706 "mole (starts moving left)"
1711 "mole (starts moving right)"
1716 "mole (starts moving up)"
1721 "mole (starts moving down)"
1724 "steelwall_slippery",
1726 "slippery steel wall"
1736 "dx unknown element 15"
1741 "dx unknown element 42"
1756 "shield (deadly, kills enemies)"
1766 "time gate (closed)"
1769 "timegate_switch.active",
1771 "switch for time gate"
1776 "switch for time gate"
1784 "balloon_switch_left",
1786 "wind switch (left)"
1789 "balloon_switch_right",
1791 "wind switch (right)"
1794 "balloon_switch_up",
1799 "balloon_switch_down",
1801 "wind switch (down)"
1804 "balloon_switch_any",
1806 "wind switch (any direction)"
1871 "tube (any direction)"
1884 "tube_vertical_left",
1886 "tube (vertical & left)"
1889 "tube_vertical_right",
1891 "tube (vertical & right)"
1894 "tube_horizontal_up",
1896 "tube (horizontal & up)"
1899 "tube_horizontal_down",
1901 "tube (horizontal & down)"
1911 "tube (left & down)"
1921 "tube (right & down)"
1936 "stable bomb (DX style)"
2446 "custom element 100"
2451 "custom element 101"
2456 "custom element 102"
2461 "custom element 103"
2466 "custom element 104"
2471 "custom element 105"
2476 "custom element 106"
2481 "custom element 107"
2486 "custom element 108"
2491 "custom element 109"
2496 "custom element 110"
2501 "custom element 111"
2506 "custom element 112"
2511 "custom element 113"
2516 "custom element 114"
2521 "custom element 115"
2526 "custom element 116"
2531 "custom element 117"
2536 "custom element 118"
2541 "custom element 119"
2546 "custom element 120"
2551 "custom element 121"
2556 "custom element 122"
2561 "custom element 123"
2566 "custom element 124"
2571 "custom element 125"
2576 "custom element 126"
2581 "custom element 127"
2586 "custom element 128"
2591 "custom element 129"
2596 "custom element 130"
2601 "custom element 131"
2606 "custom element 132"
2611 "custom element 133"
2616 "custom element 134"
2621 "custom element 135"
2626 "custom element 136"
2631 "custom element 137"
2636 "custom element 138"
2641 "custom element 139"
2646 "custom element 140"
2651 "custom element 141"
2656 "custom element 142"
2661 "custom element 143"
2666 "custom element 144"
2671 "custom element 145"
2676 "custom element 146"
2681 "custom element 147"
2686 "custom element 148"
2691 "custom element 149"
2696 "custom element 150"
2701 "custom element 151"
2706 "custom element 152"
2711 "custom element 153"
2716 "custom element 154"
2721 "custom element 155"
2726 "custom element 156"
2731 "custom element 157"
2736 "custom element 158"
2741 "custom element 159"
2746 "custom element 160"
2751 "custom element 161"
2756 "custom element 162"
2761 "custom element 163"
2766 "custom element 164"
2771 "custom element 165"
2776 "custom element 166"
2781 "custom element 167"
2786 "custom element 168"
2791 "custom element 169"
2796 "custom element 170"
2801 "custom element 171"
2806 "custom element 172"
2811 "custom element 173"
2816 "custom element 174"
2821 "custom element 175"
2826 "custom element 176"
2831 "custom element 177"
2836 "custom element 178"
2841 "custom element 179"
2846 "custom element 180"
2851 "custom element 181"
2856 "custom element 182"
2861 "custom element 183"
2866 "custom element 184"
2871 "custom element 185"
2876 "custom element 186"
2881 "custom element 187"
2886 "custom element 188"
2891 "custom element 189"
2896 "custom element 190"
2901 "custom element 191"
2906 "custom element 192"
2911 "custom element 193"
2916 "custom element 194"
2921 "custom element 195"
2926 "custom element 196"
2931 "custom element 197"
2936 "custom element 198"
2941 "custom element 199"
2946 "custom element 200"
2951 "custom element 201"
2956 "custom element 202"
2961 "custom element 203"
2966 "custom element 204"
2971 "custom element 205"
2976 "custom element 206"
2981 "custom element 207"
2986 "custom element 208"
2991 "custom element 209"
2996 "custom element 210"
3001 "custom element 211"
3006 "custom element 212"
3011 "custom element 213"
3016 "custom element 214"
3021 "custom element 215"
3026 "custom element 216"
3031 "custom element 217"
3036 "custom element 218"
3041 "custom element 219"
3046 "custom element 220"
3051 "custom element 221"
3056 "custom element 222"
3061 "custom element 223"
3066 "custom element 224"
3071 "custom element 225"
3076 "custom element 226"
3081 "custom element 227"
3086 "custom element 228"
3091 "custom element 229"
3096 "custom element 230"
3101 "custom element 231"
3106 "custom element 232"
3111 "custom element 233"
3116 "custom element 234"
3121 "custom element 235"
3126 "custom element 236"
3131 "custom element 237"
3136 "custom element 238"
3141 "custom element 239"
3146 "custom element 240"
3151 "custom element 241"
3156 "custom element 242"
3161 "custom element 243"
3166 "custom element 244"
3171 "custom element 245"
3176 "custom element 246"
3181 "custom element 247"
3186 "custom element 248"
3191 "custom element 249"
3196 "custom element 250"
3201 "custom element 251"
3206 "custom element 252"
3211 "custom element 253"
3216 "custom element 254"
3221 "custom element 255"
3226 "custom element 256"
3436 "element triggering change"
3441 "player triggering change"
3444 "sp_gravity_on_port_right",
3445 "sp_gravity_on_port",
3446 "gravity-on port (leading right)"
3449 "sp_gravity_on_port_down",
3450 "sp_gravity_on_port",
3451 "gravity-on port (leading down)"
3454 "sp_gravity_on_port_left",
3455 "sp_gravity_on_port",
3456 "gravity-on port (leading left)"
3459 "sp_gravity_on_port_up",
3460 "sp_gravity_on_port",
3461 "gravity-on port (leading up)"
3464 "sp_gravity_off_port_right",
3465 "sp_gravity_off_port",
3466 "gravity-off port (leading right)"
3469 "sp_gravity_off_port_down",
3470 "sp_gravity_off_port",
3471 "gravity-off port (leading down)"
3474 "sp_gravity_off_port_left",
3475 "sp_gravity_off_port",
3476 "gravity-off port (leading left)"
3479 "sp_gravity_off_port_up",
3480 "sp_gravity_off_port",
3481 "gravity-off port (leading up)"
3484 "balloon_switch_none",
3491 "door 5 (EMC style)",
3496 "door 6 (EMC style)",
3501 "door 7 (EMC style)",
3506 "door 8 (EMC style)",
3511 "gray door (EMC style, key 5)",
3516 "gray door (EMC style, key 6)",
3521 "gray door (EMC style, key 7)",
3526 "gray door (EMC style, key 8)",
3531 "key 5 (EMC style)",
3536 "key 6 (EMC style)",
3541 "key 7 (EMC style)",
3546 "key 8 (EMC style)",
3564 "emc_magic_ball.active",
3566 "magic ball (activated)",
3569 "emc_magic_ball_switch",
3570 "emc_magic_ball_switch",
3571 "magic ball switch (off)",
3574 "emc_magic_ball_switch.active",
3575 "emc_magic_ball_switch",
3576 "magic ball switch (on)",
3579 "emc_spring_bumper",
3580 "emc_spring_bumper",
3639 "emc_wall_slippery_1",
3644 "emc_wall_slippery_2",
3649 "emc_wall_slippery_3",
3654 "emc_wall_slippery_4",
3676 "CE value of element triggering change"
3681 "CE score of element triggering change"
3686 "CE value of current element"
3691 "CE score of current element"
3696 "yam yam (starts moving left)"
3701 "yam yam (starts moving right)"
3706 "yam yam (starts moving up)"
3711 "yam yam (starts moving down)"
3714 "bd_expandable_wall",
3716 "growing wall (horizontal, BD style)"
3721 "CE 8 positions earlier in list"
3726 "CE 7 positions earlier in list"
3731 "CE 6 positions earlier in list"
3736 "CE 5 positions earlier in list"
3741 "CE 4 positions earlier in list"
3746 "CE 3 positions earlier in list"
3751 "CE 2 positions earlier in list"
3756 "CE 1 position earlier in list"
3761 "the current custom element"
3766 "CE 1 position later in list"
3771 "CE 2 positions later in list"
3776 "CE 3 positions later in list"
3781 "CE 4 positions later in list"
3786 "CE 5 positions later in list"
3791 "CE 6 positions later in list"
3796 "CE 7 positions later in list"
3801 "CE 8 positions later in list"
3806 "this element matches any element"
3814 "steel_char_exclam",
3819 "steel_char_quotedbl",
3824 "steel_char_numbersign",
3829 "steel_char_dollar",
3834 "steel_char_percent",
3839 "steel_char_ampersand",
3844 "steel_char_apostrophe",
3849 "steel_char_parenleft",
3854 "steel_char_parenright",
3859 "steel_char_asterisk",
3879 "steel_char_period",
3944 "steel_char_semicolon",
3959 "steel_char_greater",
3964 "steel_char_question",
4104 "steel_char_bracketleft",
4109 "steel_char_backslash",
4114 "steel_char_bracketright",
4119 "steel_char_asciicircum",
4124 "steel_char_underscore",
4129 "steel_char_copyright",
4134 "steel_char_aumlaut",
4139 "steel_char_oumlaut",
4144 "steel_char_uumlaut",
4149 "steel_char_degree",
4154 "steel_char_trademark",
4159 "steel_char_cursor",
4164 "steel_char_unused",
4169 "steel_char_unused",
4174 "steel_char_unused",
4179 "steel_char_unused",
4184 "steel_char_unused",
4189 "steel_char_unused",
4194 "steel_char_unused",
4196 "steel letter 'button'"
4199 "steel_char_unused",
4204 "steel_char_unused",
4206 "steel letter 'down'"
4259 "steel_exit_closed",
4269 "dc_steelwall_1_left",
4274 "dc_steelwall_1_right",
4276 "steel wall (right)"
4279 "dc_steelwall_1_top",
4284 "dc_steelwall_1_bottom",
4286 "steel wall (bottom)"
4289 "dc_steelwall_1_horizontal",
4291 "steel wall (top/bottom)"
4294 "dc_steelwall_1_vertical",
4296 "steel wall (left/right)"
4299 "dc_steelwall_1_topleft",
4301 "steel wall (top/left)"
4304 "dc_steelwall_1_topright",
4306 "steel wall (top/right)"
4309 "dc_steelwall_1_bottomleft",
4311 "steel wall (bottom/left)"
4314 "dc_steelwall_1_bottomright",
4316 "steel wall (bottom/right)"
4319 "dc_steelwall_1_topleft_2",
4321 "steel wall (top/left corner)"
4324 "dc_steelwall_1_topright_2",
4326 "steel wall (top/right corner)"
4329 "dc_steelwall_1_bottomleft_2",
4331 "steel wall (bottom/left corner)"
4334 "dc_steelwall_1_bottomright_2",
4336 "steel wall (bottom/right corner)"
4339 "dc_steelwall_2_left",
4344 "dc_steelwall_2_right",
4346 "steel wall (right)"
4349 "dc_steelwall_2_top",
4354 "dc_steelwall_2_bottom",
4356 "steel wall (bottom)"
4359 "dc_steelwall_2_horizontal",
4361 "steel wall (horizontal)"
4364 "dc_steelwall_2_vertical",
4366 "steel wall (vertical)"
4369 "dc_steelwall_2_middle",
4371 "steel wall (middle)"
4374 "dc_steelwall_2_single",
4376 "steel wall (single)"
4379 "dc_switchgate_switch_up",
4380 "switchgate_switch",
4381 "switch for switch gate (steel)"
4384 "dc_switchgate_switch_down",
4385 "switchgate_switch",
4386 "switch for switch gate (steel)"
4389 "dc_timegate_switch",
4391 "switch for time gate (steel)"
4394 "dc_timegate_switch.active",
4396 "switch for time gate (steel)"
4401 "land mine (DC style, removable)"
4404 "expandable_steelwall",
4406 "growing steel wall"
4409 "expandable_steelwall_horizontal",
4411 "growing steel wall (horizontal)"
4414 "expandable_steelwall_vertical",
4416 "growing steel wall (vertical)"
4419 "expandable_steelwall_any",
4421 "growing steel wall (any direction)"
4426 "closed exit (EM style)"
4431 "open exit (EM style)"
4434 "em_steel_exit_closed",
4436 "closed steel exit (EM style)"
4439 "em_steel_exit_open",
4441 "open steel exit (EM style)"
4444 "dc_gate_fake_gray",
4446 "gray door (opened by no key)"
4451 "magic wall (DC style)"
4454 "quicksand_fast_empty",
4456 "fast quicksand (empty)"
4459 "quicksand_fast_full",
4461 "fast quicksand (with rock)"
4464 "from_level_template",
4465 "from_level_template",
4466 "element taken from level template"
4469 /* ----------------------------------------------------------------------- */
4470 /* "real" (and therefore drawable) runtime elements */
4471 /* ----------------------------------------------------------------------- */
4474 "dynabomb_player_1.active",
4479 "dynabomb_player_2.active",
4484 "dynabomb_player_3.active",
4489 "dynabomb_player_4.active",
4494 "sp_disk_red.active",
4499 "switchgate.opening",
4504 "switchgate.closing",
4529 "invisible_steelwall.active",
4534 "invisible_wall.active",
4539 "invisible_sand.active",
4544 "conveyor_belt_1_left.active",
4549 "conveyor_belt_1_middle.active",
4554 "conveyor_belt_1_right.active",
4559 "conveyor_belt_2_left.active",
4564 "conveyor_belt_2_middle.active",
4569 "conveyor_belt_2_right.active",
4574 "conveyor_belt_3_left.active",
4579 "conveyor_belt_3_middle.active",
4584 "conveyor_belt_3_right.active",
4589 "conveyor_belt_4_left.active",
4594 "conveyor_belt_4_middle.active",
4599 "conveyor_belt_4_right.active",
4614 "steel_exit.opening",
4619 "steel_exit.closing",
4634 "em_steel_exit.opening",
4639 "em_steel_exit.closing",
4659 "sp_terminal.active",
4664 "sp_buggy_base.activating",
4669 "sp_buggy_base.active",
4684 "quicksand.emptying",
4689 "quicksand_fast.emptying",
4694 "magic_wall.active",
4699 "bd_magic_wall.active",
4704 "dc_magic_wall.active",
4714 "bd_magic_wall_full",
4719 "dc_magic_wall_full",
4724 "magic_wall.emptying",
4729 "bd_magic_wall.emptying",
4734 "dc_magic_wall.emptying",
4744 "bd_magic_wall_dead",
4749 "dc_magic_wall_dead",
4755 "emc_fake_grass.active",
4760 "gate_1_gray.active",
4765 "gate_2_gray.active",
4770 "gate_3_gray.active",
4775 "gate_4_gray.active",
4780 "em_gate_1_gray.active",
4785 "em_gate_2_gray.active",
4790 "em_gate_3_gray.active",
4795 "em_gate_4_gray.active",
4800 "emc_gate_5_gray.active",
4805 "emc_gate_6_gray.active",
4810 "emc_gate_7_gray.active",
4815 "emc_gate_8_gray.active",
4820 "dc_gate_white_gray.active",
4825 "emc_dripper.active",
4830 "emc_spring_bumper.active",
4831 "emc_spring_bumper",
4835 /* ----------------------------------------------------------------------- */
4836 /* "unreal" (and therefore not drawable) runtime elements */
4837 /* ----------------------------------------------------------------------- */
4865 "acid_splash_right",
4880 "expandable_wall.growing",
4885 "expandable_steelwall.growing",
4895 "player_is_leaving",
4900 "player_is_exploding_1",
4905 "player_is_exploding_2",
4910 "player_is_exploding_3",
4915 "player_is_exploding_4",
4920 "quicksand.filling",
4925 "quicksand_fast.filling",
4930 "magic_wall.filling",
4935 "bd_magic_wall.filling",
4940 "dc_magic_wall.filling",
4950 "diagonal.shrinking",
4960 /* ----------------------------------------------------------------------- */
4961 /* dummy elements (never used as game elements, only used as graphics) */
4962 /* ----------------------------------------------------------------------- */
4965 "steelwall_topleft",
4970 "steelwall_topright",
4975 "steelwall_bottomleft",
4980 "steelwall_bottomright",
4985 "steelwall_horizontal",
4990 "steelwall_vertical",
4995 "invisible_steelwall_topleft",
5000 "invisible_steelwall_topright",
5005 "invisible_steelwall_bottomleft",
5010 "invisible_steelwall_bottomright",
5015 "invisible_steelwall_horizontal",
5020 "invisible_steelwall_vertical",
5035 "dynabomb_player_1",
5040 "dynabomb_player_2",
5045 "dynabomb_player_3",
5050 "dynabomb_player_4",
5055 "shield_normal.active",
5060 "shield_deadly.active",
5130 "internal_clipboard_custom",
5132 "empty custom element"
5135 "internal_clipboard_change",
5140 "internal_clipboard_group",
5142 "empty group element"
5150 "internal_cascade_bd",
5152 "show Boulder Dash elements"
5155 "internal_cascade_bd.active",
5157 "hide Boulder Dash elements"
5160 "internal_cascade_em",
5162 "show Emerald Mine elements"
5165 "internal_cascade_em.active",
5167 "hide Emerald Mine elements"
5170 "internal_cascade_emc",
5172 "show Emerald Mine Club elements"
5175 "internal_cascade_emc.active",
5177 "hide Emerald Mine Club elements"
5180 "internal_cascade_rnd",
5182 "show Rocks'n'Diamonds elements"
5185 "internal_cascade_rnd.active",
5187 "hide Rocks'n'Diamonds elements"
5190 "internal_cascade_sb",
5192 "show Sokoban elements"
5195 "internal_cascade_sb.active",
5197 "hide Sokoban elements"
5200 "internal_cascade_sp",
5202 "show Supaplex elements"
5205 "internal_cascade_sp.active",
5207 "hide Supaplex elements"
5210 "internal_cascade_dc",
5212 "show Diamond Caves II elements"
5215 "internal_cascade_dc.active",
5217 "hide Diamond Caves II elements"
5220 "internal_cascade_dx",
5222 "show DX Boulderdash elements"
5225 "internal_cascade_dx.active",
5227 "hide DX Boulderdash elements"
5230 "internal_cascade_chars",
5232 "show text elements"
5235 "internal_cascade_chars.active",
5237 "hide text elements"
5240 "internal_cascade_steel_chars",
5242 "show steel text elements"
5245 "internal_cascade_steel_chars.active",
5247 "hide steel text elements"
5250 "internal_cascade_ce",
5252 "show custom elements"
5255 "internal_cascade_ce.active",
5257 "hide custom elements"
5260 "internal_cascade_ge",
5262 "show group elements"
5265 "internal_cascade_ge.active",
5267 "hide group elements"
5270 "internal_cascade_ref",
5272 "show reference elements"
5275 "internal_cascade_ref.active",
5277 "hide reference elements"
5280 "internal_cascade_user",
5282 "show user defined elements"
5285 "internal_cascade_user.active",
5287 "hide user defined elements"
5290 "internal_cascade_dynamic",
5292 "show elements used in this level"
5295 "internal_cascade_dynamic.active",
5297 "hide elements used in this level"
5300 /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
5310 /* ------------------------------------------------------------------------- */
5311 /* element action and direction definitions */
5312 /* ------------------------------------------------------------------------- */
5314 struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
5316 { ".[DEFAULT]", ACTION_DEFAULT, TRUE },
5317 { ".waiting", ACTION_WAITING, TRUE },
5318 { ".falling", ACTION_FALLING, TRUE },
5319 { ".moving", ACTION_MOVING, TRUE },
5320 { ".digging", ACTION_DIGGING, FALSE },
5321 { ".snapping", ACTION_SNAPPING, FALSE },
5322 { ".collecting", ACTION_COLLECTING, FALSE },
5323 { ".dropping", ACTION_DROPPING, FALSE },
5324 { ".pushing", ACTION_PUSHING, FALSE },
5325 { ".walking", ACTION_WALKING, FALSE },
5326 { ".passing", ACTION_PASSING, FALSE },
5327 { ".impact", ACTION_IMPACT, FALSE },
5328 { ".breaking", ACTION_BREAKING, FALSE },
5329 { ".activating", ACTION_ACTIVATING, FALSE },
5330 { ".deactivating", ACTION_DEACTIVATING, FALSE },
5331 { ".opening", ACTION_OPENING, FALSE },
5332 { ".closing", ACTION_CLOSING, FALSE },
5333 { ".attacking", ACTION_ATTACKING, TRUE },
5334 { ".growing", ACTION_GROWING, TRUE },
5335 { ".shrinking", ACTION_SHRINKING, FALSE },
5336 { ".active", ACTION_ACTIVE, TRUE },
5337 { ".filling", ACTION_FILLING, FALSE },
5338 { ".emptying", ACTION_EMPTYING, FALSE },
5339 { ".changing", ACTION_CHANGING, FALSE },
5340 { ".exploding", ACTION_EXPLODING, FALSE },
5341 { ".boring", ACTION_BORING, FALSE },
5342 { ".boring[1]", ACTION_BORING_1, FALSE },
5343 { ".boring[2]", ACTION_BORING_2, FALSE },
5344 { ".boring[3]", ACTION_BORING_3, FALSE },
5345 { ".boring[4]", ACTION_BORING_4, FALSE },
5346 { ".boring[5]", ACTION_BORING_5, FALSE },
5347 { ".boring[6]", ACTION_BORING_6, FALSE },
5348 { ".boring[7]", ACTION_BORING_7, FALSE },
5349 { ".boring[8]", ACTION_BORING_8, FALSE },
5350 { ".boring[9]", ACTION_BORING_9, FALSE },
5351 { ".boring[10]", ACTION_BORING_10, FALSE },
5352 { ".sleeping", ACTION_SLEEPING, FALSE },
5353 { ".sleeping[1]", ACTION_SLEEPING_1, FALSE },
5354 { ".sleeping[2]", ACTION_SLEEPING_2, FALSE },
5355 { ".sleeping[3]", ACTION_SLEEPING_3, FALSE },
5356 { ".awakening", ACTION_AWAKENING, FALSE },
5357 { ".dying", ACTION_DYING, FALSE },
5358 { ".turning", ACTION_TURNING, FALSE },
5359 { ".turning_from_left", ACTION_TURNING_FROM_LEFT, FALSE },
5360 { ".turning_from_right", ACTION_TURNING_FROM_RIGHT, FALSE },
5361 { ".turning_from_up", ACTION_TURNING_FROM_UP, FALSE },
5362 { ".turning_from_down", ACTION_TURNING_FROM_DOWN, FALSE },
5363 { ".smashed_by_rock", ACTION_SMASHED_BY_ROCK, FALSE },
5364 { ".smashed_by_spring", ACTION_SMASHED_BY_SPRING, FALSE },
5365 { ".eating", ACTION_EATING, FALSE },
5366 { ".twinkling", ACTION_TWINKLING, FALSE },
5367 { ".splashing", ACTION_SPLASHING, FALSE },
5368 { ".page[1]", ACTION_PAGE_1, FALSE },
5369 { ".page[2]", ACTION_PAGE_2, FALSE },
5370 { ".page[3]", ACTION_PAGE_3, FALSE },
5371 { ".page[4]", ACTION_PAGE_4, FALSE },
5372 { ".page[5]", ACTION_PAGE_5, FALSE },
5373 { ".page[6]", ACTION_PAGE_6, FALSE },
5374 { ".page[7]", ACTION_PAGE_7, FALSE },
5375 { ".page[8]", ACTION_PAGE_8, FALSE },
5376 { ".page[9]", ACTION_PAGE_9, FALSE },
5377 { ".page[10]", ACTION_PAGE_10, FALSE },
5378 { ".page[11]", ACTION_PAGE_11, FALSE },
5379 { ".page[12]", ACTION_PAGE_12, FALSE },
5380 { ".page[13]", ACTION_PAGE_13, FALSE },
5381 { ".page[14]", ACTION_PAGE_14, FALSE },
5382 { ".page[15]", ACTION_PAGE_15, FALSE },
5383 { ".page[16]", ACTION_PAGE_16, FALSE },
5384 { ".page[17]", ACTION_PAGE_17, FALSE },
5385 { ".page[18]", ACTION_PAGE_18, FALSE },
5386 { ".page[19]", ACTION_PAGE_19, FALSE },
5387 { ".page[20]", ACTION_PAGE_20, FALSE },
5388 { ".page[21]", ACTION_PAGE_21, FALSE },
5389 { ".page[22]", ACTION_PAGE_22, FALSE },
5390 { ".page[23]", ACTION_PAGE_23, FALSE },
5391 { ".page[24]", ACTION_PAGE_24, FALSE },
5392 { ".page[25]", ACTION_PAGE_25, FALSE },
5393 { ".page[26]", ACTION_PAGE_26, FALSE },
5394 { ".page[27]", ACTION_PAGE_27, FALSE },
5395 { ".page[28]", ACTION_PAGE_28, FALSE },
5396 { ".page[29]", ACTION_PAGE_29, FALSE },
5397 { ".page[30]", ACTION_PAGE_30, FALSE },
5398 { ".page[31]", ACTION_PAGE_31, FALSE },
5399 { ".page[32]", ACTION_PAGE_32, FALSE },
5400 { ".other", ACTION_OTHER, FALSE },
5402 /* empty suffix always matches -- check as last entry in InitSoundInfo() */
5403 { "", ACTION_DEFAULT, TRUE },
5408 struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
5410 { ".left", MV_BIT_LEFT },
5411 { ".right", MV_BIT_RIGHT },
5412 { ".up", MV_BIT_UP },
5413 { ".down", MV_BIT_DOWN },
5414 { ".upleft", MV_BIT_UP },
5415 { ".upright", MV_BIT_RIGHT },
5416 { ".downleft", MV_BIT_LEFT },
5417 { ".downright", MV_BIT_DOWN },
5422 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
5424 { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, },
5425 { ".LOADING", GFX_SPECIAL_ARG_LOADING, },
5426 { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, },
5427 { ".TITLE", GFX_SPECIAL_ARG_TITLE, },
5428 { ".MAIN", GFX_SPECIAL_ARG_MAIN, },
5429 { ".LEVELS", GFX_SPECIAL_ARG_LEVELS },
5430 { ".SCORES", GFX_SPECIAL_ARG_SCORES, },
5431 { ".EDITOR", GFX_SPECIAL_ARG_EDITOR, },
5432 { ".INFO", GFX_SPECIAL_ARG_INFO, },
5433 { ".SETUP", GFX_SPECIAL_ARG_SETUP, },
5434 { ".PLAYING", GFX_SPECIAL_ARG_PLAYING, },
5435 { ".DOOR", GFX_SPECIAL_ARG_DOOR, },
5436 { ".PANEL", GFX_SPECIAL_ARG_PANEL, },
5437 { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, },
5438 { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, },
5440 /* empty suffix always matches -- check as last entry in InitMusicInfo() */
5441 { "", GFX_SPECIAL_ARG_DEFAULT, },
5446 #include "conf_var.c" /* include auto-generated data structure definitions */
5449 /* ------------------------------------------------------------------------- */
5450 /* font definitions */
5451 /* ------------------------------------------------------------------------- */
5453 /* Important: When one entry is a prefix of another entry, the longer entry
5454 must come first, because the dynamic configuration does prefix matching!
5455 (These definitions must match the corresponding definitions in "main.h"!) */
5457 struct FontInfo font_info[NUM_FONTS + 1] =
5459 { "font.initial_1" },
5460 { "font.initial_2" },
5461 { "font.initial_3" },
5462 { "font.initial_4" },
5465 { "font.menu_1.active" },
5466 { "font.menu_2.active" },
5469 { "font.text_1.active" },
5470 { "font.text_2.active" },
5471 { "font.text_3.active" },
5472 { "font.text_4.active" },
5477 { "font.envelope_1" },
5478 { "font.envelope_2" },
5479 { "font.envelope_3" },
5480 { "font.envelope_4" },
5481 { "font.input_1.active" },
5482 { "font.input_2.active" },
5485 { "font.option_off" },
5486 { "font.option_on" },
5489 { "font.value_old" },
5490 { "font.level_number.active" },
5491 { "font.level_number" },
5492 { "font.tape_recorder" },
5493 { "font.game_info" },
5494 { "font.info.elements" },
5495 { "font.info.levelset" },
5501 /* ------------------------------------------------------------------------- */
5502 /* music token prefix definitions */
5503 /* ------------------------------------------------------------------------- */
5505 struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] =
5507 { "background", TRUE },
5513 /* ========================================================================= */
5515 /* ========================================================================= */
5517 static void print_usage()
5520 "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
5523 " -d, --display HOSTNAME[:SCREEN] specify X server display\n"
5524 " -b, --basepath DIRECTORY alternative base DIRECTORY\n"
5525 " -l, --level DIRECTORY alternative level DIRECTORY\n"
5526 " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n"
5527 " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n"
5528 " -m, --music DIRECTORY alternative music DIRECTORY\n"
5529 " -n, --network network multiplayer game\n"
5530 " --serveronly only start network server\n"
5531 " -v, --verbose verbose mode\n"
5532 " --debug display debugging information\n"
5533 " --debug-x11-sync enable X11 synchronous mode\n"
5534 " -e, --execute COMMAND execute batch COMMAND\n"
5536 "Valid commands for '--execute' option:\n"
5537 " \"print graphicsinfo.conf\" print default graphics config\n"
5538 " \"print soundsinfo.conf\" print default sounds config\n"
5539 " \"print musicinfo.conf\" print default music config\n"
5540 " \"print editorsetup.conf\" print default editor config\n"
5541 " \"print helpanim.conf\" print default helpanim config\n"
5542 " \"print helptext.conf\" print default helptext config\n"
5543 " \"dump level FILE\" dump level data from FILE\n"
5544 " \"dump tape FILE\" dump tape data from FILE\n"
5545 " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
5546 " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
5547 " \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
5549 program.command_basename);
5552 int main(int argc, char *argv[])
5554 char * window_title_string = getWindowTitleString();
5556 InitProgramInfo(argv[0], USERDATA_DIRECTORY, USERDATA_DIRECTORY_UNIX,
5557 PROGRAM_TITLE_STRING, window_title_string, ICON_TITLE_STRING,
5558 X11_ICON_FILENAME, X11_ICONMASK_FILENAME, SDL_ICON_FILENAME,
5559 MSDOS_POINTER_FILENAME,
5560 COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL);
5562 InitExitFunction(CloseAllAndExit);
5563 InitPlatformDependentStuff();
5565 GetOptions(argv, print_usage);
5571 return 0; /* to keep compilers happy */