1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
12 #include "libgame/libgame.h"
23 Bitmap *bitmap_db_field;
24 Bitmap *bitmap_db_panel;
25 Bitmap *bitmap_db_door_1;
26 Bitmap *bitmap_db_door_2;
27 Bitmap *bitmap_db_store_1;
28 Bitmap *bitmap_db_store_2;
29 DrawBuffer *fieldbuffer;
30 DrawBuffer *drawto_field;
33 boolean game_status_last_screen = -1;
34 boolean level_editor_test_game = FALSE;
35 boolean network_playing = FALSE;
37 #if defined(TARGET_SDL)
38 boolean network_server = FALSE;
39 SDL_Thread *server_thread;
42 int key_joystick_mapping = 0;
44 short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
45 short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
46 short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
47 short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
48 short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
49 short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
50 short CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
51 short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
52 short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
53 short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
54 short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
55 boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
56 boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
57 short ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
58 short ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
59 short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
60 short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
61 short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
62 short CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
63 short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
64 short AmoebaCnt[MAX_NUM_AMOEBA];
65 short AmoebaCnt2[MAX_NUM_AMOEBA];
66 short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
67 short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
68 short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
69 int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
70 int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
72 int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
73 int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
74 int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
75 int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
76 int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
77 int GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
79 int ActiveElement[MAX_NUM_ELEMENTS];
80 int ActiveButton[NUM_IMAGE_FILES];
81 int ActiveFont[NUM_FONTS];
83 int lev_fieldx, lev_fieldy;
84 int scroll_x, scroll_y;
86 int WIN_XSIZE = WIN_XSIZE_DEFAULT;
87 int WIN_YSIZE = WIN_YSIZE_DEFAULT;
89 int SCR_FIELDX = SCR_FIELDX_DEFAULT;
90 int SCR_FIELDY = SCR_FIELDY_DEFAULT;
92 int REAL_SX = 6, REAL_SY = 6;
94 int DX = 566, DY = 60;
95 int VX = 566, VY = 400;
96 int EX = 566, EY = 356;
99 int FULL_SXSIZE = 2 + SXSIZE_DEFAULT + 2;
100 int FULL_SYSIZE = 2 + SYSIZE_DEFAULT + 2;
101 int SXSIZE = SXSIZE_DEFAULT;
102 int SYSIZE = SYSIZE_DEFAULT;
104 int FADE_SX = 6, FADE_SY = 6;
105 int FADE_SXSIZE = 2 + SXSIZE_DEFAULT + 2;
106 int FADE_SYSIZE = 2 + SXSIZE_DEFAULT + 2;
114 int TILESIZE_VAR = TILESIZE;
118 int ScreenMovDir = MV_NONE, ScreenMovPos = 0;
119 int ScreenGfxPos = 0;
120 int BorderElement = EL_STEELWALL;
121 int MenuFrameDelay = MENU_FRAME_DELAY;
122 int GameFrameDelay = GAME_FRAME_DELAY;
123 int FfwdFrameDelay = FFWD_FRAME_DELAY;
126 int SBX_Left, SBX_Right;
127 int SBY_Upper, SBY_Lower;
132 int TimeFrames, TimePlayed, TimeLeft, TapeTime;
134 boolean network_player_action_received = FALSE;
136 struct LevelSetInfo levelset;
137 struct LevelInfo level, level_template;
138 struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
139 struct HiScore highscore[MAX_SCORE_ENTRIES];
140 struct TapeInfo tape;
141 struct SetupInfo setup;
142 struct GameInfo game;
143 struct GlobalInfo global;
144 struct BorderInfo border;
145 struct ViewportInfo viewport;
146 struct TitleFadingInfo fading;
147 struct TitleFadingInfo title_initial_first_default;
148 struct TitleFadingInfo title_initial_default;
149 struct TitleFadingInfo title_first_default;
150 struct TitleFadingInfo title_default;
151 struct TitleMessageInfo titlescreen_initial_first_default;
152 struct TitleMessageInfo titlescreen_initial_first[MAX_NUM_TITLE_IMAGES];
153 struct TitleMessageInfo titlescreen_initial_default;
154 struct TitleMessageInfo titlescreen_initial[MAX_NUM_TITLE_IMAGES];
155 struct TitleMessageInfo titlescreen_first_default;
156 struct TitleMessageInfo titlescreen_first[MAX_NUM_TITLE_IMAGES];
157 struct TitleMessageInfo titlescreen_default;
158 struct TitleMessageInfo titlescreen[MAX_NUM_TITLE_IMAGES];
159 struct TitleMessageInfo titlemessage_initial_first_default;
160 struct TitleMessageInfo titlemessage_initial_first[MAX_NUM_TITLE_MESSAGES];
161 struct TitleMessageInfo titlemessage_initial_default;
162 struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES];
163 struct TitleMessageInfo titlemessage_first_default;
164 struct TitleMessageInfo titlemessage_first[MAX_NUM_TITLE_MESSAGES];
165 struct TitleMessageInfo titlemessage_default;
166 struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES];
167 struct TitleMessageInfo readme;
168 struct InitInfo init, init_last;
169 struct MenuInfo menu;
170 struct DoorInfo door_1, door_2;
171 struct RequestInfo request;
172 struct PreviewInfo preview;
173 struct EditorInfo editor;
175 struct GraphicInfo *graphic_info = NULL;
176 struct SoundInfo *sound_info = NULL;
177 struct MusicInfo *music_info = NULL;
178 struct MusicFileInfo *music_file_info = NULL;
179 struct HelpAnimInfo *helpanim_info = NULL;
181 SetupFileHash *helptext_info = NULL;
182 SetupFileHash *image_config_hash = NULL;
183 SetupFileHash *element_token_hash = NULL;
184 SetupFileHash *graphic_token_hash = NULL;
185 SetupFileHash *font_token_hash = NULL;
188 /* ------------------------------------------------------------------------- */
189 /* element definitions */
190 /* ------------------------------------------------------------------------- */
192 struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1];
194 /* this contains predefined structure elements to initialize "element_info" */
195 struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
197 /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */
199 /* ----------------------------------------------------------------------- */
200 /* "real" level file elements */
201 /* ----------------------------------------------------------------------- */
251 "bug (random start direction)"
256 "spaceship (random start direction)"
261 "yam yam (random start direction)"
291 "quicksand (with rock)"
321 "dropping amoeba (EM style)"
336 "Conway's wall of life"
359 "robot_wheel.active",
361 "magic wheel (running)"
406 "gray door (opened by key 1)"
411 "gray door (opened by key 2)"
416 "gray door (opened by key 3)"
421 "gray door (opened by key 4)"
431 "pac man (random start direction)"
436 "invisible normal wall"
461 "amoeba with content"
481 "growing wall (horizontal, visible)"
496 "wall with BD style diamond"
499 "wall_emerald_yellow",
501 "wall with yellow emerald"
511 "magic wall (BD style)"
514 "invisible_steelwall",
516 "invisible steel wall"
519 "sokoban_field_player",
521 "sokoban field with player"
524 "dynabomb_increase_number",
526 "increases number of bombs"
529 "dynabomb_increase_size",
531 "increases explosion size"
534 "dynabomb_increase_power",
536 "increases power of explosion"
544 "sokoban_field_empty",
546 "sokoban empty field"
549 "sokoban_field_full",
551 "sokoban field with object"
554 "bd_butterfly.right",
556 "butterfly (starts moving right)"},
560 "butterfly (starts moving up)"
565 "butterfly (starts moving left)"},
569 "butterfly (starts moving down)"},
573 "firefly (starts moving right)"
578 "firefly (starts moving up)"
583 "firefly (starts moving left)"
588 "firefly (starts moving down)"
593 "butterfly (random start direction)"
598 "firefly (random start direction)"
623 "bug (starts moving right)"
628 "bug (starts moving up)"
633 "bug (starts moving left)"
638 "bug (starts moving down)"
643 "spaceship (starts moving right)"},
647 "spaceship (starts moving up)"
652 "spaceship (starts moving left)"},
656 "spaceship (starts moving down)"},
660 "pac man (starts moving right)"
665 "pac man (starts moving up)"
670 "pac man (starts moving left)"
675 "pac man (starts moving down)"
690 "wall with red emerald"
693 "wall_emerald_purple",
695 "wall with purple emerald"
700 "acid pool (top left)"
703 "acid_pool_topright",
705 "acid pool (top right)"
708 "acid_pool_bottomleft",
710 "acid pool (bottom left)"
718 "acid_pool_bottomright",
720 "acid pool (bottom right)"
725 "normal wall (BD style)"
750 "mole (random start direction)"
790 "fire breathing dragon"
793 "em_key_1_file_obsolete",
1103 "char_bracketright",
1198 "expandable_wall_horizontal",
1200 "growing wall (horizontal)"
1203 "expandable_wall_vertical",
1205 "growing wall (vertical)"
1208 "expandable_wall_any",
1210 "growing wall (any direction)"
1233 "em_key_2_file_obsolete",
1238 "em_key_3_file_obsolete",
1243 "em_key_4_file_obsolete",
1295 "port (leading right)"
1300 "port (leading down)"
1305 "port (leading left)"
1313 "sp_gravity_port_right",
1315 "gravity-on/off port (leading right)"
1318 "sp_gravity_port_down",
1320 "gravity-on/off port (leading down)"
1323 "sp_gravity_port_left",
1325 "gravity-on/off port (leading left)"
1328 "sp_gravity_port_up",
1330 "gravity-on/off port (leading up)"
1358 "sp_port_horizontal",
1365 "port (any direction)"
1388 "sp_hardware_base_1",
1393 "sp_hardware_green",
1408 "sp_hardware_yellow",
1413 "sp_hardware_base_2",
1418 "sp_hardware_base_3",
1423 "sp_hardware_base_4",
1428 "sp_hardware_base_5",
1433 "sp_hardware_base_6",
1450 "gray door (EM style, key 1)"
1455 "gray door (EM style, key 2)"
1460 "gray door (EM style, key 3)"
1465 "gray door (EM style, key 4)"
1470 "dynamite (EM style)"
1473 "em_dynamite.active",
1475 "burning dynamite (EM style)"
1503 "dc_gate_white_gray",
1505 "gray door (opened by white key)"
1525 "switch gate (open)"
1528 "switchgate_closed",
1530 "switch gate (closed)"
1533 "switchgate_switch_up",
1534 "switchgate_switch",
1535 "switch for switch gate"
1538 "switchgate_switch_down",
1539 "switchgate_switch",
1540 "switch for switch gate"
1553 "conveyor_belt_1_left",
1555 "conveyor belt 1 (left)"
1558 "conveyor_belt_1_middle",
1560 "conveyor belt 1 (middle)"
1563 "conveyor_belt_1_right",
1565 "conveyor belt 1 (right)"
1568 "conveyor_belt_1_switch_left",
1569 "conveyor_belt_switch",
1570 "switch for conveyor belt 1 (left)"
1573 "conveyor_belt_1_switch_middle",
1574 "conveyor_belt_switch",
1575 "switch for conveyor belt 1 (middle)"
1578 "conveyor_belt_1_switch_right",
1579 "conveyor_belt_switch",
1580 "switch for conveyor belt 1 (right)"
1583 "conveyor_belt_2_left",
1585 "conveyor belt 2 (left)"
1588 "conveyor_belt_2_middle",
1590 "conveyor belt 2 (middle)"
1593 "conveyor_belt_2_right",
1595 "conveyor belt 2 (right)"
1598 "conveyor_belt_2_switch_left",
1599 "conveyor_belt_switch",
1600 "switch for conveyor belt 2 (left)"
1603 "conveyor_belt_2_switch_middle",
1604 "conveyor_belt_switch",
1605 "switch for conveyor belt 2 (middle)"
1608 "conveyor_belt_2_switch_right",
1609 "conveyor_belt_switch",
1610 "switch for conveyor belt 2 (right)"
1613 "conveyor_belt_3_left",
1615 "conveyor belt 3 (left)"
1618 "conveyor_belt_3_middle",
1620 "conveyor belt 3 (middle)"
1623 "conveyor_belt_3_right",
1625 "conveyor belt 3 (right)"
1628 "conveyor_belt_3_switch_left",
1629 "conveyor_belt_switch",
1630 "switch for conveyor belt 3 (left)"
1633 "conveyor_belt_3_switch_middle",
1634 "conveyor_belt_switch",
1635 "switch for conveyor belt 3 (middle)"
1638 "conveyor_belt_3_switch_right",
1639 "conveyor_belt_switch",
1640 "switch for conveyor belt 3 (right)"
1643 "conveyor_belt_4_left",
1645 "conveyor belt 4 (left)"
1648 "conveyor_belt_4_middle",
1650 "conveyor belt 4 (middle)"
1653 "conveyor_belt_4_right",
1655 "conveyor belt 4 (right)"
1658 "conveyor_belt_4_switch_left",
1659 "conveyor_belt_switch",
1660 "switch for conveyor belt 4 (left)"
1663 "conveyor_belt_4_switch_middle",
1664 "conveyor_belt_switch",
1665 "switch for conveyor belt 4 (middle)"
1668 "conveyor_belt_4_switch_right",
1669 "conveyor_belt_switch",
1670 "switch for conveyor belt 4 (right)"
1675 "land mine (not removable)"
1678 "envelope_obsolete",
1680 "envelope (OBSOLETE)"
1685 "light switch (off)"
1688 "light_switch.active",
1695 "sign (exclamation)"
1698 "sign_radioactivity",
1700 "sign (radio activity)"
1710 "sign (wheel chair)"
1733 "sign_entry_forbidden",
1735 "sign (entry forbidden)"
1738 "sign_emergency_exit",
1740 "sign (emergency exit)"
1755 "mole (starts moving left)"
1760 "mole (starts moving right)"
1765 "mole (starts moving up)"
1770 "mole (starts moving down)"
1773 "steelwall_slippery",
1775 "slippery steel wall"
1785 "dx unknown element 15"
1790 "dx unknown element 42"
1805 "shield (deadly, kills enemies)"
1815 "time gate (closed)"
1818 "timegate_switch.active",
1820 "switch for time gate"
1825 "switch for time gate"
1833 "balloon_switch_left",
1835 "wind switch (left)"
1838 "balloon_switch_right",
1840 "wind switch (right)"
1843 "balloon_switch_up",
1848 "balloon_switch_down",
1850 "wind switch (down)"
1853 "balloon_switch_any",
1855 "wind switch (any direction)"
1920 "tube (any direction)"
1933 "tube_vertical_left",
1935 "tube (vertical & left)"
1938 "tube_vertical_right",
1940 "tube (vertical & right)"
1943 "tube_horizontal_up",
1945 "tube (horizontal & up)"
1948 "tube_horizontal_down",
1950 "tube (horizontal & down)"
1960 "tube (left & down)"
1970 "tube (right & down)"
1985 "stable bomb (DX style)"
2495 "custom element 100"
2500 "custom element 101"
2505 "custom element 102"
2510 "custom element 103"
2515 "custom element 104"
2520 "custom element 105"
2525 "custom element 106"
2530 "custom element 107"
2535 "custom element 108"
2540 "custom element 109"
2545 "custom element 110"
2550 "custom element 111"
2555 "custom element 112"
2560 "custom element 113"
2565 "custom element 114"
2570 "custom element 115"
2575 "custom element 116"
2580 "custom element 117"
2585 "custom element 118"
2590 "custom element 119"
2595 "custom element 120"
2600 "custom element 121"
2605 "custom element 122"
2610 "custom element 123"
2615 "custom element 124"
2620 "custom element 125"
2625 "custom element 126"
2630 "custom element 127"
2635 "custom element 128"
2640 "custom element 129"
2645 "custom element 130"
2650 "custom element 131"
2655 "custom element 132"
2660 "custom element 133"
2665 "custom element 134"
2670 "custom element 135"
2675 "custom element 136"
2680 "custom element 137"
2685 "custom element 138"
2690 "custom element 139"
2695 "custom element 140"
2700 "custom element 141"
2705 "custom element 142"
2710 "custom element 143"
2715 "custom element 144"
2720 "custom element 145"
2725 "custom element 146"
2730 "custom element 147"
2735 "custom element 148"
2740 "custom element 149"
2745 "custom element 150"
2750 "custom element 151"
2755 "custom element 152"
2760 "custom element 153"
2765 "custom element 154"
2770 "custom element 155"
2775 "custom element 156"
2780 "custom element 157"
2785 "custom element 158"
2790 "custom element 159"
2795 "custom element 160"
2800 "custom element 161"
2805 "custom element 162"
2810 "custom element 163"
2815 "custom element 164"
2820 "custom element 165"
2825 "custom element 166"
2830 "custom element 167"
2835 "custom element 168"
2840 "custom element 169"
2845 "custom element 170"
2850 "custom element 171"
2855 "custom element 172"
2860 "custom element 173"
2865 "custom element 174"
2870 "custom element 175"
2875 "custom element 176"
2880 "custom element 177"
2885 "custom element 178"
2890 "custom element 179"
2895 "custom element 180"
2900 "custom element 181"
2905 "custom element 182"
2910 "custom element 183"
2915 "custom element 184"
2920 "custom element 185"
2925 "custom element 186"
2930 "custom element 187"
2935 "custom element 188"
2940 "custom element 189"
2945 "custom element 190"
2950 "custom element 191"
2955 "custom element 192"
2960 "custom element 193"
2965 "custom element 194"
2970 "custom element 195"
2975 "custom element 196"
2980 "custom element 197"
2985 "custom element 198"
2990 "custom element 199"
2995 "custom element 200"
3000 "custom element 201"
3005 "custom element 202"
3010 "custom element 203"
3015 "custom element 204"
3020 "custom element 205"
3025 "custom element 206"
3030 "custom element 207"
3035 "custom element 208"
3040 "custom element 209"
3045 "custom element 210"
3050 "custom element 211"
3055 "custom element 212"
3060 "custom element 213"
3065 "custom element 214"
3070 "custom element 215"
3075 "custom element 216"
3080 "custom element 217"
3085 "custom element 218"
3090 "custom element 219"
3095 "custom element 220"
3100 "custom element 221"
3105 "custom element 222"
3110 "custom element 223"
3115 "custom element 224"
3120 "custom element 225"
3125 "custom element 226"
3130 "custom element 227"
3135 "custom element 228"
3140 "custom element 229"
3145 "custom element 230"
3150 "custom element 231"
3155 "custom element 232"
3160 "custom element 233"
3165 "custom element 234"
3170 "custom element 235"
3175 "custom element 236"
3180 "custom element 237"
3185 "custom element 238"
3190 "custom element 239"
3195 "custom element 240"
3200 "custom element 241"
3205 "custom element 242"
3210 "custom element 243"
3215 "custom element 244"
3220 "custom element 245"
3225 "custom element 246"
3230 "custom element 247"
3235 "custom element 248"
3240 "custom element 249"
3245 "custom element 250"
3250 "custom element 251"
3255 "custom element 252"
3260 "custom element 253"
3265 "custom element 254"
3270 "custom element 255"
3275 "custom element 256"
3485 "element triggering change"
3490 "player triggering change"
3493 "sp_gravity_on_port_right",
3494 "sp_gravity_on_port",
3495 "gravity-on port (leading right)"
3498 "sp_gravity_on_port_down",
3499 "sp_gravity_on_port",
3500 "gravity-on port (leading down)"
3503 "sp_gravity_on_port_left",
3504 "sp_gravity_on_port",
3505 "gravity-on port (leading left)"
3508 "sp_gravity_on_port_up",
3509 "sp_gravity_on_port",
3510 "gravity-on port (leading up)"
3513 "sp_gravity_off_port_right",
3514 "sp_gravity_off_port",
3515 "gravity-off port (leading right)"
3518 "sp_gravity_off_port_down",
3519 "sp_gravity_off_port",
3520 "gravity-off port (leading down)"
3523 "sp_gravity_off_port_left",
3524 "sp_gravity_off_port",
3525 "gravity-off port (leading left)"
3528 "sp_gravity_off_port_up",
3529 "sp_gravity_off_port",
3530 "gravity-off port (leading up)"
3533 "balloon_switch_none",
3540 "door 5 (EMC style)",
3545 "door 6 (EMC style)",
3550 "door 7 (EMC style)",
3555 "door 8 (EMC style)",
3560 "gray door (EMC style, key 5)",
3565 "gray door (EMC style, key 6)",
3570 "gray door (EMC style, key 7)",
3575 "gray door (EMC style, key 8)",
3580 "key 5 (EMC style)",
3585 "key 6 (EMC style)",
3590 "key 7 (EMC style)",
3595 "key 8 (EMC style)",
3613 "emc_magic_ball.active",
3615 "magic ball (activated)",
3618 "emc_magic_ball_switch",
3619 "emc_magic_ball_switch",
3620 "magic ball switch (off)",
3623 "emc_magic_ball_switch.active",
3624 "emc_magic_ball_switch",
3625 "magic ball switch (on)",
3628 "emc_spring_bumper",
3629 "emc_spring_bumper",
3688 "emc_wall_slippery_1",
3693 "emc_wall_slippery_2",
3698 "emc_wall_slippery_3",
3703 "emc_wall_slippery_4",
3725 "CE value of element triggering change"
3730 "CE score of element triggering change"
3735 "CE value of current element"
3740 "CE score of current element"
3745 "yam yam (starts moving left)"
3750 "yam yam (starts moving right)"
3755 "yam yam (starts moving up)"
3760 "yam yam (starts moving down)"
3763 "bd_expandable_wall",
3765 "growing wall (horizontal, BD style)"
3770 "CE 8 positions earlier in list"
3775 "CE 7 positions earlier in list"
3780 "CE 6 positions earlier in list"
3785 "CE 5 positions earlier in list"
3790 "CE 4 positions earlier in list"
3795 "CE 3 positions earlier in list"
3800 "CE 2 positions earlier in list"
3805 "CE 1 position earlier in list"
3810 "the current custom element"
3815 "CE 1 position later in list"
3820 "CE 2 positions later in list"
3825 "CE 3 positions later in list"
3830 "CE 4 positions later in list"
3835 "CE 5 positions later in list"
3840 "CE 6 positions later in list"
3845 "CE 7 positions later in list"
3850 "CE 8 positions later in list"
3855 "this element matches any element"
3863 "steel_char_exclam",
3868 "steel_char_quotedbl",
3873 "steel_char_numbersign",
3878 "steel_char_dollar",
3883 "steel_char_percent",
3888 "steel_char_ampersand",
3893 "steel_char_apostrophe",
3898 "steel_char_parenleft",
3903 "steel_char_parenright",
3908 "steel_char_asterisk",
3928 "steel_char_period",
3993 "steel_char_semicolon",
4008 "steel_char_greater",
4013 "steel_char_question",
4153 "steel_char_bracketleft",
4158 "steel_char_backslash",
4163 "steel_char_bracketright",
4168 "steel_char_asciicircum",
4173 "steel_char_underscore",
4178 "steel_char_copyright",
4180 "steel letter '\xa9'"
4183 "steel_char_aumlaut",
4185 "steel letter '\xc4'"
4188 "steel_char_oumlaut",
4190 "steel letter '\xd6'"
4193 "steel_char_uumlaut",
4195 "steel letter '\xdc'"
4198 "steel_char_degree",
4200 "steel letter '\xb0'"
4203 "steel_char_trademark",
4205 "steel letter '\xae'"
4208 "steel_char_cursor",
4210 "steel letter '\xa0'"
4213 "steel_char_unused",
4218 "steel_char_unused",
4223 "steel_char_unused",
4228 "steel_char_unused",
4233 "steel_char_unused",
4238 "steel_char_unused",
4243 "steel_char_unused",
4245 "steel letter 'button'"
4248 "steel_char_unused",
4253 "steel_char_unused",
4255 "steel letter 'down'"
4308 "steel_exit_closed",
4318 "dc_steelwall_1_left",
4323 "dc_steelwall_1_right",
4325 "steel wall (right)"
4328 "dc_steelwall_1_top",
4333 "dc_steelwall_1_bottom",
4335 "steel wall (bottom)"
4338 "dc_steelwall_1_horizontal",
4340 "steel wall (top/bottom)"
4343 "dc_steelwall_1_vertical",
4345 "steel wall (left/right)"
4348 "dc_steelwall_1_topleft",
4350 "steel wall (top/left)"
4353 "dc_steelwall_1_topright",
4355 "steel wall (top/right)"
4358 "dc_steelwall_1_bottomleft",
4360 "steel wall (bottom/left)"
4363 "dc_steelwall_1_bottomright",
4365 "steel wall (bottom/right)"
4368 "dc_steelwall_1_topleft_2",
4370 "steel wall (top/left corner)"
4373 "dc_steelwall_1_topright_2",
4375 "steel wall (top/right corner)"
4378 "dc_steelwall_1_bottomleft_2",
4380 "steel wall (bottom/left corner)"
4383 "dc_steelwall_1_bottomright_2",
4385 "steel wall (bottom/right corner)"
4388 "dc_steelwall_2_left",
4393 "dc_steelwall_2_right",
4395 "steel wall (right)"
4398 "dc_steelwall_2_top",
4403 "dc_steelwall_2_bottom",
4405 "steel wall (bottom)"
4408 "dc_steelwall_2_horizontal",
4410 "steel wall (horizontal)"
4413 "dc_steelwall_2_vertical",
4415 "steel wall (vertical)"
4418 "dc_steelwall_2_middle",
4420 "steel wall (middle)"
4423 "dc_steelwall_2_single",
4425 "steel wall (single)"
4428 "dc_switchgate_switch_up",
4429 "switchgate_switch",
4430 "switch for switch gate (steel)"
4433 "dc_switchgate_switch_down",
4434 "switchgate_switch",
4435 "switch for switch gate (steel)"
4438 "dc_timegate_switch",
4440 "switch for time gate (steel)"
4443 "dc_timegate_switch.active",
4445 "switch for time gate (steel)"
4450 "land mine (DC style, removable)"
4453 "expandable_steelwall",
4455 "growing steel wall"
4458 "expandable_steelwall_horizontal",
4460 "growing steel wall (horizontal)"
4463 "expandable_steelwall_vertical",
4465 "growing steel wall (vertical)"
4468 "expandable_steelwall_any",
4470 "growing steel wall (any direction)"
4475 "closed exit (EM style)"
4480 "open exit (EM style)"
4483 "em_steel_exit_closed",
4485 "closed steel exit (EM style)"
4488 "em_steel_exit_open",
4490 "open steel exit (EM style)"
4493 "dc_gate_fake_gray",
4495 "gray door (opened by no key)"
4500 "magic wall (DC style)"
4503 "quicksand_fast_empty",
4505 "fast quicksand (empty)"
4508 "quicksand_fast_full",
4510 "fast quicksand (with rock)"
4513 "from_level_template",
4514 "from_level_template",
4515 "element taken from level template"
4518 /* ----------------------------------------------------------------------- */
4519 /* "real" (and therefore drawable) runtime elements */
4520 /* ----------------------------------------------------------------------- */
4523 "dynabomb_player_1.active",
4528 "dynabomb_player_2.active",
4533 "dynabomb_player_3.active",
4538 "dynabomb_player_4.active",
4543 "sp_disk_red.active",
4548 "switchgate.opening",
4553 "switchgate.closing",
4578 "invisible_steelwall.active",
4583 "invisible_wall.active",
4588 "invisible_sand.active",
4593 "conveyor_belt_1_left.active",
4598 "conveyor_belt_1_middle.active",
4603 "conveyor_belt_1_right.active",
4608 "conveyor_belt_2_left.active",
4613 "conveyor_belt_2_middle.active",
4618 "conveyor_belt_2_right.active",
4623 "conveyor_belt_3_left.active",
4628 "conveyor_belt_3_middle.active",
4633 "conveyor_belt_3_right.active",
4638 "conveyor_belt_4_left.active",
4643 "conveyor_belt_4_middle.active",
4648 "conveyor_belt_4_right.active",
4663 "steel_exit.opening",
4668 "steel_exit.closing",
4683 "em_steel_exit.opening",
4688 "em_steel_exit.closing",
4708 "sp_terminal.active",
4713 "sp_buggy_base.activating",
4718 "sp_buggy_base.active",
4733 "quicksand.emptying",
4738 "quicksand_fast.emptying",
4743 "magic_wall.active",
4748 "bd_magic_wall.active",
4753 "dc_magic_wall.active",
4763 "bd_magic_wall_full",
4768 "dc_magic_wall_full",
4773 "magic_wall.emptying",
4778 "bd_magic_wall.emptying",
4783 "dc_magic_wall.emptying",
4793 "bd_magic_wall_dead",
4798 "dc_magic_wall_dead",
4804 "emc_fake_grass.active",
4809 "gate_1_gray.active",
4814 "gate_2_gray.active",
4819 "gate_3_gray.active",
4824 "gate_4_gray.active",
4829 "em_gate_1_gray.active",
4834 "em_gate_2_gray.active",
4839 "em_gate_3_gray.active",
4844 "em_gate_4_gray.active",
4849 "emc_gate_5_gray.active",
4854 "emc_gate_6_gray.active",
4859 "emc_gate_7_gray.active",
4864 "emc_gate_8_gray.active",
4869 "dc_gate_white_gray.active",
4874 "emc_dripper.active",
4879 "emc_spring_bumper.active",
4880 "emc_spring_bumper",
4884 /* ----------------------------------------------------------------------- */
4885 /* "unreal" (and therefore not drawable) runtime elements */
4886 /* ----------------------------------------------------------------------- */
4914 "acid_splash_right",
4929 "expandable_wall.growing",
4934 "expandable_steelwall.growing",
4944 "player_is_leaving",
4949 "player_is_exploding_1",
4954 "player_is_exploding_2",
4959 "player_is_exploding_3",
4964 "player_is_exploding_4",
4969 "quicksand.filling",
4974 "quicksand_fast.filling",
4979 "magic_wall.filling",
4984 "bd_magic_wall.filling",
4989 "dc_magic_wall.filling",
4999 "diagonal.shrinking",
5009 /* ----------------------------------------------------------------------- */
5010 /* dummy elements (never used as game elements, only used as graphics) */
5011 /* ----------------------------------------------------------------------- */
5014 "steelwall_topleft",
5019 "steelwall_topright",
5024 "steelwall_bottomleft",
5029 "steelwall_bottomright",
5034 "steelwall_horizontal",
5039 "steelwall_vertical",
5044 "invisible_steelwall_topleft",
5049 "invisible_steelwall_topright",
5054 "invisible_steelwall_bottomleft",
5059 "invisible_steelwall_bottomright",
5064 "invisible_steelwall_horizontal",
5069 "invisible_steelwall_vertical",
5084 "dynabomb_player_1",
5089 "dynabomb_player_2",
5094 "dynabomb_player_3",
5099 "dynabomb_player_4",
5104 "shield_normal.active",
5109 "shield_deadly.active",
5179 "internal_clipboard_custom",
5181 "empty custom element"
5184 "internal_clipboard_change",
5189 "internal_clipboard_group",
5191 "empty group element"
5199 "internal_cascade_bd",
5201 "show Boulder Dash elements"
5204 "internal_cascade_bd.active",
5206 "hide Boulder Dash elements"
5209 "internal_cascade_em",
5211 "show Emerald Mine elements"
5214 "internal_cascade_em.active",
5216 "hide Emerald Mine elements"
5219 "internal_cascade_emc",
5221 "show Emerald Mine Club elements"
5224 "internal_cascade_emc.active",
5226 "hide Emerald Mine Club elements"
5229 "internal_cascade_rnd",
5231 "show Rocks'n'Diamonds elements"
5234 "internal_cascade_rnd.active",
5236 "hide Rocks'n'Diamonds elements"
5239 "internal_cascade_sb",
5241 "show Sokoban elements"
5244 "internal_cascade_sb.active",
5246 "hide Sokoban elements"
5249 "internal_cascade_sp",
5251 "show Supaplex elements"
5254 "internal_cascade_sp.active",
5256 "hide Supaplex elements"
5259 "internal_cascade_dc",
5261 "show Diamond Caves II elements"
5264 "internal_cascade_dc.active",
5266 "hide Diamond Caves II elements"
5269 "internal_cascade_dx",
5271 "show DX Boulderdash elements"
5274 "internal_cascade_dx.active",
5276 "hide DX Boulderdash elements"
5279 "internal_cascade_chars",
5281 "show text elements"
5284 "internal_cascade_chars.active",
5286 "hide text elements"
5289 "internal_cascade_steel_chars",
5291 "show steel text elements"
5294 "internal_cascade_steel_chars.active",
5296 "hide steel text elements"
5299 "internal_cascade_ce",
5301 "show custom elements"
5304 "internal_cascade_ce.active",
5306 "hide custom elements"
5309 "internal_cascade_ge",
5311 "show group elements"
5314 "internal_cascade_ge.active",
5316 "hide group elements"
5319 "internal_cascade_ref",
5321 "show reference elements"
5324 "internal_cascade_ref.active",
5326 "hide reference elements"
5329 "internal_cascade_user",
5331 "show user defined elements"
5334 "internal_cascade_user.active",
5336 "hide user defined elements"
5339 "internal_cascade_dynamic",
5341 "show elements used in this level"
5344 "internal_cascade_dynamic.active",
5346 "hide elements used in this level"
5349 /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
5359 /* ------------------------------------------------------------------------- */
5360 /* element action and direction definitions */
5361 /* ------------------------------------------------------------------------- */
5363 struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
5365 { ".[DEFAULT]", ACTION_DEFAULT, TRUE },
5366 { ".waiting", ACTION_WAITING, TRUE },
5367 { ".falling", ACTION_FALLING, TRUE },
5368 { ".moving", ACTION_MOVING, TRUE },
5369 { ".digging", ACTION_DIGGING, FALSE },
5370 { ".snapping", ACTION_SNAPPING, FALSE },
5371 { ".collecting", ACTION_COLLECTING, FALSE },
5372 { ".dropping", ACTION_DROPPING, FALSE },
5373 { ".pushing", ACTION_PUSHING, FALSE },
5374 { ".walking", ACTION_WALKING, FALSE },
5375 { ".passing", ACTION_PASSING, FALSE },
5376 { ".impact", ACTION_IMPACT, FALSE },
5377 { ".breaking", ACTION_BREAKING, FALSE },
5378 { ".activating", ACTION_ACTIVATING, FALSE },
5379 { ".deactivating", ACTION_DEACTIVATING, FALSE },
5380 { ".opening", ACTION_OPENING, FALSE },
5381 { ".closing", ACTION_CLOSING, FALSE },
5382 { ".attacking", ACTION_ATTACKING, TRUE },
5383 { ".growing", ACTION_GROWING, TRUE },
5384 { ".shrinking", ACTION_SHRINKING, FALSE },
5385 { ".active", ACTION_ACTIVE, TRUE },
5386 { ".filling", ACTION_FILLING, FALSE },
5387 { ".emptying", ACTION_EMPTYING, FALSE },
5388 { ".changing", ACTION_CHANGING, FALSE },
5389 { ".exploding", ACTION_EXPLODING, FALSE },
5390 { ".boring", ACTION_BORING, FALSE },
5391 { ".boring[1]", ACTION_BORING_1, FALSE },
5392 { ".boring[2]", ACTION_BORING_2, FALSE },
5393 { ".boring[3]", ACTION_BORING_3, FALSE },
5394 { ".boring[4]", ACTION_BORING_4, FALSE },
5395 { ".boring[5]", ACTION_BORING_5, FALSE },
5396 { ".boring[6]", ACTION_BORING_6, FALSE },
5397 { ".boring[7]", ACTION_BORING_7, FALSE },
5398 { ".boring[8]", ACTION_BORING_8, FALSE },
5399 { ".boring[9]", ACTION_BORING_9, FALSE },
5400 { ".boring[10]", ACTION_BORING_10, FALSE },
5401 { ".sleeping", ACTION_SLEEPING, FALSE },
5402 { ".sleeping[1]", ACTION_SLEEPING_1, FALSE },
5403 { ".sleeping[2]", ACTION_SLEEPING_2, FALSE },
5404 { ".sleeping[3]", ACTION_SLEEPING_3, FALSE },
5405 { ".awakening", ACTION_AWAKENING, FALSE },
5406 { ".dying", ACTION_DYING, FALSE },
5407 { ".turning", ACTION_TURNING, FALSE },
5408 { ".turning_from_left", ACTION_TURNING_FROM_LEFT, FALSE },
5409 { ".turning_from_right", ACTION_TURNING_FROM_RIGHT, FALSE },
5410 { ".turning_from_up", ACTION_TURNING_FROM_UP, FALSE },
5411 { ".turning_from_down", ACTION_TURNING_FROM_DOWN, FALSE },
5412 { ".smashed_by_rock", ACTION_SMASHED_BY_ROCK, FALSE },
5413 { ".smashed_by_spring", ACTION_SMASHED_BY_SPRING, FALSE },
5414 { ".eating", ACTION_EATING, FALSE },
5415 { ".twinkling", ACTION_TWINKLING, FALSE },
5416 { ".splashing", ACTION_SPLASHING, FALSE },
5417 { ".page[1]", ACTION_PAGE_1, FALSE },
5418 { ".page[2]", ACTION_PAGE_2, FALSE },
5419 { ".page[3]", ACTION_PAGE_3, FALSE },
5420 { ".page[4]", ACTION_PAGE_4, FALSE },
5421 { ".page[5]", ACTION_PAGE_5, FALSE },
5422 { ".page[6]", ACTION_PAGE_6, FALSE },
5423 { ".page[7]", ACTION_PAGE_7, FALSE },
5424 { ".page[8]", ACTION_PAGE_8, FALSE },
5425 { ".page[9]", ACTION_PAGE_9, FALSE },
5426 { ".page[10]", ACTION_PAGE_10, FALSE },
5427 { ".page[11]", ACTION_PAGE_11, FALSE },
5428 { ".page[12]", ACTION_PAGE_12, FALSE },
5429 { ".page[13]", ACTION_PAGE_13, FALSE },
5430 { ".page[14]", ACTION_PAGE_14, FALSE },
5431 { ".page[15]", ACTION_PAGE_15, FALSE },
5432 { ".page[16]", ACTION_PAGE_16, FALSE },
5433 { ".page[17]", ACTION_PAGE_17, FALSE },
5434 { ".page[18]", ACTION_PAGE_18, FALSE },
5435 { ".page[19]", ACTION_PAGE_19, FALSE },
5436 { ".page[20]", ACTION_PAGE_20, FALSE },
5437 { ".page[21]", ACTION_PAGE_21, FALSE },
5438 { ".page[22]", ACTION_PAGE_22, FALSE },
5439 { ".page[23]", ACTION_PAGE_23, FALSE },
5440 { ".page[24]", ACTION_PAGE_24, FALSE },
5441 { ".page[25]", ACTION_PAGE_25, FALSE },
5442 { ".page[26]", ACTION_PAGE_26, FALSE },
5443 { ".page[27]", ACTION_PAGE_27, FALSE },
5444 { ".page[28]", ACTION_PAGE_28, FALSE },
5445 { ".page[29]", ACTION_PAGE_29, FALSE },
5446 { ".page[30]", ACTION_PAGE_30, FALSE },
5447 { ".page[31]", ACTION_PAGE_31, FALSE },
5448 { ".page[32]", ACTION_PAGE_32, FALSE },
5449 { ".part_1", ACTION_PART_1, FALSE },
5450 { ".part_2", ACTION_PART_2, FALSE },
5451 { ".part_3", ACTION_PART_3, FALSE },
5452 { ".part_4", ACTION_PART_4, FALSE },
5453 { ".part_5", ACTION_PART_5, FALSE },
5454 { ".part_6", ACTION_PART_6, FALSE },
5455 { ".part_7", ACTION_PART_7, FALSE },
5456 { ".part_8", ACTION_PART_8, FALSE },
5457 { ".other", ACTION_OTHER, FALSE },
5459 /* empty suffix always matches -- check as last entry in InitSoundInfo() */
5460 { "", ACTION_DEFAULT, TRUE },
5465 struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
5467 { ".left", MV_BIT_LEFT },
5468 { ".right", MV_BIT_RIGHT },
5469 { ".up", MV_BIT_UP },
5470 { ".down", MV_BIT_DOWN },
5471 { ".upleft", MV_BIT_UP },
5472 { ".upright", MV_BIT_RIGHT },
5473 { ".downleft", MV_BIT_LEFT },
5474 { ".downright", MV_BIT_DOWN },
5479 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
5481 { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, },
5482 { ".LOADING", GFX_SPECIAL_ARG_LOADING, },
5483 { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, },
5484 { ".TITLE_INITIAL_1", GFX_SPECIAL_ARG_TITLE_INITIAL_1, },
5485 { ".TITLE_INITIAL_2", GFX_SPECIAL_ARG_TITLE_INITIAL_2, },
5486 { ".TITLE_INITIAL_3", GFX_SPECIAL_ARG_TITLE_INITIAL_3, },
5487 { ".TITLE_INITIAL_4", GFX_SPECIAL_ARG_TITLE_INITIAL_4, },
5488 { ".TITLE_INITIAL_5", GFX_SPECIAL_ARG_TITLE_INITIAL_5, },
5489 { ".TITLE", GFX_SPECIAL_ARG_TITLE, },
5490 { ".TITLE_1", GFX_SPECIAL_ARG_TITLE_1, },
5491 { ".TITLE_2", GFX_SPECIAL_ARG_TITLE_2, },
5492 { ".TITLE_3", GFX_SPECIAL_ARG_TITLE_3, },
5493 { ".TITLE_4", GFX_SPECIAL_ARG_TITLE_4, },
5494 { ".TITLE_5", GFX_SPECIAL_ARG_TITLE_5, },
5495 { ".MAIN", GFX_SPECIAL_ARG_MAIN, },
5496 { ".LEVELS", GFX_SPECIAL_ARG_LEVELS },
5497 { ".LEVELNR", GFX_SPECIAL_ARG_LEVELNR },
5498 { ".SCORES", GFX_SPECIAL_ARG_SCORES, },
5499 { ".EDITOR", GFX_SPECIAL_ARG_EDITOR, },
5500 { ".INFO", GFX_SPECIAL_ARG_INFO, },
5501 { ".SETUP", GFX_SPECIAL_ARG_SETUP, },
5502 { ".PLAYING", GFX_SPECIAL_ARG_PLAYING, },
5503 { ".DOOR", GFX_SPECIAL_ARG_DOOR, },
5504 { ".TAPE", GFX_SPECIAL_ARG_TAPE, },
5505 { ".PANEL", GFX_SPECIAL_ARG_PANEL, },
5506 { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, },
5507 { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, },
5508 { ".MAINONLY", GFX_SPECIAL_ARG_MAINONLY, },
5509 { ".TYPENAME", GFX_SPECIAL_ARG_TYPENAME, },
5510 { ".SUBMENU", GFX_SPECIAL_ARG_SUBMENU, },
5511 { ".MENU", GFX_SPECIAL_ARG_MENU, },
5512 { ".TOONS", GFX_SPECIAL_ARG_TOONS, },
5513 { ".FADING", GFX_SPECIAL_ARG_FADING, },
5514 { ".QUIT", GFX_SPECIAL_ARG_QUIT, },
5516 /* empty suffix always matches -- check as last entry in InitMusicInfo() */
5517 { "", GFX_SPECIAL_ARG_DEFAULT, },
5522 #include "conf_var.c" /* include auto-generated data structure definitions */
5525 /* ------------------------------------------------------------------------- */
5526 /* font definitions */
5527 /* ------------------------------------------------------------------------- */
5529 /* Important: When one entry is a prefix of another entry, the longer entry
5530 must come first, because the dynamic configuration does prefix matching!
5531 (These definitions must match the corresponding definitions in "main.h"!) */
5533 struct FontInfo font_info[NUM_FONTS + 1] =
5535 { "font.initial_1" },
5536 { "font.initial_2" },
5537 { "font.initial_3" },
5538 { "font.initial_4" },
5541 { "font.menu_1.active" },
5542 { "font.menu_2.active" },
5545 { "font.text_1.active" },
5546 { "font.text_2.active" },
5547 { "font.text_3.active" },
5548 { "font.text_4.active" },
5553 { "font.envelope_1" },
5554 { "font.envelope_2" },
5555 { "font.envelope_3" },
5556 { "font.envelope_4" },
5558 { "font.input_1.active" },
5559 { "font.input_2.active" },
5562 { "font.option_off_narrow" },
5563 { "font.option_off" },
5564 { "font.option_on_narrow" },
5565 { "font.option_on" },
5568 { "font.value_old" },
5569 { "font.value_narrow" },
5570 { "font.level_number.active" },
5571 { "font.level_number" },
5572 { "font.tape_recorder" },
5573 { "font.game_info" },
5574 { "font.info.elements" },
5575 { "font.info.levelset" },
5580 struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIM_TOKENS + 1] =
5582 /* (real) graphic definitions used to define animation graphics */
5583 { "gfx.global.anim_1", },
5584 { "gfx.global.anim_2", },
5585 { "gfx.global.anim_3", },
5586 { "gfx.global.anim_4", },
5587 { "gfx.global.anim_5", },
5588 { "gfx.global.anim_6", },
5589 { "gfx.global.anim_7", },
5590 { "gfx.global.anim_8", },
5592 /* (dummy) graphic definitions used to define animation controls */
5593 { "global.anim_1", },
5594 { "global.anim_2", },
5595 { "global.anim_3", },
5596 { "global.anim_4", },
5597 { "global.anim_5", },
5598 { "global.anim_6", },
5599 { "global.anim_7", },
5600 { "global.anim_8", },
5606 /* ------------------------------------------------------------------------- */
5607 /* music token prefix definitions */
5608 /* ------------------------------------------------------------------------- */
5610 struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] =
5612 { "background", TRUE },
5618 /* ========================================================================= */
5620 /* ========================================================================= */
5622 static void print_usage()
5625 "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
5628 " -b, --basepath DIRECTORY alternative base DIRECTORY\n"
5629 " -l, --level DIRECTORY alternative level DIRECTORY\n"
5630 " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n"
5631 " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n"
5632 " -m, --music DIRECTORY alternative music DIRECTORY\n"
5633 " -n, --network network multiplayer game\n"
5634 " --serveronly only start network server\n"
5635 " -v, --verbose verbose mode\n"
5636 " -V, --version show program version\n"
5637 " --debug display debugging information\n"
5638 " -e, --execute COMMAND execute batch COMMAND\n"
5640 "Valid commands for '--execute' option:\n"
5641 " \"print graphicsinfo.conf\" print default graphics config\n"
5642 " \"print soundsinfo.conf\" print default sounds config\n"
5643 " \"print musicinfo.conf\" print default music config\n"
5644 " \"print editorsetup.conf\" print default editor config\n"
5645 " \"print helpanim.conf\" print default helpanim config\n"
5646 " \"print helptext.conf\" print default helptext config\n"
5647 " \"dump level FILE\" dump level data from FILE\n"
5648 " \"dump tape FILE\" dump tape data from FILE\n"
5649 " \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n"
5650 " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
5651 " \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
5652 " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
5653 " \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
5654 " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
5656 program.command_basename);
5659 static void print_version()
5661 Print("%s %d.%d.%d.%d%s\n",
5662 PROGRAM_TITLE_STRING,
5663 PROGRAM_VERSION_MAJOR,
5664 PROGRAM_VERSION_MINOR,
5665 PROGRAM_VERSION_PATCH,
5666 PROGRAM_VERSION_BUILD,
5667 PROGRAM_VERSION_EXTRA);
5671 SDL_version sdl_version;
5673 SDL_VERSION(&sdl_version);
5674 Print("- SDL %d.%d.%d\n",
5679 SDL_IMAGE_VERSION(&sdl_version);
5680 Print("- SDL_image %d.%d.%d\n",
5685 SDL_MIXER_VERSION(&sdl_version);
5686 Print("- SDL_mixer %d.%d.%d\n",
5691 SDL_NET_VERSION(&sdl_version);
5692 Print("- SDL_net %d.%d.%d\n",
5699 static void InitProgramConfig(char *command_filename)
5701 char *program_title = PROGRAM_TITLE_STRING;
5702 char *program_icon_file = PROGRAM_ICON_FILENAME;
5703 char *config_filename = getProgramConfigFilename(command_filename);
5704 char *userdata_basename = getBaseNameNoSuffix(command_filename);
5705 char *userdata_subdir;
5706 char *userdata_subdir_unix;
5708 // read default program config, if existing
5709 if (fileExists(config_filename))
5711 // if program config file exists, derive Unix user data directory from it
5712 userdata_basename = getBaseName(config_filename);
5714 if (strSuffix(userdata_basename, ".conf"))
5715 userdata_basename[strlen(userdata_basename) - 5] = '\0';
5717 LoadSetupFromFilename(config_filename);
5720 // set user data directory for Linux/Unix (but not Mac OS X)
5721 userdata_subdir_unix = getStringCat2(".", userdata_basename);
5723 // set program title from potentially redefined program title
5724 if (setup.internal.program_title != NULL &&
5725 strlen(setup.internal.program_title) > 0)
5726 program_title = getStringCopy(setup.internal.program_title);
5728 // set program icon file from potentially redefined program icon file
5729 if (setup.internal.program_icon_file != NULL &&
5730 strlen(setup.internal.program_icon_file) > 0)
5731 program_icon_file = getStringCopy(setup.internal.program_icon_file);
5733 #if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX)
5734 userdata_subdir = program_title;
5735 #elif defined(PLATFORM_UNIX)
5736 userdata_subdir = userdata_subdir_unix;
5738 userdata_subdir = USERDATA_DIRECTORY_OTHER;
5741 // set default window size (only relevant on program startup)
5742 if (setup.internal.default_window_width != 0 &&
5743 setup.internal.default_window_height != 0)
5745 WIN_XSIZE = setup.internal.default_window_width;
5746 WIN_YSIZE = setup.internal.default_window_height;
5749 InitProgramInfo(command_filename,
5756 GAME_VERSION_ACTUAL);
5759 int main(int argc, char *argv[])
5761 InitProgramConfig(argv[0]);
5763 InitWindowTitleFunction(getWindowTitleString);
5764 InitExitMessageFunction(DisplayExitMessage);
5765 InitExitFunction(CloseAllAndExit);
5766 InitPlatformDependentStuff();
5768 GetOptions(argc, argv, print_usage, print_version);
5774 return 0; /* to keep compilers happy */