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_store;
24 Bitmap *bitmap_db_cross;
25 Bitmap *bitmap_db_field;
26 Bitmap *bitmap_db_panel;
27 Bitmap *bitmap_db_door_1;
28 Bitmap *bitmap_db_door_2;
29 Bitmap *bitmap_db_toons;
30 DrawBuffer *fieldbuffer;
31 DrawBuffer *drawto_field;
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 GameFrameDelay = GAME_FRAME_DELAY;
122 int FfwdFrameDelay = FFWD_FRAME_DELAY;
125 int SBX_Left, SBX_Right;
126 int SBY_Upper, SBY_Lower;
131 int TimeFrames, TimePlayed, TimeLeft, TapeTime;
133 boolean network_player_action_received = FALSE;
135 struct LevelSetInfo levelset;
136 struct LevelInfo level, level_template;
137 struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
138 struct HiScore highscore[MAX_SCORE_ENTRIES];
139 struct TapeInfo tape;
140 struct SetupInfo setup;
141 struct GameInfo game;
142 struct GlobalInfo global;
143 struct BorderInfo border;
144 struct ViewportInfo viewport;
145 struct TitleFadingInfo fading;
146 struct TitleFadingInfo title_initial_default;
147 struct TitleFadingInfo title_default;
148 struct TitleMessageInfo titlemessage_initial_default;
149 struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES];
150 struct TitleMessageInfo titlemessage_default;
151 struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES];
152 struct TitleMessageInfo readme;
153 struct InitInfo init, init_last;
154 struct MenuInfo menu;
155 struct DoorInfo door_1, door_2;
156 struct RequestInfo request;
157 struct PreviewInfo preview;
158 struct EditorInfo editor;
160 struct GraphicInfo *graphic_info = NULL;
161 struct SoundInfo *sound_info = NULL;
162 struct MusicInfo *music_info = NULL;
163 struct MusicFileInfo *music_file_info = NULL;
164 struct HelpAnimInfo *helpanim_info = NULL;
166 SetupFileHash *helptext_info = NULL;
167 SetupFileHash *image_config_hash = NULL;
168 SetupFileHash *element_token_hash = NULL;
169 SetupFileHash *graphic_token_hash = NULL;
170 SetupFileHash *font_token_hash = NULL;
173 /* ------------------------------------------------------------------------- */
174 /* element definitions */
175 /* ------------------------------------------------------------------------- */
177 struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1];
179 /* this contains predefined structure elements to initialize "element_info" */
180 struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
182 /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */
184 /* ----------------------------------------------------------------------- */
185 /* "real" level file elements */
186 /* ----------------------------------------------------------------------- */
236 "bug (random start direction)"
241 "spaceship (random start direction)"
246 "yam yam (random start direction)"
276 "quicksand (with rock)"
306 "dropping amoeba (EM style)"
321 "Conway's wall of life"
344 "robot_wheel.active",
346 "magic wheel (running)"
391 "gray door (opened by key 1)"
396 "gray door (opened by key 2)"
401 "gray door (opened by key 3)"
406 "gray door (opened by key 4)"
416 "pac man (random start direction)"
421 "invisible normal wall"
446 "amoeba with content"
466 "growing wall (horizontal, visible)"
481 "wall with BD style diamond"
484 "wall_emerald_yellow",
486 "wall with yellow emerald"
496 "magic wall (BD style)"
499 "invisible_steelwall",
501 "invisible steel wall"
504 "sokoban_field_player",
506 "sokoban field with player"
509 "dynabomb_increase_number",
511 "increases number of bombs"
514 "dynabomb_increase_size",
516 "increases explosion size"
519 "dynabomb_increase_power",
521 "increases power of explosion"
529 "sokoban_field_empty",
531 "sokoban empty field"
534 "sokoban_field_full",
536 "sokoban field with object"
539 "bd_butterfly.right",
541 "butterfly (starts moving right)"},
545 "butterfly (starts moving up)"
550 "butterfly (starts moving left)"},
554 "butterfly (starts moving down)"},
558 "firefly (starts moving right)"
563 "firefly (starts moving up)"
568 "firefly (starts moving left)"
573 "firefly (starts moving down)"
578 "butterfly (random start direction)"
583 "firefly (random start direction)"
608 "bug (starts moving right)"
613 "bug (starts moving up)"
618 "bug (starts moving left)"
623 "bug (starts moving down)"
628 "spaceship (starts moving right)"},
632 "spaceship (starts moving up)"
637 "spaceship (starts moving left)"},
641 "spaceship (starts moving down)"},
645 "pac man (starts moving right)"
650 "pac man (starts moving up)"
655 "pac man (starts moving left)"
660 "pac man (starts moving down)"
675 "wall with red emerald"
678 "wall_emerald_purple",
680 "wall with purple emerald"
685 "acid pool (top left)"
688 "acid_pool_topright",
690 "acid pool (top right)"
693 "acid_pool_bottomleft",
695 "acid pool (bottom left)"
703 "acid_pool_bottomright",
705 "acid pool (bottom right)"
710 "normal wall (BD style)"
735 "mole (random start direction)"
775 "fire breathing dragon"
778 "em_key_1_file_obsolete",
1088 "char_bracketright",
1183 "expandable_wall_horizontal",
1185 "growing wall (horizontal)"
1188 "expandable_wall_vertical",
1190 "growing wall (vertical)"
1193 "expandable_wall_any",
1195 "growing wall (any direction)"
1218 "em_key_2_file_obsolete",
1223 "em_key_3_file_obsolete",
1228 "em_key_4_file_obsolete",
1280 "port (leading right)"
1285 "port (leading down)"
1290 "port (leading left)"
1298 "sp_gravity_port_right",
1300 "gravity-on/off port (leading right)"
1303 "sp_gravity_port_down",
1305 "gravity-on/off port (leading down)"
1308 "sp_gravity_port_left",
1310 "gravity-on/off port (leading left)"
1313 "sp_gravity_port_up",
1315 "gravity-on/off port (leading up)"
1343 "sp_port_horizontal",
1350 "port (any direction)"
1373 "sp_hardware_base_1",
1378 "sp_hardware_green",
1393 "sp_hardware_yellow",
1398 "sp_hardware_base_2",
1403 "sp_hardware_base_3",
1408 "sp_hardware_base_4",
1413 "sp_hardware_base_5",
1418 "sp_hardware_base_6",
1435 "gray door (EM style, key 1)"
1440 "gray door (EM style, key 2)"
1445 "gray door (EM style, key 3)"
1450 "gray door (EM style, key 4)"
1455 "dynamite (EM style)"
1458 "em_dynamite.active",
1460 "burning dynamite (EM style)"
1488 "dc_gate_white_gray",
1490 "gray door (opened by white key)"
1510 "switch gate (open)"
1513 "switchgate_closed",
1515 "switch gate (closed)"
1518 "switchgate_switch_up",
1519 "switchgate_switch",
1520 "switch for switch gate"
1523 "switchgate_switch_down",
1524 "switchgate_switch",
1525 "switch for switch gate"
1538 "conveyor_belt_1_left",
1540 "conveyor belt 1 (left)"
1543 "conveyor_belt_1_middle",
1545 "conveyor belt 1 (middle)"
1548 "conveyor_belt_1_right",
1550 "conveyor belt 1 (right)"
1553 "conveyor_belt_1_switch_left",
1554 "conveyor_belt_switch",
1555 "switch for conveyor belt 1 (left)"
1558 "conveyor_belt_1_switch_middle",
1559 "conveyor_belt_switch",
1560 "switch for conveyor belt 1 (middle)"
1563 "conveyor_belt_1_switch_right",
1564 "conveyor_belt_switch",
1565 "switch for conveyor belt 1 (right)"
1568 "conveyor_belt_2_left",
1570 "conveyor belt 2 (left)"
1573 "conveyor_belt_2_middle",
1575 "conveyor belt 2 (middle)"
1578 "conveyor_belt_2_right",
1580 "conveyor belt 2 (right)"
1583 "conveyor_belt_2_switch_left",
1584 "conveyor_belt_switch",
1585 "switch for conveyor belt 2 (left)"
1588 "conveyor_belt_2_switch_middle",
1589 "conveyor_belt_switch",
1590 "switch for conveyor belt 2 (middle)"
1593 "conveyor_belt_2_switch_right",
1594 "conveyor_belt_switch",
1595 "switch for conveyor belt 2 (right)"
1598 "conveyor_belt_3_left",
1600 "conveyor belt 3 (left)"
1603 "conveyor_belt_3_middle",
1605 "conveyor belt 3 (middle)"
1608 "conveyor_belt_3_right",
1610 "conveyor belt 3 (right)"
1613 "conveyor_belt_3_switch_left",
1614 "conveyor_belt_switch",
1615 "switch for conveyor belt 3 (left)"
1618 "conveyor_belt_3_switch_middle",
1619 "conveyor_belt_switch",
1620 "switch for conveyor belt 3 (middle)"
1623 "conveyor_belt_3_switch_right",
1624 "conveyor_belt_switch",
1625 "switch for conveyor belt 3 (right)"
1628 "conveyor_belt_4_left",
1630 "conveyor belt 4 (left)"
1633 "conveyor_belt_4_middle",
1635 "conveyor belt 4 (middle)"
1638 "conveyor_belt_4_right",
1640 "conveyor belt 4 (right)"
1643 "conveyor_belt_4_switch_left",
1644 "conveyor_belt_switch",
1645 "switch for conveyor belt 4 (left)"
1648 "conveyor_belt_4_switch_middle",
1649 "conveyor_belt_switch",
1650 "switch for conveyor belt 4 (middle)"
1653 "conveyor_belt_4_switch_right",
1654 "conveyor_belt_switch",
1655 "switch for conveyor belt 4 (right)"
1660 "land mine (not removable)"
1663 "envelope_obsolete",
1665 "envelope (OBSOLETE)"
1670 "light switch (off)"
1673 "light_switch.active",
1680 "sign (exclamation)"
1683 "sign_radioactivity",
1685 "sign (radio activity)"
1695 "sign (wheel chair)"
1718 "sign_entry_forbidden",
1720 "sign (entry forbidden)"
1723 "sign_emergency_exit",
1725 "sign (emergency exit)"
1740 "mole (starts moving left)"
1745 "mole (starts moving right)"
1750 "mole (starts moving up)"
1755 "mole (starts moving down)"
1758 "steelwall_slippery",
1760 "slippery steel wall"
1770 "dx unknown element 15"
1775 "dx unknown element 42"
1790 "shield (deadly, kills enemies)"
1800 "time gate (closed)"
1803 "timegate_switch.active",
1805 "switch for time gate"
1810 "switch for time gate"
1818 "balloon_switch_left",
1820 "wind switch (left)"
1823 "balloon_switch_right",
1825 "wind switch (right)"
1828 "balloon_switch_up",
1833 "balloon_switch_down",
1835 "wind switch (down)"
1838 "balloon_switch_any",
1840 "wind switch (any direction)"
1905 "tube (any direction)"
1918 "tube_vertical_left",
1920 "tube (vertical & left)"
1923 "tube_vertical_right",
1925 "tube (vertical & right)"
1928 "tube_horizontal_up",
1930 "tube (horizontal & up)"
1933 "tube_horizontal_down",
1935 "tube (horizontal & down)"
1945 "tube (left & down)"
1955 "tube (right & down)"
1970 "stable bomb (DX style)"
2480 "custom element 100"
2485 "custom element 101"
2490 "custom element 102"
2495 "custom element 103"
2500 "custom element 104"
2505 "custom element 105"
2510 "custom element 106"
2515 "custom element 107"
2520 "custom element 108"
2525 "custom element 109"
2530 "custom element 110"
2535 "custom element 111"
2540 "custom element 112"
2545 "custom element 113"
2550 "custom element 114"
2555 "custom element 115"
2560 "custom element 116"
2565 "custom element 117"
2570 "custom element 118"
2575 "custom element 119"
2580 "custom element 120"
2585 "custom element 121"
2590 "custom element 122"
2595 "custom element 123"
2600 "custom element 124"
2605 "custom element 125"
2610 "custom element 126"
2615 "custom element 127"
2620 "custom element 128"
2625 "custom element 129"
2630 "custom element 130"
2635 "custom element 131"
2640 "custom element 132"
2645 "custom element 133"
2650 "custom element 134"
2655 "custom element 135"
2660 "custom element 136"
2665 "custom element 137"
2670 "custom element 138"
2675 "custom element 139"
2680 "custom element 140"
2685 "custom element 141"
2690 "custom element 142"
2695 "custom element 143"
2700 "custom element 144"
2705 "custom element 145"
2710 "custom element 146"
2715 "custom element 147"
2720 "custom element 148"
2725 "custom element 149"
2730 "custom element 150"
2735 "custom element 151"
2740 "custom element 152"
2745 "custom element 153"
2750 "custom element 154"
2755 "custom element 155"
2760 "custom element 156"
2765 "custom element 157"
2770 "custom element 158"
2775 "custom element 159"
2780 "custom element 160"
2785 "custom element 161"
2790 "custom element 162"
2795 "custom element 163"
2800 "custom element 164"
2805 "custom element 165"
2810 "custom element 166"
2815 "custom element 167"
2820 "custom element 168"
2825 "custom element 169"
2830 "custom element 170"
2835 "custom element 171"
2840 "custom element 172"
2845 "custom element 173"
2850 "custom element 174"
2855 "custom element 175"
2860 "custom element 176"
2865 "custom element 177"
2870 "custom element 178"
2875 "custom element 179"
2880 "custom element 180"
2885 "custom element 181"
2890 "custom element 182"
2895 "custom element 183"
2900 "custom element 184"
2905 "custom element 185"
2910 "custom element 186"
2915 "custom element 187"
2920 "custom element 188"
2925 "custom element 189"
2930 "custom element 190"
2935 "custom element 191"
2940 "custom element 192"
2945 "custom element 193"
2950 "custom element 194"
2955 "custom element 195"
2960 "custom element 196"
2965 "custom element 197"
2970 "custom element 198"
2975 "custom element 199"
2980 "custom element 200"
2985 "custom element 201"
2990 "custom element 202"
2995 "custom element 203"
3000 "custom element 204"
3005 "custom element 205"
3010 "custom element 206"
3015 "custom element 207"
3020 "custom element 208"
3025 "custom element 209"
3030 "custom element 210"
3035 "custom element 211"
3040 "custom element 212"
3045 "custom element 213"
3050 "custom element 214"
3055 "custom element 215"
3060 "custom element 216"
3065 "custom element 217"
3070 "custom element 218"
3075 "custom element 219"
3080 "custom element 220"
3085 "custom element 221"
3090 "custom element 222"
3095 "custom element 223"
3100 "custom element 224"
3105 "custom element 225"
3110 "custom element 226"
3115 "custom element 227"
3120 "custom element 228"
3125 "custom element 229"
3130 "custom element 230"
3135 "custom element 231"
3140 "custom element 232"
3145 "custom element 233"
3150 "custom element 234"
3155 "custom element 235"
3160 "custom element 236"
3165 "custom element 237"
3170 "custom element 238"
3175 "custom element 239"
3180 "custom element 240"
3185 "custom element 241"
3190 "custom element 242"
3195 "custom element 243"
3200 "custom element 244"
3205 "custom element 245"
3210 "custom element 246"
3215 "custom element 247"
3220 "custom element 248"
3225 "custom element 249"
3230 "custom element 250"
3235 "custom element 251"
3240 "custom element 252"
3245 "custom element 253"
3250 "custom element 254"
3255 "custom element 255"
3260 "custom element 256"
3470 "element triggering change"
3475 "player triggering change"
3478 "sp_gravity_on_port_right",
3479 "sp_gravity_on_port",
3480 "gravity-on port (leading right)"
3483 "sp_gravity_on_port_down",
3484 "sp_gravity_on_port",
3485 "gravity-on port (leading down)"
3488 "sp_gravity_on_port_left",
3489 "sp_gravity_on_port",
3490 "gravity-on port (leading left)"
3493 "sp_gravity_on_port_up",
3494 "sp_gravity_on_port",
3495 "gravity-on port (leading up)"
3498 "sp_gravity_off_port_right",
3499 "sp_gravity_off_port",
3500 "gravity-off port (leading right)"
3503 "sp_gravity_off_port_down",
3504 "sp_gravity_off_port",
3505 "gravity-off port (leading down)"
3508 "sp_gravity_off_port_left",
3509 "sp_gravity_off_port",
3510 "gravity-off port (leading left)"
3513 "sp_gravity_off_port_up",
3514 "sp_gravity_off_port",
3515 "gravity-off port (leading up)"
3518 "balloon_switch_none",
3525 "door 5 (EMC style)",
3530 "door 6 (EMC style)",
3535 "door 7 (EMC style)",
3540 "door 8 (EMC style)",
3545 "gray door (EMC style, key 5)",
3550 "gray door (EMC style, key 6)",
3555 "gray door (EMC style, key 7)",
3560 "gray door (EMC style, key 8)",
3565 "key 5 (EMC style)",
3570 "key 6 (EMC style)",
3575 "key 7 (EMC style)",
3580 "key 8 (EMC style)",
3598 "emc_magic_ball.active",
3600 "magic ball (activated)",
3603 "emc_magic_ball_switch",
3604 "emc_magic_ball_switch",
3605 "magic ball switch (off)",
3608 "emc_magic_ball_switch.active",
3609 "emc_magic_ball_switch",
3610 "magic ball switch (on)",
3613 "emc_spring_bumper",
3614 "emc_spring_bumper",
3673 "emc_wall_slippery_1",
3678 "emc_wall_slippery_2",
3683 "emc_wall_slippery_3",
3688 "emc_wall_slippery_4",
3710 "CE value of element triggering change"
3715 "CE score of element triggering change"
3720 "CE value of current element"
3725 "CE score of current element"
3730 "yam yam (starts moving left)"
3735 "yam yam (starts moving right)"
3740 "yam yam (starts moving up)"
3745 "yam yam (starts moving down)"
3748 "bd_expandable_wall",
3750 "growing wall (horizontal, BD style)"
3755 "CE 8 positions earlier in list"
3760 "CE 7 positions earlier in list"
3765 "CE 6 positions earlier in list"
3770 "CE 5 positions earlier in list"
3775 "CE 4 positions earlier in list"
3780 "CE 3 positions earlier in list"
3785 "CE 2 positions earlier in list"
3790 "CE 1 position earlier in list"
3795 "the current custom element"
3800 "CE 1 position later in list"
3805 "CE 2 positions later in list"
3810 "CE 3 positions later in list"
3815 "CE 4 positions later in list"
3820 "CE 5 positions later in list"
3825 "CE 6 positions later in list"
3830 "CE 7 positions later in list"
3835 "CE 8 positions later in list"
3840 "this element matches any element"
3848 "steel_char_exclam",
3853 "steel_char_quotedbl",
3858 "steel_char_numbersign",
3863 "steel_char_dollar",
3868 "steel_char_percent",
3873 "steel_char_ampersand",
3878 "steel_char_apostrophe",
3883 "steel_char_parenleft",
3888 "steel_char_parenright",
3893 "steel_char_asterisk",
3913 "steel_char_period",
3978 "steel_char_semicolon",
3993 "steel_char_greater",
3998 "steel_char_question",
4138 "steel_char_bracketleft",
4143 "steel_char_backslash",
4148 "steel_char_bracketright",
4153 "steel_char_asciicircum",
4158 "steel_char_underscore",
4163 "steel_char_copyright",
4165 "steel letter '\xa9'"
4168 "steel_char_aumlaut",
4170 "steel letter '\xc4'"
4173 "steel_char_oumlaut",
4175 "steel letter '\xd6'"
4178 "steel_char_uumlaut",
4180 "steel letter '\xdc'"
4183 "steel_char_degree",
4185 "steel letter '\xb0'"
4188 "steel_char_trademark",
4190 "steel letter '\xae'"
4193 "steel_char_cursor",
4195 "steel letter '\xa0'"
4198 "steel_char_unused",
4203 "steel_char_unused",
4208 "steel_char_unused",
4213 "steel_char_unused",
4218 "steel_char_unused",
4223 "steel_char_unused",
4228 "steel_char_unused",
4230 "steel letter 'button'"
4233 "steel_char_unused",
4238 "steel_char_unused",
4240 "steel letter 'down'"
4293 "steel_exit_closed",
4303 "dc_steelwall_1_left",
4308 "dc_steelwall_1_right",
4310 "steel wall (right)"
4313 "dc_steelwall_1_top",
4318 "dc_steelwall_1_bottom",
4320 "steel wall (bottom)"
4323 "dc_steelwall_1_horizontal",
4325 "steel wall (top/bottom)"
4328 "dc_steelwall_1_vertical",
4330 "steel wall (left/right)"
4333 "dc_steelwall_1_topleft",
4335 "steel wall (top/left)"
4338 "dc_steelwall_1_topright",
4340 "steel wall (top/right)"
4343 "dc_steelwall_1_bottomleft",
4345 "steel wall (bottom/left)"
4348 "dc_steelwall_1_bottomright",
4350 "steel wall (bottom/right)"
4353 "dc_steelwall_1_topleft_2",
4355 "steel wall (top/left corner)"
4358 "dc_steelwall_1_topright_2",
4360 "steel wall (top/right corner)"
4363 "dc_steelwall_1_bottomleft_2",
4365 "steel wall (bottom/left corner)"
4368 "dc_steelwall_1_bottomright_2",
4370 "steel wall (bottom/right corner)"
4373 "dc_steelwall_2_left",
4378 "dc_steelwall_2_right",
4380 "steel wall (right)"
4383 "dc_steelwall_2_top",
4388 "dc_steelwall_2_bottom",
4390 "steel wall (bottom)"
4393 "dc_steelwall_2_horizontal",
4395 "steel wall (horizontal)"
4398 "dc_steelwall_2_vertical",
4400 "steel wall (vertical)"
4403 "dc_steelwall_2_middle",
4405 "steel wall (middle)"
4408 "dc_steelwall_2_single",
4410 "steel wall (single)"
4413 "dc_switchgate_switch_up",
4414 "switchgate_switch",
4415 "switch for switch gate (steel)"
4418 "dc_switchgate_switch_down",
4419 "switchgate_switch",
4420 "switch for switch gate (steel)"
4423 "dc_timegate_switch",
4425 "switch for time gate (steel)"
4428 "dc_timegate_switch.active",
4430 "switch for time gate (steel)"
4435 "land mine (DC style, removable)"
4438 "expandable_steelwall",
4440 "growing steel wall"
4443 "expandable_steelwall_horizontal",
4445 "growing steel wall (horizontal)"
4448 "expandable_steelwall_vertical",
4450 "growing steel wall (vertical)"
4453 "expandable_steelwall_any",
4455 "growing steel wall (any direction)"
4460 "closed exit (EM style)"
4465 "open exit (EM style)"
4468 "em_steel_exit_closed",
4470 "closed steel exit (EM style)"
4473 "em_steel_exit_open",
4475 "open steel exit (EM style)"
4478 "dc_gate_fake_gray",
4480 "gray door (opened by no key)"
4485 "magic wall (DC style)"
4488 "quicksand_fast_empty",
4490 "fast quicksand (empty)"
4493 "quicksand_fast_full",
4495 "fast quicksand (with rock)"
4498 "from_level_template",
4499 "from_level_template",
4500 "element taken from level template"
4503 /* ----------------------------------------------------------------------- */
4504 /* "real" (and therefore drawable) runtime elements */
4505 /* ----------------------------------------------------------------------- */
4508 "dynabomb_player_1.active",
4513 "dynabomb_player_2.active",
4518 "dynabomb_player_3.active",
4523 "dynabomb_player_4.active",
4528 "sp_disk_red.active",
4533 "switchgate.opening",
4538 "switchgate.closing",
4563 "invisible_steelwall.active",
4568 "invisible_wall.active",
4573 "invisible_sand.active",
4578 "conveyor_belt_1_left.active",
4583 "conveyor_belt_1_middle.active",
4588 "conveyor_belt_1_right.active",
4593 "conveyor_belt_2_left.active",
4598 "conveyor_belt_2_middle.active",
4603 "conveyor_belt_2_right.active",
4608 "conveyor_belt_3_left.active",
4613 "conveyor_belt_3_middle.active",
4618 "conveyor_belt_3_right.active",
4623 "conveyor_belt_4_left.active",
4628 "conveyor_belt_4_middle.active",
4633 "conveyor_belt_4_right.active",
4648 "steel_exit.opening",
4653 "steel_exit.closing",
4668 "em_steel_exit.opening",
4673 "em_steel_exit.closing",
4693 "sp_terminal.active",
4698 "sp_buggy_base.activating",
4703 "sp_buggy_base.active",
4718 "quicksand.emptying",
4723 "quicksand_fast.emptying",
4728 "magic_wall.active",
4733 "bd_magic_wall.active",
4738 "dc_magic_wall.active",
4748 "bd_magic_wall_full",
4753 "dc_magic_wall_full",
4758 "magic_wall.emptying",
4763 "bd_magic_wall.emptying",
4768 "dc_magic_wall.emptying",
4778 "bd_magic_wall_dead",
4783 "dc_magic_wall_dead",
4789 "emc_fake_grass.active",
4794 "gate_1_gray.active",
4799 "gate_2_gray.active",
4804 "gate_3_gray.active",
4809 "gate_4_gray.active",
4814 "em_gate_1_gray.active",
4819 "em_gate_2_gray.active",
4824 "em_gate_3_gray.active",
4829 "em_gate_4_gray.active",
4834 "emc_gate_5_gray.active",
4839 "emc_gate_6_gray.active",
4844 "emc_gate_7_gray.active",
4849 "emc_gate_8_gray.active",
4854 "dc_gate_white_gray.active",
4859 "emc_dripper.active",
4864 "emc_spring_bumper.active",
4865 "emc_spring_bumper",
4869 /* ----------------------------------------------------------------------- */
4870 /* "unreal" (and therefore not drawable) runtime elements */
4871 /* ----------------------------------------------------------------------- */
4899 "acid_splash_right",
4914 "expandable_wall.growing",
4919 "expandable_steelwall.growing",
4929 "player_is_leaving",
4934 "player_is_exploding_1",
4939 "player_is_exploding_2",
4944 "player_is_exploding_3",
4949 "player_is_exploding_4",
4954 "quicksand.filling",
4959 "quicksand_fast.filling",
4964 "magic_wall.filling",
4969 "bd_magic_wall.filling",
4974 "dc_magic_wall.filling",
4984 "diagonal.shrinking",
4994 /* ----------------------------------------------------------------------- */
4995 /* dummy elements (never used as game elements, only used as graphics) */
4996 /* ----------------------------------------------------------------------- */
4999 "steelwall_topleft",
5004 "steelwall_topright",
5009 "steelwall_bottomleft",
5014 "steelwall_bottomright",
5019 "steelwall_horizontal",
5024 "steelwall_vertical",
5029 "invisible_steelwall_topleft",
5034 "invisible_steelwall_topright",
5039 "invisible_steelwall_bottomleft",
5044 "invisible_steelwall_bottomright",
5049 "invisible_steelwall_horizontal",
5054 "invisible_steelwall_vertical",
5069 "dynabomb_player_1",
5074 "dynabomb_player_2",
5079 "dynabomb_player_3",
5084 "dynabomb_player_4",
5089 "shield_normal.active",
5094 "shield_deadly.active",
5164 "internal_clipboard_custom",
5166 "empty custom element"
5169 "internal_clipboard_change",
5174 "internal_clipboard_group",
5176 "empty group element"
5184 "internal_cascade_bd",
5186 "show Boulder Dash elements"
5189 "internal_cascade_bd.active",
5191 "hide Boulder Dash elements"
5194 "internal_cascade_em",
5196 "show Emerald Mine elements"
5199 "internal_cascade_em.active",
5201 "hide Emerald Mine elements"
5204 "internal_cascade_emc",
5206 "show Emerald Mine Club elements"
5209 "internal_cascade_emc.active",
5211 "hide Emerald Mine Club elements"
5214 "internal_cascade_rnd",
5216 "show Rocks'n'Diamonds elements"
5219 "internal_cascade_rnd.active",
5221 "hide Rocks'n'Diamonds elements"
5224 "internal_cascade_sb",
5226 "show Sokoban elements"
5229 "internal_cascade_sb.active",
5231 "hide Sokoban elements"
5234 "internal_cascade_sp",
5236 "show Supaplex elements"
5239 "internal_cascade_sp.active",
5241 "hide Supaplex elements"
5244 "internal_cascade_dc",
5246 "show Diamond Caves II elements"
5249 "internal_cascade_dc.active",
5251 "hide Diamond Caves II elements"
5254 "internal_cascade_dx",
5256 "show DX Boulderdash elements"
5259 "internal_cascade_dx.active",
5261 "hide DX Boulderdash elements"
5264 "internal_cascade_chars",
5266 "show text elements"
5269 "internal_cascade_chars.active",
5271 "hide text elements"
5274 "internal_cascade_steel_chars",
5276 "show steel text elements"
5279 "internal_cascade_steel_chars.active",
5281 "hide steel text elements"
5284 "internal_cascade_ce",
5286 "show custom elements"
5289 "internal_cascade_ce.active",
5291 "hide custom elements"
5294 "internal_cascade_ge",
5296 "show group elements"
5299 "internal_cascade_ge.active",
5301 "hide group elements"
5304 "internal_cascade_ref",
5306 "show reference elements"
5309 "internal_cascade_ref.active",
5311 "hide reference elements"
5314 "internal_cascade_user",
5316 "show user defined elements"
5319 "internal_cascade_user.active",
5321 "hide user defined elements"
5324 "internal_cascade_dynamic",
5326 "show elements used in this level"
5329 "internal_cascade_dynamic.active",
5331 "hide elements used in this level"
5334 /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
5344 /* ------------------------------------------------------------------------- */
5345 /* element action and direction definitions */
5346 /* ------------------------------------------------------------------------- */
5348 struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
5350 { ".[DEFAULT]", ACTION_DEFAULT, TRUE },
5351 { ".waiting", ACTION_WAITING, TRUE },
5352 { ".falling", ACTION_FALLING, TRUE },
5353 { ".moving", ACTION_MOVING, TRUE },
5354 { ".digging", ACTION_DIGGING, FALSE },
5355 { ".snapping", ACTION_SNAPPING, FALSE },
5356 { ".collecting", ACTION_COLLECTING, FALSE },
5357 { ".dropping", ACTION_DROPPING, FALSE },
5358 { ".pushing", ACTION_PUSHING, FALSE },
5359 { ".walking", ACTION_WALKING, FALSE },
5360 { ".passing", ACTION_PASSING, FALSE },
5361 { ".impact", ACTION_IMPACT, FALSE },
5362 { ".breaking", ACTION_BREAKING, FALSE },
5363 { ".activating", ACTION_ACTIVATING, FALSE },
5364 { ".deactivating", ACTION_DEACTIVATING, FALSE },
5365 { ".opening", ACTION_OPENING, FALSE },
5366 { ".closing", ACTION_CLOSING, FALSE },
5367 { ".attacking", ACTION_ATTACKING, TRUE },
5368 { ".growing", ACTION_GROWING, TRUE },
5369 { ".shrinking", ACTION_SHRINKING, FALSE },
5370 { ".active", ACTION_ACTIVE, TRUE },
5371 { ".filling", ACTION_FILLING, FALSE },
5372 { ".emptying", ACTION_EMPTYING, FALSE },
5373 { ".changing", ACTION_CHANGING, FALSE },
5374 { ".exploding", ACTION_EXPLODING, FALSE },
5375 { ".boring", ACTION_BORING, FALSE },
5376 { ".boring[1]", ACTION_BORING_1, FALSE },
5377 { ".boring[2]", ACTION_BORING_2, FALSE },
5378 { ".boring[3]", ACTION_BORING_3, FALSE },
5379 { ".boring[4]", ACTION_BORING_4, FALSE },
5380 { ".boring[5]", ACTION_BORING_5, FALSE },
5381 { ".boring[6]", ACTION_BORING_6, FALSE },
5382 { ".boring[7]", ACTION_BORING_7, FALSE },
5383 { ".boring[8]", ACTION_BORING_8, FALSE },
5384 { ".boring[9]", ACTION_BORING_9, FALSE },
5385 { ".boring[10]", ACTION_BORING_10, FALSE },
5386 { ".sleeping", ACTION_SLEEPING, FALSE },
5387 { ".sleeping[1]", ACTION_SLEEPING_1, FALSE },
5388 { ".sleeping[2]", ACTION_SLEEPING_2, FALSE },
5389 { ".sleeping[3]", ACTION_SLEEPING_3, FALSE },
5390 { ".awakening", ACTION_AWAKENING, FALSE },
5391 { ".dying", ACTION_DYING, FALSE },
5392 { ".turning", ACTION_TURNING, FALSE },
5393 { ".turning_from_left", ACTION_TURNING_FROM_LEFT, FALSE },
5394 { ".turning_from_right", ACTION_TURNING_FROM_RIGHT, FALSE },
5395 { ".turning_from_up", ACTION_TURNING_FROM_UP, FALSE },
5396 { ".turning_from_down", ACTION_TURNING_FROM_DOWN, FALSE },
5397 { ".smashed_by_rock", ACTION_SMASHED_BY_ROCK, FALSE },
5398 { ".smashed_by_spring", ACTION_SMASHED_BY_SPRING, FALSE },
5399 { ".eating", ACTION_EATING, FALSE },
5400 { ".twinkling", ACTION_TWINKLING, FALSE },
5401 { ".splashing", ACTION_SPLASHING, FALSE },
5402 { ".page[1]", ACTION_PAGE_1, FALSE },
5403 { ".page[2]", ACTION_PAGE_2, FALSE },
5404 { ".page[3]", ACTION_PAGE_3, FALSE },
5405 { ".page[4]", ACTION_PAGE_4, FALSE },
5406 { ".page[5]", ACTION_PAGE_5, FALSE },
5407 { ".page[6]", ACTION_PAGE_6, FALSE },
5408 { ".page[7]", ACTION_PAGE_7, FALSE },
5409 { ".page[8]", ACTION_PAGE_8, FALSE },
5410 { ".page[9]", ACTION_PAGE_9, FALSE },
5411 { ".page[10]", ACTION_PAGE_10, FALSE },
5412 { ".page[11]", ACTION_PAGE_11, FALSE },
5413 { ".page[12]", ACTION_PAGE_12, FALSE },
5414 { ".page[13]", ACTION_PAGE_13, FALSE },
5415 { ".page[14]", ACTION_PAGE_14, FALSE },
5416 { ".page[15]", ACTION_PAGE_15, FALSE },
5417 { ".page[16]", ACTION_PAGE_16, FALSE },
5418 { ".page[17]", ACTION_PAGE_17, FALSE },
5419 { ".page[18]", ACTION_PAGE_18, FALSE },
5420 { ".page[19]", ACTION_PAGE_19, FALSE },
5421 { ".page[20]", ACTION_PAGE_20, FALSE },
5422 { ".page[21]", ACTION_PAGE_21, FALSE },
5423 { ".page[22]", ACTION_PAGE_22, FALSE },
5424 { ".page[23]", ACTION_PAGE_23, FALSE },
5425 { ".page[24]", ACTION_PAGE_24, FALSE },
5426 { ".page[25]", ACTION_PAGE_25, FALSE },
5427 { ".page[26]", ACTION_PAGE_26, FALSE },
5428 { ".page[27]", ACTION_PAGE_27, FALSE },
5429 { ".page[28]", ACTION_PAGE_28, FALSE },
5430 { ".page[29]", ACTION_PAGE_29, FALSE },
5431 { ".page[30]", ACTION_PAGE_30, FALSE },
5432 { ".page[31]", ACTION_PAGE_31, FALSE },
5433 { ".page[32]", ACTION_PAGE_32, FALSE },
5434 { ".other", ACTION_OTHER, FALSE },
5436 /* empty suffix always matches -- check as last entry in InitSoundInfo() */
5437 { "", ACTION_DEFAULT, TRUE },
5442 struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
5444 { ".left", MV_BIT_LEFT },
5445 { ".right", MV_BIT_RIGHT },
5446 { ".up", MV_BIT_UP },
5447 { ".down", MV_BIT_DOWN },
5448 { ".upleft", MV_BIT_UP },
5449 { ".upright", MV_BIT_RIGHT },
5450 { ".downleft", MV_BIT_LEFT },
5451 { ".downright", MV_BIT_DOWN },
5456 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
5458 { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, },
5459 { ".LOADING", GFX_SPECIAL_ARG_LOADING, },
5460 { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, },
5461 { ".TITLE", GFX_SPECIAL_ARG_TITLE, },
5462 { ".MAIN", GFX_SPECIAL_ARG_MAIN, },
5463 { ".LEVELS", GFX_SPECIAL_ARG_LEVELS },
5464 { ".LEVELNR", GFX_SPECIAL_ARG_LEVELNR },
5465 { ".SCORES", GFX_SPECIAL_ARG_SCORES, },
5466 { ".EDITOR", GFX_SPECIAL_ARG_EDITOR, },
5467 { ".INFO", GFX_SPECIAL_ARG_INFO, },
5468 { ".SETUP", GFX_SPECIAL_ARG_SETUP, },
5469 { ".PLAYING", GFX_SPECIAL_ARG_PLAYING, },
5470 { ".DOOR", GFX_SPECIAL_ARG_DOOR, },
5471 { ".TAPE", GFX_SPECIAL_ARG_TAPE, },
5472 { ".PANEL", GFX_SPECIAL_ARG_PANEL, },
5473 { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, },
5474 { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, },
5476 /* empty suffix always matches -- check as last entry in InitMusicInfo() */
5477 { "", GFX_SPECIAL_ARG_DEFAULT, },
5482 #include "conf_var.c" /* include auto-generated data structure definitions */
5485 /* ------------------------------------------------------------------------- */
5486 /* font definitions */
5487 /* ------------------------------------------------------------------------- */
5489 /* Important: When one entry is a prefix of another entry, the longer entry
5490 must come first, because the dynamic configuration does prefix matching!
5491 (These definitions must match the corresponding definitions in "main.h"!) */
5493 struct FontInfo font_info[NUM_FONTS + 1] =
5495 { "font.initial_1" },
5496 { "font.initial_2" },
5497 { "font.initial_3" },
5498 { "font.initial_4" },
5501 { "font.menu_1.active" },
5502 { "font.menu_2.active" },
5505 { "font.text_1.active" },
5506 { "font.text_2.active" },
5507 { "font.text_3.active" },
5508 { "font.text_4.active" },
5513 { "font.envelope_1" },
5514 { "font.envelope_2" },
5515 { "font.envelope_3" },
5516 { "font.envelope_4" },
5518 { "font.input_1.active" },
5519 { "font.input_2.active" },
5522 { "font.option_off" },
5523 { "font.option_on" },
5526 { "font.value_old" },
5527 { "font.level_number.active" },
5528 { "font.level_number" },
5529 { "font.tape_recorder" },
5530 { "font.game_info" },
5531 { "font.info.elements" },
5532 { "font.info.levelset" },
5538 /* ------------------------------------------------------------------------- */
5539 /* music token prefix definitions */
5540 /* ------------------------------------------------------------------------- */
5542 struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] =
5544 { "background", TRUE },
5550 /* ========================================================================= */
5552 /* ========================================================================= */
5554 static void print_usage()
5557 "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
5560 " -d, --display HOSTNAME[:SCREEN] specify X server display\n"
5561 " -b, --basepath DIRECTORY alternative base DIRECTORY\n"
5562 " -l, --level DIRECTORY alternative level DIRECTORY\n"
5563 " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n"
5564 " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n"
5565 " -m, --music DIRECTORY alternative music DIRECTORY\n"
5566 " -n, --network network multiplayer game\n"
5567 " --serveronly only start network server\n"
5568 " -v, --verbose verbose mode\n"
5569 " -V, --version show program version\n"
5570 " --debug display debugging information\n"
5571 " -e, --execute COMMAND execute batch COMMAND\n"
5573 "Valid commands for '--execute' option:\n"
5574 " \"print graphicsinfo.conf\" print default graphics config\n"
5575 " \"print soundsinfo.conf\" print default sounds config\n"
5576 " \"print musicinfo.conf\" print default music config\n"
5577 " \"print editorsetup.conf\" print default editor config\n"
5578 " \"print helpanim.conf\" print default helpanim config\n"
5579 " \"print helptext.conf\" print default helptext config\n"
5580 " \"dump level FILE\" dump level data from FILE\n"
5581 " \"dump tape FILE\" dump tape data from FILE\n"
5582 " \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n"
5583 " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
5584 " \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
5585 " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
5586 " \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
5587 " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
5589 program.command_basename);
5592 static void print_version()
5594 Print("%s %d.%d.%d.%d\n",
5595 PROGRAM_TITLE_STRING,
5596 PROGRAM_VERSION_MAJOR,
5597 PROGRAM_VERSION_MINOR,
5598 PROGRAM_VERSION_PATCH,
5599 PROGRAM_VERSION_BUILD);
5603 SDL_version sdl_version;
5605 SDL_VERSION(&sdl_version);
5606 Print("- SDL %d.%d.%d\n",
5611 SDL_IMAGE_VERSION(&sdl_version);
5612 Print("- SDL_image %d.%d.%d\n",
5617 SDL_MIXER_VERSION(&sdl_version);
5618 Print("- SDL_mixer %d.%d.%d\n",
5623 SDL_NET_VERSION(&sdl_version);
5624 Print("- SDL_net %d.%d.%d\n",
5631 static void InitProgramConfig(char *command_filename)
5633 char *command_basename = getBaseName(command_filename);
5634 char *config_filename = getProgramConfigFilename(command_filename);
5635 char *program_title = PROGRAM_TITLE_STRING;
5636 char *program_icon_file = PROGRAM_ICON_FILENAME;
5637 char *userdata_subdir;
5638 char *userdata_subdir_unix;
5640 // read default program config, if existing
5641 if (fileExists(config_filename))
5642 LoadSetupFromFilename(config_filename);
5644 // set program title from potentially redefined program title
5645 if (setup.internal.program_title != NULL &&
5646 strlen(setup.internal.program_title) > 0)
5647 program_title = getStringCopy(setup.internal.program_title);
5649 // set program icon file from potentially redefined program icon file
5650 if (setup.internal.program_icon_file != NULL &&
5651 strlen(setup.internal.program_icon_file) > 0)
5652 program_icon_file = getStringCopy(setup.internal.program_icon_file);
5654 // strip trailing executable suffix from command basename
5655 if (strSuffix(command_basename, ".exe"))
5656 command_basename[strlen(command_basename) - 4] = '\0';
5658 userdata_subdir_unix = getStringCat2(".", command_basename);
5660 #if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX)
5661 userdata_subdir = program_title;
5662 #elif defined(PLATFORM_UNIX)
5663 userdata_subdir = userdata_subdir_unix;
5665 userdata_subdir = USERDATA_DIRECTORY_OTHER;
5668 InitProgramInfo(command_filename,
5671 userdata_subdir_unix,
5676 GAME_VERSION_ACTUAL);
5679 int main(int argc, char *argv[])
5681 InitProgramConfig(argv[0]);
5683 InitWindowTitleFunction(getWindowTitleString);
5684 InitExitMessageFunction(DisplayExitMessage);
5685 InitExitFunction(CloseAllAndExit);
5686 InitPlatformDependentStuff();
5688 GetOptions(argv, print_usage, print_version);
5694 return 0; /* to keep compilers happy */