X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.c;h=1754e225f0f26d2ce3d978c6f60cbc5e53c37b43;hb=c2a639c0b2c1a9a2bd14de86932a47429ae918a4;hp=beec6a9b79c50816cb6320405eaea80cde5f3627;hpb=684f9040af5b97bc73676f8f8198688d87c3ea25;p=rocksndiamonds.git diff --git a/src/main.c b/src/main.c index beec6a9b..1754e225 100644 --- a/src/main.c +++ b/src/main.c @@ -44,14 +44,17 @@ short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; boolean Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -boolean Changing[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +unsigned long Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +unsigned long ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaCnt[MAX_NUM_AMOEBA]; short AmoebaCnt2[MAX_NUM_AMOEBA]; @@ -61,9 +64,10 @@ short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; unsigned long Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS]; int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int lev_fieldx, lev_fieldy; int scroll_x, scroll_y; @@ -87,6 +91,7 @@ int TimeFrames, TimePlayed, TimeLeft; boolean network_player_action_received = FALSE; +struct LevelSetInfo levelset; struct LevelInfo level, level_template; struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL; struct HiScore highscore[MAX_SCORE_ENTRIES]; @@ -95,9 +100,13 @@ struct SetupInfo setup; struct GameInfo game; struct GlobalInfo global; struct MenuInfo menu; -struct DoorInfo door; +struct DoorInfo door_1, door_2; struct GraphicInfo *graphic_info = NULL; struct SoundInfo *sound_info = NULL; +struct MusicInfo *music_info = NULL; +struct MusicFileInfo *music_file_info = NULL; +struct DemoAnimInfo *demo_anim_info = NULL; +SetupFileHash *demo_anim_text = NULL; /* ------------------------------------------------------------------------- */ @@ -128,9 +137,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "normal wall" }, { - "wall_crumbled", + "wall_slippery", "wall", - "round wall" + "slippery wall" }, { "rock", @@ -139,8 +148,8 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = }, { "key_obsolete", - "key", - "key" + "obsolete", + "key (OBSOLETE)" }, { "emerald", @@ -154,18 +163,18 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = }, { "player_obsolete", - "player", - "player" + "obsolete", + "player (OBSOLETE)" }, { "bug", "bug", - "bug" + "bug (random start direction)" }, { "spaceship", "spaceship", - "spaceship" + "spaceship (random start direction)" }, { "yamyam", @@ -253,7 +262,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "biomaze" }, { - "dynamite_active", + "dynamite.active", "dynamite", "burning dynamite" }, @@ -268,7 +277,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "magic wheel" }, { - "robot_wheel_active", + "robot_wheel.active", "robot_wheel", "magic wheel (running)" }, @@ -337,7 +346,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = { "pacman", "pacman", - "pac man" + "pac man (random start direction)" }, { "invisible_wall", @@ -350,7 +359,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "lamp (off)" }, { - "lamp_active", + "lamp.active", "lamp", "lamp (on)" }, @@ -460,51 +469,51 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "sokoban field with object" }, { - "bd_butterfly_right", + "bd_butterfly.right", "bd_butterfly", "butterfly (starts moving right)"}, { - "bd_butterfly_up", + "bd_butterfly.up", "bd_butterfly", "butterfly (starts moving up)" }, { - "bd_butterfly_left", + "bd_butterfly.left", "bd_butterfly", "butterfly (starts moving left)"}, { - "bd_butterfly_down", + "bd_butterfly.down", "bd_butterfly", "butterfly (starts moving down)"}, { - "bd_firefly_right", + "bd_firefly.right", "bd_firefly", "firefly (starts moving right)" }, { - "bd_firefly_up", + "bd_firefly.up", "bd_firefly", "firefly (starts moving up)" }, { - "bd_firefly_left", + "bd_firefly.left", "bd_firefly", "firefly (starts moving left)" }, { - "bd_firefly_down", + "bd_firefly.down", "bd_firefly", "firefly (starts moving down)" }, { "bd_butterfly", "bd_butterfly", - "butterfly" + "butterfly (random start direction)" }, { "bd_firefly", "bd_firefly", - "firefly" + "firefly (random start direction)" }, { "player_1", @@ -527,59 +536,59 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "blue player" }, { - "bug_right", + "bug.right", "bug", "bug (starts moving right)" }, { - "bug_up", + "bug.up", "bug", "bug (starts moving up)" }, { - "bug_left", + "bug.left", "bug", "bug (starts moving left)" }, { - "bug_down", + "bug.down", "bug", "bug (starts moving down)" }, { - "spaceship_right", + "spaceship.right", "spaceship", "spaceship (starts moving right)"}, { - "spaceship_up", + "spaceship.up", "spaceship", "spaceship (starts moving up)" }, { - "spaceship_left", + "spaceship.left", "spaceship", "spaceship (starts moving left)"}, { - "spaceship_down", + "spaceship.down", "spaceship", "spaceship (starts moving down)"}, { - "pacman_right", + "pacman.right", "pacman", "pac man (starts moving right)" }, { - "pacman_up", + "pacman.up", "pacman", "pac man (starts moving up)" }, { - "pacman_left", + "pacman.left", "pacman", "pac man (starts moving left)" }, { - "pacman_down", + "pacman.down", "pacman", "pac man (starts moving down)" }, @@ -656,7 +665,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = { "mole", "mole", - "mole" + "mole (random start direction)" }, { "penguin", @@ -699,9 +708,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "fire breathing dragon" }, { - "em_key_1_file", - "key", - "red key (EM style)" + "em_key_1_file_obsolete", + "obsolete", + "key (OBSOLETE)" }, { "char_space", @@ -1139,19 +1148,19 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "blue door (EM style)" }, { - "em_key_2_file", - "key", - "yellow key (EM style)" + "em_key_2_file_obsolete", + "obsolete", + "key (OBSOLETE)" }, { - "em_key_3_file", - "key", - "green key (EM style)" + "em_key_3_file_obsolete", + "obsolete", + "key (OBSOLETE)" }, { - "em_key_4_file", - "key", - "blue key (EM style)" + "em_key_4_file_obsolete", + "obsolete", + "key (OBSOLETE)" }, { "sp_empty_space", @@ -1221,22 +1230,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = { "sp_gravity_port_right", "sp_port", - "port (leading right)" + "gravity port (leading right)" }, { "sp_gravity_port_down", "sp_port", - "port (leading down)" + "gravity port (leading down)" }, { "sp_gravity_port_left", "sp_port", - "port (leading left)" + "gravity port (leading left)" }, { "sp_gravity_port_up", "sp_port", - "port (leading up)" + "gravity port (leading up)" }, { "sp_sniksnak", @@ -1584,9 +1593,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "land mine" }, { - "envelope", - "envelope", - "mail envelope" + "envelope_obsolete", + "obsolete", + "envelope (OBSOLETE)" }, { "light_switch", @@ -1594,7 +1603,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "light switch (off)" }, { - "light_switch_active", + "light_switch.active", "light_switch", "light switch (on)" }, @@ -1659,29 +1668,29 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "sign (other)" }, { - "mole_left", + "mole.left", "mole", "mole (starts moving left)" }, { - "mole_right", + "mole.right", "mole", "mole (starts moving right)" }, { - "mole_up", + "mole.up", "mole", "mole (starts moving up)" }, { - "mole_down", + "mole.down", "mole", "mole (starts moving down)" }, { - "steelwall_slanted", + "steelwall_slippery", "wall", - "steel wall (slanted)" + "slippery steel wall" }, { "invisible_sand", @@ -1724,7 +1733,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "time gate (closed)" }, { - "timegate_switch_active", + "timegate_switch.active", "timegate_switch", "switch for time gate" }, @@ -2543,183 +2552,858 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "custom", "custom element 128" }, - - /* ----------------------------------------------------------------------- */ - /* "real" (and therefore drawable) runtime elements */ - /* ----------------------------------------------------------------------- */ - + { + "custom_129", + "custom", + "custom element 129" + }, + { + "custom_130", + "custom", + "custom element 130" + }, + { + "custom_131", + "custom", + "custom element 131" + }, + { + "custom_132", + "custom", + "custom element 132" + }, + { + "custom_133", + "custom", + "custom element 133" + }, + { + "custom_134", + "custom", + "custom element 134" + }, + { + "custom_135", + "custom", + "custom element 135" + }, + { + "custom_136", + "custom", + "custom element 136" + }, + { + "custom_137", + "custom", + "custom element 137" + }, + { + "custom_138", + "custom", + "custom element 138" + }, + { + "custom_139", + "custom", + "custom element 139" + }, + { + "custom_140", + "custom", + "custom element 140" + }, + { + "custom_141", + "custom", + "custom element 141" + }, + { + "custom_142", + "custom", + "custom element 142" + }, + { + "custom_143", + "custom", + "custom element 143" + }, + { + "custom_144", + "custom", + "custom element 144" + }, + { + "custom_145", + "custom", + "custom element 145" + }, + { + "custom_146", + "custom", + "custom element 146" + }, + { + "custom_147", + "custom", + "custom element 147" + }, + { + "custom_148", + "custom", + "custom element 148" + }, + { + "custom_149", + "custom", + "custom element 149" + }, + { + "custom_150", + "custom", + "custom element 150" + }, + { + "custom_151", + "custom", + "custom element 151" + }, + { + "custom_152", + "custom", + "custom element 152" + }, + { + "custom_153", + "custom", + "custom element 153" + }, + { + "custom_154", + "custom", + "custom element 154" + }, + { + "custom_155", + "custom", + "custom element 155" + }, + { + "custom_156", + "custom", + "custom element 156" + }, + { + "custom_157", + "custom", + "custom element 157" + }, + { + "custom_158", + "custom", + "custom element 158" + }, + { + "custom_159", + "custom", + "custom element 159" + }, + { + "custom_160", + "custom", + "custom element 160" + }, + { + "custom_161", + "custom", + "custom element 161" + }, + { + "custom_162", + "custom", + "custom element 162" + }, + { + "custom_163", + "custom", + "custom element 163" + }, + { + "custom_164", + "custom", + "custom element 164" + }, + { + "custom_165", + "custom", + "custom element 165" + }, + { + "custom_166", + "custom", + "custom element 166" + }, + { + "custom_167", + "custom", + "custom element 167" + }, + { + "custom_168", + "custom", + "custom element 168" + }, + { + "custom_169", + "custom", + "custom element 169" + }, + { + "custom_170", + "custom", + "custom element 170" + }, + { + "custom_171", + "custom", + "custom element 171" + }, + { + "custom_172", + "custom", + "custom element 172" + }, + { + "custom_173", + "custom", + "custom element 173" + }, + { + "custom_174", + "custom", + "custom element 174" + }, + { + "custom_175", + "custom", + "custom element 175" + }, + { + "custom_176", + "custom", + "custom element 176" + }, + { + "custom_177", + "custom", + "custom element 177" + }, + { + "custom_178", + "custom", + "custom element 178" + }, + { + "custom_179", + "custom", + "custom element 179" + }, + { + "custom_180", + "custom", + "custom element 180" + }, + { + "custom_181", + "custom", + "custom element 181" + }, + { + "custom_182", + "custom", + "custom element 182" + }, + { + "custom_183", + "custom", + "custom element 183" + }, + { + "custom_184", + "custom", + "custom element 184" + }, + { + "custom_185", + "custom", + "custom element 185" + }, + { + "custom_186", + "custom", + "custom element 186" + }, + { + "custom_187", + "custom", + "custom element 187" + }, + { + "custom_188", + "custom", + "custom element 188" + }, + { + "custom_189", + "custom", + "custom element 189" + }, + { + "custom_190", + "custom", + "custom element 190" + }, + { + "custom_191", + "custom", + "custom element 191" + }, + { + "custom_192", + "custom", + "custom element 192" + }, + { + "custom_193", + "custom", + "custom element 193" + }, + { + "custom_194", + "custom", + "custom element 194" + }, + { + "custom_195", + "custom", + "custom element 195" + }, + { + "custom_196", + "custom", + "custom element 196" + }, + { + "custom_197", + "custom", + "custom element 197" + }, + { + "custom_198", + "custom", + "custom element 198" + }, + { + "custom_199", + "custom", + "custom element 199" + }, + { + "custom_200", + "custom", + "custom element 200" + }, + { + "custom_201", + "custom", + "custom element 201" + }, + { + "custom_202", + "custom", + "custom element 202" + }, + { + "custom_203", + "custom", + "custom element 203" + }, + { + "custom_204", + "custom", + "custom element 204" + }, + { + "custom_205", + "custom", + "custom element 205" + }, + { + "custom_206", + "custom", + "custom element 206" + }, + { + "custom_207", + "custom", + "custom element 207" + }, + { + "custom_208", + "custom", + "custom element 208" + }, + { + "custom_209", + "custom", + "custom element 209" + }, + { + "custom_210", + "custom", + "custom element 210" + }, + { + "custom_211", + "custom", + "custom element 211" + }, + { + "custom_212", + "custom", + "custom element 212" + }, + { + "custom_213", + "custom", + "custom element 213" + }, + { + "custom_214", + "custom", + "custom element 214" + }, + { + "custom_215", + "custom", + "custom element 215" + }, + { + "custom_216", + "custom", + "custom element 216" + }, + { + "custom_217", + "custom", + "custom element 217" + }, + { + "custom_218", + "custom", + "custom element 218" + }, + { + "custom_219", + "custom", + "custom element 219" + }, + { + "custom_220", + "custom", + "custom element 220" + }, + { + "custom_221", + "custom", + "custom element 221" + }, + { + "custom_222", + "custom", + "custom element 222" + }, + { + "custom_223", + "custom", + "custom element 223" + }, + { + "custom_224", + "custom", + "custom element 224" + }, + { + "custom_225", + "custom", + "custom element 225" + }, + { + "custom_226", + "custom", + "custom element 226" + }, + { + "custom_227", + "custom", + "custom element 227" + }, + { + "custom_228", + "custom", + "custom element 228" + }, + { + "custom_229", + "custom", + "custom element 229" + }, + { + "custom_230", + "custom", + "custom element 230" + }, + { + "custom_231", + "custom", + "custom element 231" + }, + { + "custom_232", + "custom", + "custom element 232" + }, + { + "custom_233", + "custom", + "custom element 233" + }, + { + "custom_234", + "custom", + "custom element 234" + }, + { + "custom_235", + "custom", + "custom element 235" + }, + { + "custom_236", + "custom", + "custom element 236" + }, + { + "custom_237", + "custom", + "custom element 237" + }, + { + "custom_238", + "custom", + "custom element 238" + }, + { + "custom_239", + "custom", + "custom element 239" + }, + { + "custom_240", + "custom", + "custom element 240" + }, + { + "custom_241", + "custom", + "custom element 241" + }, + { + "custom_242", + "custom", + "custom element 242" + }, + { + "custom_243", + "custom", + "custom element 243" + }, + { + "custom_244", + "custom", + "custom element 244" + }, + { + "custom_245", + "custom", + "custom element 245" + }, + { + "custom_246", + "custom", + "custom element 246" + }, + { + "custom_247", + "custom", + "custom element 247" + }, + { + "custom_248", + "custom", + "custom element 248" + }, + { + "custom_249", + "custom", + "custom element 249" + }, + { + "custom_250", + "custom", + "custom element 250" + }, + { + "custom_251", + "custom", + "custom element 251" + }, + { + "custom_252", + "custom", + "custom element 252" + }, + { + "custom_253", + "custom", + "custom element 253" + }, + { + "custom_254", + "custom", + "custom element 254" + }, + { + "custom_255", + "custom", + "custom element 255" + }, + { + "custom_256", + "custom", + "custom element 256" + }, { "em_key_1", "key", - "-" + "red key (EM style)" }, { "em_key_2", "key", - "-" + "yellow key (EM style)" }, { "em_key_3", "key", - "-" + "green key (EM style)" }, { "em_key_4", "key", - "-" + "blue key (EM style)" }, { - "dynabomb_player_1_active", + "envelope_1", + "envelope", + "mail envelope 1" + }, + { + "envelope_2", + "envelope", + "mail envelope 2" + }, + { + "envelope_3", + "envelope", + "mail envelope 3" + }, + { + "envelope_4", + "envelope", + "mail envelope 4" + }, + + /* ----------------------------------------------------------------------- */ + /* "real" (and therefore drawable) runtime elements */ + /* ----------------------------------------------------------------------- */ + + { + "dynabomb_player_1.active", "dynabomb", "-" }, { - "dynabomb_player_2_active", + "dynabomb_player_2.active", "dynabomb", "-" }, { - "dynabomb_player_3_active", + "dynabomb_player_3.active", "dynabomb", "-" }, { - "dynabomb_player_4_active", + "dynabomb_player_4.active", "dynabomb", "-" }, { - "sp_disk_red_active", + "sp_disk_red.active", "dynamite", "-" }, { - "switchgate_opening", + "switchgate.opening", "switchgate", "-" }, { - "switchgate_closing", + "switchgate.closing", "switchgate", "-" }, { - "timegate_opening", + "timegate.opening", "timegate", "-" }, { - "timegate_closing", + "timegate.closing", "timegate", "-" }, { - "pearl_breaking", + "pearl.breaking", "pearl", "-" }, { - "trap_active", + "trap.active", "trap", "-" }, { - "invisible_steelwall_active", + "invisible_steelwall.active", "wall", "-" }, { - "invisible_wall_active", + "invisible_wall.active", "wall", "-" }, { - "invisible_sand_active", + "invisible_sand.active", "sand", "-" }, { - "conveyor_belt_1_left_active", + "conveyor_belt_1_left.active", "conveyor_belt", "-" }, { - "conveyor_belt_1_middle_active", + "conveyor_belt_1_middle.active", "conveyor_belt", "-" }, { - "conveyor_belt_1_right_active", + "conveyor_belt_1_right.active", "conveyor_belt", "-" }, { - "conveyor_belt_2_left_active", + "conveyor_belt_2_left.active", "conveyor_belt", "-" }, { - "conveyor_belt_2_middle_active", + "conveyor_belt_2_middle.active", "conveyor_belt", "-" }, { - "conveyor_belt_2_right_active", + "conveyor_belt_2_right.active", "conveyor_belt", "-" }, { - "conveyor_belt_3_left_active", + "conveyor_belt_3_left.active", "conveyor_belt", "-" }, { - "conveyor_belt_3_middle_active", + "conveyor_belt_3_middle.active", "conveyor_belt", "-" }, { - "conveyor_belt_3_right_active", + "conveyor_belt_3_right.active", "conveyor_belt", "-" }, { - "conveyor_belt_4_left_active", + "conveyor_belt_4_left.active", "conveyor_belt", "-" }, { - "conveyor_belt_4_middle_active", + "conveyor_belt_4_middle.active", "conveyor_belt", "-" }, { - "conveyor_belt_4_right_active", + "conveyor_belt_4_right.active", "conveyor_belt", "-" }, { - "exit_opening", + "exit.opening", + "exit", + "-" + }, + { + "exit.closing", "exit", "-" }, + { + "sp_exit.opening", + "sp_exit", + "-" + }, + { + "sp_exit.closing", + "sp_exit", + "-" + }, { "sp_exit_open", "sp_exit", "-" }, { - "sp_terminal_active", + "sp_terminal.active", "sp_terminal", "-" }, { - "sp_buggy_base_activating", + "sp_buggy_base.activating", "sp_buggy_base", "-" }, { - "sp_buggy_base_active", + "sp_buggy_base.active", "sp_buggy_base", "-" }, @@ -2729,22 +3413,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "amoeba_dropping", + "amoeba.dropping", "amoeba", "-" }, { - "quicksand_emptying", + "quicksand.emptying", "quicksand", "-" }, { - "magic_wall_active", + "magic_wall.active", "magic_wall", "-" }, { - "bd_magic_wall_active", + "bd_magic_wall.active", "magic_wall", "-" }, @@ -2759,12 +3443,12 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "magic_wall_emptying", + "magic_wall.emptying", "magic_wall", "-" }, { - "bd_magic_wall_emptying", + "bd_magic_wall.emptying", "magic_wall", "-" }, @@ -2794,12 +3478,12 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "nut_breaking", + "nut.breaking", "-", "-" }, { - "diamond_breaking", + "diamond.breaking", "-", "-" }, @@ -2814,17 +3498,17 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "amoeba_growing", + "amoeba.growing", "-", "-" }, { - "amoeba_shrinking", + "amoeba.shrinking", "-", "-" }, { - "expandable_wall_growing", + "expandable_wall.growing", "-", "-" }, @@ -2839,17 +3523,17 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "quicksand_filling", + "quicksand.filling", "quicksand", "-" }, { - "magic_wall_filling", + "magic_wall.filling", "-", "-" }, { - "bd_magic_wall_filling", + "bd_magic_wall.filling", "-", "-" }, @@ -2918,18 +3602,13 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, - { - "sand_crumbled", - "-", - "-" - }, { "dynabomb", "-", "-" }, { - "dynabomb_active", + "dynabomb.active", "-", "-" }, @@ -2954,15 +3633,20 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "shield_normal_active", + "shield_normal.active", "-", "-" }, { - "shield_deadly_active", + "shield_deadly.active", "-", "-" }, + { + "amoeba", + "amoeba", + "-" + }, { "[default]", "default", @@ -2983,6 +3667,11 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "sb_default", "-" }, + { + "dummy", + "dummy", + "-" + }, /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */ @@ -3000,38 +3689,59 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { - { ".[DEFAULT]", ACTION_DEFAULT, TRUE }, - { ".waiting", ACTION_WAITING, TRUE }, - { ".falling", ACTION_FALLING, TRUE }, - { ".moving", ACTION_MOVING, TRUE }, - { ".digging", ACTION_DIGGING, FALSE }, - { ".snapping", ACTION_SNAPPING, FALSE }, - { ".collecting", ACTION_COLLECTING, FALSE }, - { ".dropping", ACTION_DROPPING, FALSE }, - { ".pushing", ACTION_PUSHING, FALSE }, - { ".walking", ACTION_WALKING, FALSE }, - { ".passing", ACTION_PASSING, FALSE }, - { ".impact", ACTION_IMPACT, FALSE }, - { ".breaking", ACTION_BREAKING, FALSE }, - { ".activating", ACTION_ACTIVATING, FALSE }, - { ".deactivating", ACTION_DEACTIVATING, FALSE }, - { ".opening", ACTION_OPENING, FALSE }, - { ".closing", ACTION_CLOSING, FALSE }, - { ".attacking", ACTION_ATTACKING, TRUE }, - { ".growing", ACTION_GROWING, TRUE }, - { ".shrinking", ACTION_SHRINKING, FALSE }, - { ".active", ACTION_ACTIVE, TRUE }, - { ".filling", ACTION_FILLING, FALSE }, - { ".emptying", ACTION_EMPTYING, FALSE }, - { ".changing", ACTION_CHANGING, FALSE }, - { ".exploding", ACTION_EXPLODING, FALSE }, - { ".dying", ACTION_DYING, FALSE }, - { ".other", ACTION_OTHER, FALSE }, + { ".[DEFAULT]", ACTION_DEFAULT, TRUE }, + { ".waiting", ACTION_WAITING, TRUE }, + { ".falling", ACTION_FALLING, TRUE }, + { ".moving", ACTION_MOVING, TRUE }, + { ".digging", ACTION_DIGGING, FALSE }, + { ".snapping", ACTION_SNAPPING, FALSE }, + { ".collecting", ACTION_COLLECTING, FALSE }, + { ".dropping", ACTION_DROPPING, FALSE }, + { ".pushing", ACTION_PUSHING, FALSE }, + { ".walking", ACTION_WALKING, FALSE }, + { ".passing", ACTION_PASSING, FALSE }, + { ".impact", ACTION_IMPACT, FALSE }, + { ".breaking", ACTION_BREAKING, FALSE }, + { ".activating", ACTION_ACTIVATING, FALSE }, + { ".deactivating", ACTION_DEACTIVATING, FALSE }, + { ".opening", ACTION_OPENING, FALSE }, + { ".closing", ACTION_CLOSING, FALSE }, + { ".attacking", ACTION_ATTACKING, TRUE }, + { ".growing", ACTION_GROWING, TRUE }, + { ".shrinking", ACTION_SHRINKING, FALSE }, + { ".active", ACTION_ACTIVE, TRUE }, + { ".filling", ACTION_FILLING, FALSE }, + { ".emptying", ACTION_EMPTYING, FALSE }, + { ".changing", ACTION_CHANGING, FALSE }, + { ".exploding", ACTION_EXPLODING, FALSE }, + { ".boring", ACTION_BORING, FALSE }, + { ".boring[1]", ACTION_BORING_1, FALSE }, + { ".boring[2]", ACTION_BORING_2, FALSE }, + { ".boring[3]", ACTION_BORING_3, FALSE }, + { ".boring[4]", ACTION_BORING_4, FALSE }, + { ".boring[5]", ACTION_BORING_5, FALSE }, + { ".boring[6]", ACTION_BORING_6, FALSE }, + { ".boring[7]", ACTION_BORING_7, FALSE }, + { ".boring[8]", ACTION_BORING_8, FALSE }, + { ".boring[9]", ACTION_BORING_9, FALSE }, + { ".boring[10]", ACTION_BORING_10, FALSE }, + { ".sleeping", ACTION_SLEEPING, FALSE }, + { ".sleeping[1]", ACTION_SLEEPING_1, FALSE }, + { ".sleeping[2]", ACTION_SLEEPING_2, FALSE }, + { ".sleeping[3]", ACTION_SLEEPING_3, FALSE }, + { ".awakening", ACTION_AWAKENING, FALSE }, + { ".dying", ACTION_DYING, FALSE }, + { ".turning", ACTION_TURNING, FALSE }, + { ".turning_from_left", ACTION_TURNING_FROM_LEFT, FALSE }, + { ".turning_from_right", ACTION_TURNING_FROM_RIGHT, FALSE }, + { ".turning_from_up", ACTION_TURNING_FROM_UP, FALSE }, + { ".turning_from_down", ACTION_TURNING_FROM_DOWN, FALSE }, + { ".other", ACTION_OTHER, FALSE }, /* empty suffix always matches -- check as last entry in InitSoundInfo() */ - { "", ACTION_DEFAULT, TRUE }, + { "", ACTION_DEFAULT, TRUE }, - { NULL, 0, 0 } + { NULL, 0, 0 } }; struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] = @@ -3044,16 +3754,22 @@ struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] = { NULL, 0 } }; -struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] = +struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { + { ".[DEFAULT]", GAME_MODE_DEFAULT, }, { ".MAIN", GAME_MODE_MAIN, }, { ".LEVELS", GAME_MODE_LEVELS }, { ".SCORES", GAME_MODE_SCORES, }, { ".EDITOR", GAME_MODE_EDITOR, }, { ".INFO", GAME_MODE_INFO, }, { ".SETUP", GAME_MODE_SETUP, }, + { ".PLAYING", GAME_MODE_PLAYING, }, { ".DOOR", GAME_MODE_PSEUDO_DOOR, }, { ".PREVIEW", GAME_MODE_PSEUDO_PREVIEW, }, + { ".CRUMBLED", GAME_MODE_PSEUDO_CRUMBLED, }, + + /* empty suffix always matches -- check as last entry in InitMusicInfo() */ + { "", GAME_MODE_DEFAULT, }, { NULL, 0, } }; @@ -3084,8 +3800,17 @@ struct TokenIntPtrInfo image_config_vars[] = { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] }, { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] }, - { "door.step_offset", &door.step_offset }, - { "door.step_delay", &door.step_delay }, + { "door_1.step_offset", &door_1.step_offset }, + { "door_1.step_delay", &door_1.step_delay }, + { "door_1.anim_mode", &door_1.anim_mode }, + { "door_2.step_offset", &door_2.step_offset }, + { "door_2.step_delay", &door_2.step_delay }, + { "door_2.anim_mode", &door_2.anim_mode }, + + { "[player].boring_delay_fixed", &game.player_boring_delay_fixed }, + { "[player].boring_delay_random", &game.player_boring_delay_random }, + { "[player].sleeping_delay_fixed", &game.player_sleeping_delay_fixed }, + { "[player].sleeping_delay_random", &game.player_sleeping_delay_random }, { NULL, NULL, } }; @@ -3116,6 +3841,10 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.text_2" }, { "font.text_3" }, { "font.text_4" }, + { "font.envelope_1" }, + { "font.envelope_2" }, + { "font.envelope_3" }, + { "font.envelope_4" }, { "font.input_1.active" }, { "font.input_2.active" }, { "font.input_1" }, @@ -3131,10 +3860,52 @@ struct FontInfo font_info[NUM_FONTS + 1] = }; +/* ------------------------------------------------------------------------- */ +/* music token prefix definitions */ +/* ------------------------------------------------------------------------- */ + +struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] = +{ + { "background", TRUE }, + + { NULL, 0 } +}; + + /* ========================================================================= */ /* main() */ /* ========================================================================= */ +static void print_usage() +{ + printf("\n" + "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n" + "\n" + "Options:\n" + " -d, --display HOSTNAME[:SCREEN] specify X server display\n" + " -b, --basepath DIRECTORY alternative base DIRECTORY\n" + " -l, --level DIRECTORY alternative level DIRECTORY\n" + " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n" + " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n" + " -m, --music DIRECTORY alternative music DIRECTORY\n" + " -n, --network network multiplayer game\n" + " --serveronly only start network server\n" + " -v, --verbose verbose mode\n" + " --debug display debugging information\n" + " -e, --execute COMMAND execute batch COMMAND:\n" + "\n" + "Valid commands for '--execute' option:\n" + " \"print graphicsinfo.conf\" print default graphics config\n" + " \"print soundsinfo.conf\" print default sounds config\n" + " \"print musicinfo.conf\" print default music config\n" + " \"print editorsetup.conf\" print default editor config\n" + " \"dump level FILE\" dump level data from FILE\n" + " \"dump tape FILE\" dump tape data from FILE\n" + " \"autoplay LEVELDIR\" play level tapes for LEVELDIR\n" + "\n", + program.command_basename); +} + int main(int argc, char *argv[]) { InitProgramInfo(argv[0], USERDATA_DIRECTORY, @@ -3146,7 +3917,7 @@ int main(int argc, char *argv[]) InitExitFunction(CloseAllAndExit); InitPlatformDependentStuff(); - GetOptions(argv); + GetOptions(argv, print_usage); OpenAll(); EventLoop();