X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.c;h=8769913c2c62db8983194cd0f9b9b0ae3de4a076;hb=4b1b5a2a67227d3023ff6da4596be31eae8eaefc;hp=ad9f4f9938979329d0f55bb548e406215ea7028f;hpb=42e820b32f8ff2a7f9fc6daa4e5a831e95c63ad8;p=rocksndiamonds.git diff --git a/src/main.c b/src/main.c index ad9f4f99..8769913c 100644 --- a/src/main.c +++ b/src/main.c @@ -34,6 +34,11 @@ int game_status = -1; boolean level_editor_test_game = FALSE; boolean network_playing = FALSE; +#if defined(TARGET_SDL) +boolean network_server = FALSE; +SDL_Thread *server_thread; +#endif + int key_joystick_mapping = 0; boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; @@ -55,11 +60,13 @@ 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 CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaCnt[MAX_NUM_AMOEBA]; short AmoebaCnt2[MAX_NUM_AMOEBA]; -short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; @@ -89,7 +96,7 @@ int ZX, ZY; int ExitX, ExitY; int AllPlayersGone; -int TimeFrames, TimePlayed, TimeLeft; +int TimeFrames, TimePlayed, TimeLeft, TapeTime; boolean network_player_action_received = FALSE; @@ -115,7 +122,10 @@ SetupFileHash *helptext_info = NULL; /* element definitions */ /* ------------------------------------------------------------------------- */ -struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = +struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1]; + +/* this contains predefined structure elements to initialize "element_info" */ +struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */ @@ -436,9 +446,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "invisible steel wall" }, { - "maze_runner", - "maze_runner", - "maze runner" + "sokoban_field_player", + "sokoban", + "sokoban field with player" }, { "dynabomb_increase_number", @@ -657,7 +667,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = { "black_orb", "black_orb", - "bomb" + "black orb bomb" }, { "amoeba_to_diamond", @@ -740,7 +750,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "letter '$'" }, { - "char_procent", + "char_percent", "char", "letter '%'" }, @@ -1772,7 +1782,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = { "balloon_switch_any", "balloon_switch", - "send balloon in any direction" + "send balloon in pressed direction" }, { "emc_steelwall_1", @@ -3394,6 +3404,251 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "group", "group element 32" }, + { + "unknown", + "unknown", + "unknown element" + }, + { + "trigger_element", + "trigger", + "element triggering change" + }, + { + "trigger_player", + "trigger", + "player triggering change" + }, + { + "sp_gravity_on_port_right", + "sp_port", + "gravity on port (leading right)" + }, + { + "sp_gravity_on_port_down", + "sp_port", + "gravity on port (leading down)" + }, + { + "sp_gravity_on_port_left", + "sp_port", + "gravity on port (leading left)" + }, + { + "sp_gravity_on_port_up", + "sp_port", + "gravity on port (leading up)" + }, + { + "sp_gravity_off_port_right", + "sp_port", + "gravity off port (leading right)" + }, + { + "sp_gravity_off_port_down", + "sp_port", + "gravity off port (leading down)" + }, + { + "sp_gravity_off_port_left", + "sp_port", + "gravity off port (leading left)" + }, + { + "sp_gravity_off_port_up", + "sp_port", + "gravity off port (leading up)" + }, + { + "balloon_switch_none", + "balloon_switch", + "stop moving balloon" + }, + { + "emc_gate_5", + "gate", + "door 5 (EMC style)", + }, + { + "emc_gate_6", + "gate", + "door 6 (EMC style)", + }, + { + "emc_gate_7", + "gate", + "door 7 (EMC style)", + }, + { + "emc_gate_8", + "gate", + "door 8 (EMC style)", + }, + { + "emc_gate_5_gray", + "gate", + "gray door (EMC style, key 5)", + }, + { + "emc_gate_6_gray", + "gate", + "gray door (EMC style, key 6)", + }, + { + "emc_gate_7_gray", + "gate", + "gray door (EMC style, key 7)", + }, + { + "emc_gate_8_gray", + "gate", + "gray door (EMC style, key 8)", + }, + { + "emc_key_5", + "key", + "key 5 (EMC style)", + }, + { + "emc_key_6", + "key", + "key 6 (EMC style)", + }, + { + "emc_key_7", + "key", + "key 7 (EMC style)", + }, + { + "emc_key_8", + "key", + "key 8 (EMC style)", + }, + { + "emc_android", + "emc_android", + "android", + }, + { + "emc_grass", + "emc_grass", + "grass", + }, + { + "emc_magic_ball", + "emc_magic_ball", + "magic ball", + }, + { + "emc_magic_ball.active", + "emc_magic_ball", + "magic ball (activated)", + }, + { + "emc_magic_ball_switch", + "emc_magic_ball_switch", + "magic ball switch (off)", + }, + { + "emc_magic_ball_switch.active", + "emc_magic_ball_switch", + "magic ball switch (on)", + }, + { + "emc_spring_bumper", + "emc_spring_bumper", + "spring bumper", + }, + { + "emc_plant", + "emc_plant", + "plant", + }, + { + "emc_lenses", + "emc_lenses", + "lenses", + }, + { + "emc_magnifier", + "emc_magnifier", + "magnifier", + }, + { + "emc_wall_9", + "wall", + "normal wall" + }, + { + "emc_wall_10", + "wall", + "normal wall" + }, + { + "emc_wall_11", + "wall", + "normal wall" + }, + { + "emc_wall_12", + "wall", + "normal wall" + }, + { + "emc_wall_13", + "wall", + "normal wall" + }, + { + "emc_wall_14", + "wall", + "normal wall" + }, + { + "emc_wall_15", + "wall", + "normal wall" + }, + { + "emc_wall_16", + "wall", + "normal wall" + }, + { + "emc_wall_slippery_1", + "wall", + "slippery wall" + }, + { + "emc_wall_slippery_2", + "wall", + "slippery wall" + }, + { + "emc_wall_slippery_3", + "wall", + "slippery wall" + }, + { + "emc_wall_slippery_4", + "wall", + "slippery wall" + }, + { + "emc_fake_grass", + "fake grass", + "fake grass" + }, + { + "emc_fake_acid", + "fake acid", + "fake acid" + }, + { + "emc_dripper", + "dripper", + "dripper" + }, /* ----------------------------------------------------------------------- */ /* "real" (and therefore drawable) runtime elements */ @@ -3684,6 +3939,26 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, + { + "player_is_exploding_1", + "-", + "-" + }, + { + "player_is_exploding_2", + "-", + "-" + }, + { + "player_is_exploding_3", + "-", + "-" + }, + { + "player_is_exploding_4", + "-", + "-" + }, { "quicksand.filling", "quicksand", @@ -3830,8 +4105,23 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-" }, { - "dummy", - "dummy", + "internal_clipboard_custom", + "internal", + "empty custom element" + }, + { + "internal_clipboard_change", + "internal", + "empty change page" + }, + { + "internal_clipboard_group", + "internal", + "empty group element" + }, + { + "internal_dummy", + "internal", "-" }, @@ -3898,6 +4188,11 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { ".turning_from_right", ACTION_TURNING_FROM_RIGHT, FALSE }, { ".turning_from_up", ACTION_TURNING_FROM_UP, FALSE }, { ".turning_from_down", ACTION_TURNING_FROM_DOWN, FALSE }, + { ".smashed_by_rock", ACTION_SMASHED_BY_ROCK, FALSE }, + { ".smashed_by_spring", ACTION_SMASHED_BY_SPRING, FALSE }, + { ".slurped_by_spring", ACTION_SLURPED_BY_SPRING, FALSE }, + { ".twinkling", ACTION_TWINKLING, FALSE }, + { ".splashing", ACTION_SPLASHING, FALSE }, { ".other", ACTION_OTHER, FALSE }, /* empty suffix always matches -- check as last entry in InitSoundInfo() */ @@ -3940,8 +4235,8 @@ struct TokenIntPtrInfo image_config_vars[] = { { "global.num_toons", &global.num_toons }, - { "menu.draw_xoffset", &menu.draw_xoffset_default }, - { "menu.draw_yoffset", &menu.draw_yoffset_default }, + { "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT]}, + { "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT]}, { "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] }, { "menu.draw_yoffset.MAIN", &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] }, { "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] }, @@ -3957,7 +4252,7 @@ struct TokenIntPtrInfo image_config_vars[] = { "menu.scrollbar_xoffset", &menu.scrollbar_xoffset }, - { "menu.list_size", &menu.list_size_default }, + { "menu.list_size", &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] }, { "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] }, { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] }, { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] }, @@ -4054,7 +4349,7 @@ static void print_usage() " --serveronly only start network server\n" " -v, --verbose verbose mode\n" " --debug display debugging information\n" - " -e, --execute COMMAND execute batch COMMAND:\n" + " -e, --execute COMMAND execute batch COMMAND\n" "\n" "Valid commands for '--execute' option:\n" " \"print graphicsinfo.conf\" print default graphics config\n" @@ -4065,7 +4360,8 @@ static void print_usage() " \"print helptext.conf\" print default helptext 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" + " \"autoplay LEVELDIR [NR]\" play level tapes for LEVELDIR\n" + " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n" "\n", program.command_basename); }