X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmain.c;h=1a4243f98dae958e5ddf865d0e50399c01a7a229;hp=670f5335bf3d06b44fa8bf50fe6fa05c1457bfd7;hb=67f3bfab902e53e0dc24a01eb6c0e4d274030a47;hpb=310781167f731177d6d46b15093dc32606eeac4e diff --git a/src/main.c b/src/main.c index 670f5335..1a4243f9 100644 --- a/src/main.c +++ b/src/main.c @@ -4,7 +4,7 @@ // (c) 1995-2014 by Artsoft Entertainment // Holger Schemel // info@artsoft.org -// http://www.artsoft.org/ +// https://www.artsoft.org/ // ---------------------------------------------------------------------------- // main.c // ============================================================================ @@ -34,14 +34,10 @@ boolean game_status_last_screen = -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; -short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Tile[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; @@ -125,20 +121,15 @@ int BX1, BY1; int BX2, BY2; int SBX_Left, SBX_Right; int SBY_Upper, SBY_Lower; -int ZX, ZY; -int ExitX, ExitY; -int AllPlayersGone; int TimeFrames, TimePlayed, TimeLeft, TapeTime; 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]; struct TapeInfo tape; -struct SetupInfo setup; struct GameInfo game; struct GlobalInfo global; struct BorderInfo border; @@ -186,20 +177,20 @@ SetupFileHash *font_token_hash = NULL; SetupFileHash *hide_setup_hash = NULL; -/* ------------------------------------------------------------------------- */ -/* element definitions */ -/* ------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------- +// element definitions +// ---------------------------------------------------------------------------- struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1]; -/* this contains predefined structure elements to initialize "element_info" */ +// 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! */ + // keyword to start parser: "ELEMENT_INFO_START" <-- do not change! - /* ----------------------------------------------------------------------- */ - /* "real" level file elements */ - /* ----------------------------------------------------------------------- */ + // -------------------------------------------------------------------------- + // "real" level file elements + // -------------------------------------------------------------------------- { "empty_space", @@ -554,7 +545,8 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_butterfly.right", "bd_butterfly", - "butterfly (starts moving right)"}, + "butterfly (starts moving right)" + }, { "bd_butterfly.up", "bd_butterfly", @@ -563,11 +555,13 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "bd_butterfly.left", "bd_butterfly", - "butterfly (starts moving left)"}, + "butterfly (starts moving left)" + }, { "bd_butterfly.down", "bd_butterfly", - "butterfly (starts moving down)"}, + "butterfly (starts moving down)" + }, { "bd_firefly.right", "bd_firefly", @@ -641,7 +635,8 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "spaceship.right", "spaceship", - "spaceship (starts moving right)"}, + "spaceship (starts moving right)" + }, { "spaceship.up", "spaceship", @@ -650,11 +645,13 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "spaceship.left", "spaceship", - "spaceship (starts moving left)"}, + "spaceship (starts moving left)" + }, { "spaceship.down", "spaceship", - "spaceship (starts moving down)"}, + "spaceship (starts moving down)" + }, { "pacman.right", "pacman", @@ -1181,17 +1178,17 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "letter ''" }, { - "char_unused", + "char_button", "char", "letter 'button'" }, { - "char_unused", + "char_up", "char", "letter 'up'" }, { - "char_unused", + "char_down", "char", "letter 'down'" }, @@ -1858,62 +1855,62 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "emc_steelwall_1", "steelwall", - "steel wall" + "steel wall 1 (EMC style)" }, { "emc_steelwall_2", "steelwall", - "steel wall" + "steel wall 2 (EMC style)" }, { "emc_steelwall_3", "steelwall", - "steel wall" + "steel wall 3 (EMC style)" }, { "emc_steelwall_4", "steelwall", - "steel wall" + "steel wall 4 (EMC style)" }, { "emc_wall_1", "wall", - "normal wall" + "normal wall 1 (EMC style)" }, { "emc_wall_2", "wall", - "normal wall" + "normal wall 2 (EMC style)" }, { "emc_wall_3", "wall", - "normal wall" + "normal wall 3 (EMC style)" }, { "emc_wall_4", "wall", - "normal wall" + "normal wall 4 (EMC style)" }, { "emc_wall_5", "wall", - "normal wall" + "normal wall 5 (EMC style)" }, { "emc_wall_6", "wall", - "normal wall" + "normal wall 6 (EMC style)" }, { "emc_wall_7", "wall", - "normal wall" + "normal wall 7 (EMC style)" }, { "emc_wall_8", "wall", - "normal wall" + "normal wall 8 (EMC style)" }, { "tube_any", @@ -3648,62 +3645,62 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "emc_wall_9", "wall", - "normal wall" + "normal wall 9 (EMC style)" }, { "emc_wall_10", "wall", - "normal wall" + "normal wall 10 (EMC style)" }, { "emc_wall_11", "wall", - "normal wall" + "normal wall 11 (EMC style)" }, { "emc_wall_12", "wall", - "normal wall" + "normal wall 12 (EMC style)" }, { "emc_wall_13", "wall", - "normal wall" + "normal wall 13 (EMC style)" }, { "emc_wall_14", "wall", - "normal wall" + "normal wall 14 (EMC style)" }, { "emc_wall_15", "wall", - "normal wall" + "normal wall 15 (EMC style)" }, { "emc_wall_16", "wall", - "normal wall" + "normal wall 16 (EMC style)" }, { "emc_wall_slippery_1", "wall", - "slippery wall" + "slippery wall 1 (EMC style)" }, { "emc_wall_slippery_2", "wall", - "slippery wall" + "slippery wall 2 (EMC style)" }, { "emc_wall_slippery_3", "wall", - "slippery wall" + "slippery wall 3 (EMC style)" }, { "emc_wall_slippery_4", "wall", - "slippery wall" + "slippery wall 4 (EMC style)" }, { "emc_fake_grass", @@ -4241,17 +4238,17 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "steel letter ''" }, { - "steel_char_unused", + "steel_char_button", "steel_char", "steel letter 'button'" }, { - "steel_char_unused", + "steel_char_up", "steel_char", "steel letter 'up'" }, { - "steel_char_unused", + "steel_char_down", "steel_char", "steel letter 'down'" }, @@ -4318,112 +4315,112 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "dc_steelwall_1_left", "steelwall", - "steel wall (left)" + "steel wall 1 (left)" }, { "dc_steelwall_1_right", "steelwall", - "steel wall (right)" + "steel wall 1 (right)" }, { "dc_steelwall_1_top", "steelwall", - "steel wall (top)" + "steel wall 1 (top)" }, { "dc_steelwall_1_bottom", "steelwall", - "steel wall (bottom)" + "steel wall 1 (bottom)" }, { "dc_steelwall_1_horizontal", "steelwall", - "steel wall (top/bottom)" + "steel wall 1 (top/bottom)" }, { "dc_steelwall_1_vertical", "steelwall", - "steel wall (left/right)" + "steel wall 1 (left/right)" }, { "dc_steelwall_1_topleft", "steelwall", - "steel wall (top/left)" + "steel wall 1 (top/left)" }, { "dc_steelwall_1_topright", "steelwall", - "steel wall (top/right)" + "steel wall 1 (top/right)" }, { "dc_steelwall_1_bottomleft", "steelwall", - "steel wall (bottom/left)" + "steel wall 1 (bottom/left)" }, { "dc_steelwall_1_bottomright", "steelwall", - "steel wall (bottom/right)" + "steel wall 1 (bottom/right)" }, { "dc_steelwall_1_topleft_2", "steelwall", - "steel wall (top/left corner)" + "steel wall 1 (top/left corner)" }, { "dc_steelwall_1_topright_2", "steelwall", - "steel wall (top/right corner)" + "steel wall 1 (top/right corner)" }, { "dc_steelwall_1_bottomleft_2", "steelwall", - "steel wall (bottom/left corner)" + "steel wall 1 (bottom/left corner)" }, { "dc_steelwall_1_bottomright_2", "steelwall", - "steel wall (bottom/right corner)" + "steel wall 1 (bottom/right corner)" }, { "dc_steelwall_2_left", "steelwall", - "steel wall (left)" + "steel wall 2 (left)" }, { "dc_steelwall_2_right", "steelwall", - "steel wall (right)" + "steel wall 2 (right)" }, { "dc_steelwall_2_top", "steelwall", - "steel wall (top)" + "steel wall 2 (top)" }, { "dc_steelwall_2_bottom", "steelwall", - "steel wall (bottom)" + "steel wall 2 (bottom)" }, { "dc_steelwall_2_horizontal", "steelwall", - "steel wall (horizontal)" + "steel wall 2 (horizontal)" }, { "dc_steelwall_2_vertical", "steelwall", - "steel wall (vertical)" + "steel wall 2 (vertical)" }, { "dc_steelwall_2_middle", "steelwall", - "steel wall (middle)" + "steel wall 2 (middle)" }, { "dc_steelwall_2_single", "steelwall", - "steel wall (single)" + "steel wall 2 (single)" }, { "dc_switchgate_switch_up", @@ -4678,322 +4675,322 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "mm_steel_wall_1", "mm_steel_wall", - "steel wall" + "steel wall 1 (MM style)" }, { "mm_steel_wall_2", "mm_steel_wall", - "steel wall" + "steel wall 2 (MM style)" }, { "mm_steel_wall_3", "mm_steel_wall", - "steel wall" + "steel wall 3 (MM style)" }, { "mm_steel_wall_4", "mm_steel_wall", - "steel wall" + "steel wall 4 (MM style)" }, { "mm_steel_wall_5", "mm_steel_wall", - "steel wall" + "steel wall 5 (MM style)" }, { "mm_steel_wall_6", "mm_steel_wall", - "steel wall" + "steel wall 6 (MM style)" }, { "mm_steel_wall_7", "mm_steel_wall", - "steel wall" + "steel wall 7 (MM style)" }, { "mm_steel_wall_8", "mm_steel_wall", - "steel wall" + "steel wall 8 (MM style)" }, { "mm_steel_wall_9", "mm_steel_wall", - "steel wall" + "steel wall 9 (MM style)" }, { "mm_steel_wall_10", "mm_steel_wall", - "steel wall" + "steel wall 10 (MM style)" }, { "mm_steel_wall_11", "mm_steel_wall", - "steel wall" + "steel wall 11 (MM style)" }, { "mm_steel_wall_12", "mm_steel_wall", - "steel wall" + "steel wall 12 (MM style)" }, { "mm_steel_wall_13", "mm_steel_wall", - "steel wall" + "steel wall 13 (MM style)" }, { "mm_steel_wall_14", "mm_steel_wall", - "steel wall" + "steel wall 14 (MM style)" }, { "mm_steel_wall_15", "mm_steel_wall", - "steel wall" + "steel wall 15 (MM style)" }, { "mm_steel_wall_16", "mm_steel_wall", - "steel wall" + "steel wall 16 (MM style)" }, { "mm_wooden_wall_1", "mm_wooden_wall", - "wooden wall" + "wooden wall 1 (MM style)" }, { "mm_wooden_wall_2", "mm_wooden_wall", - "wooden wall" + "wooden wall 2 (MM style)" }, { "mm_wooden_wall_3", "mm_wooden_wall", - "wooden wall" + "wooden wall 3 (MM style)" }, { "mm_wooden_wall_4", "mm_wooden_wall", - "wooden wall" + "wooden wall 4 (MM style)" }, { "mm_wooden_wall_5", "mm_wooden_wall", - "wooden wall" + "wooden wall 5 (MM style)" }, { "mm_wooden_wall_6", "mm_wooden_wall", - "wooden wall" + "wooden wall 6 (MM style)" }, { "mm_wooden_wall_7", "mm_wooden_wall", - "wooden wall" + "wooden wall 7 (MM style)" }, { "mm_wooden_wall_8", "mm_wooden_wall", - "wooden wall" + "wooden wall 8 (MM style)" }, { "mm_wooden_wall_9", "mm_wooden_wall", - "wooden wall" + "wooden wall 9 (MM style)" }, { "mm_wooden_wall_10", "mm_wooden_wall", - "wooden wall" + "wooden wall 10 (MM style)" }, { "mm_wooden_wall_11", "mm_wooden_wall", - "wooden wall" + "wooden wall 11 (MM style)" }, { "mm_wooden_wall_12", "mm_wooden_wall", - "wooden wall" + "wooden wall 12 (MM style)" }, { "mm_wooden_wall_13", "mm_wooden_wall", - "wooden wall" + "wooden wall 13 (MM style)" }, { "mm_wooden_wall_14", "mm_wooden_wall", - "wooden wall" + "wooden wall 14 (MM style)" }, { "mm_wooden_wall_15", "mm_wooden_wall", - "wooden wall" + "wooden wall 15 (MM style)" }, { "mm_wooden_wall_16", "mm_wooden_wall", - "wooden wall" + "wooden wall 16 (MM style)" }, { "mm_ice_wall_1", "mm_ice_wall", - "ice wall" + "ice wall 1" }, { "mm_ice_wall_2", "mm_ice_wall", - "ice wall" + "ice wall 2" }, { "mm_ice_wall_3", "mm_ice_wall", - "ice wall" + "ice wall 3" }, { "mm_ice_wall_4", "mm_ice_wall", - "ice wall" + "ice wall 4" }, { "mm_ice_wall_5", "mm_ice_wall", - "ice wall" + "ice wall 5" }, { "mm_ice_wall_6", "mm_ice_wall", - "ice wall" + "ice wall 6" }, { "mm_ice_wall_7", "mm_ice_wall", - "ice wall" + "ice wall 7" }, { "mm_ice_wall_8", "mm_ice_wall", - "ice wall" + "ice wall 8" }, { "mm_ice_wall_9", "mm_ice_wall", - "ice wall" + "ice wall 9" }, { "mm_ice_wall_10", "mm_ice_wall", - "ice wall" + "ice wall 10" }, { "mm_ice_wall_11", "mm_ice_wall", - "ice wall" + "ice wall 11" }, { "mm_ice_wall_12", "mm_ice_wall", - "ice wall" + "ice wall 12" }, { "mm_ice_wall_13", "mm_ice_wall", - "ice wall" + "ice wall 13" }, { "mm_ice_wall_14", "mm_ice_wall", - "ice wall" + "ice wall 14" }, { "mm_ice_wall_15", "mm_ice_wall", - "ice wall" + "ice wall 15" }, { "mm_ice_wall_16", "mm_ice_wall", - "ice wall" + "ice wall 16" }, { "mm_amoeba_wall_1", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 1" }, { "mm_amoeba_wall_2", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 2" }, { "mm_amoeba_wall_3", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 3" }, { "mm_amoeba_wall_4", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 4" }, { "mm_amoeba_wall_5", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 5" }, { "mm_amoeba_wall_6", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 6" }, { "mm_amoeba_wall_7", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 7" }, { "mm_amoeba_wall_8", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 8" }, { "mm_amoeba_wall_9", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 9" }, { "mm_amoeba_wall_10", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 10" }, { "mm_amoeba_wall_11", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 11" }, { "mm_amoeba_wall_12", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 12" }, { "mm_amoeba_wall_13", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 13" }, { "mm_amoeba_wall_14", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 14" }, { "mm_amoeba_wall_15", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 15" }, { "mm_amoeba_wall_16", "mm_amoeba_wall", - "amoeba wall" + "amoeba wall 16" }, { "mm_wooden_block", @@ -5478,162 +5475,162 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "df_wooden_wall_1", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 1 (DF style)" }, { "df_wooden_wall_2", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 2 (DF style)" }, { "df_wooden_wall_3", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 3 (DF style)" }, { "df_wooden_wall_4", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 4 (DF style)" }, { "df_wooden_wall_5", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 5 (DF style)" }, { "df_wooden_wall_6", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 6 (DF style)" }, { "df_wooden_wall_7", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 7 (DF style)" }, { "df_wooden_wall_8", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 8 (DF style)" }, { "df_wooden_wall_9", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 9 (DF style)" }, { "df_wooden_wall_10", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 10 (DF style)" }, { "df_wooden_wall_11", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 11 (DF style)" }, { "df_wooden_wall_12", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 12 (DF style)" }, { "df_wooden_wall_13", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 13 (DF style)" }, { "df_wooden_wall_14", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 14 (DF style)" }, { "df_wooden_wall_15", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 15 (DF style)" }, { "df_wooden_wall_16", "df_wooden_wall", - "wooden wall (DF style)" + "wooden wall 16 (DF style)" }, { "df_steel_wall_1", "df_steel_wall", - "steel wall (DF style)" + "steel wall 1 (DF style)" }, { "df_steel_wall_2", "df_steel_wall", - "steel wall (DF style)" + "steel wall 2 (DF style)" }, { "df_steel_wall_3", "df_steel_wall", - "steel wall (DF style)" + "steel wall 3 (DF style)" }, { "df_steel_wall_4", "df_steel_wall", - "steel wall (DF style)" + "steel wall 4 (DF style)" }, { "df_steel_wall_5", "df_steel_wall", - "steel wall (DF style)" + "steel wall 5 (DF style)" }, { "df_steel_wall_6", "df_steel_wall", - "steel wall (DF style)" + "steel wall 6 (DF style)" }, { "df_steel_wall_7", "df_steel_wall", - "steel wall (DF style)" + "steel wall 7 (DF style)" }, { "df_steel_wall_8", "df_steel_wall", - "steel wall (DF style)" + "steel wall 8 (DF style)" }, { "df_steel_wall_9", "df_steel_wall", - "steel wall (DF style)" + "steel wall 9 (DF style)" }, { "df_steel_wall_10", "df_steel_wall", - "steel wall (DF style)" + "steel wall 10 (DF style)" }, { "df_steel_wall_11", "df_steel_wall", - "steel wall (DF style)" + "steel wall 11 (DF style)" }, { "df_steel_wall_12", "df_steel_wall", - "steel wall (DF style)" + "steel wall 12 (DF style)" }, { "df_steel_wall_13", "df_steel_wall", - "steel wall (DF style)" + "steel wall 13 (DF style)" }, { "df_steel_wall_14", "df_steel_wall", - "steel wall (DF style)" + "steel wall 14 (DF style)" }, { "df_steel_wall_15", "df_steel_wall", - "steel wall (DF style)" + "steel wall 15 (DF style)" }, { "df_steel_wall_16", "df_steel_wall", - "steel wall (DF style)" + "steel wall 16 (DF style)" }, { "df_empty_space", @@ -6233,12 +6230,12 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "mm_steel_wall", "mm_steel_wall", - "steel wall", + "steel wall (MM style)", }, { "mm_wooden_wall", "mm_wooden_wall", - "wooden wall", + "wooden wall (MM style)", }, { "mm_ice_wall", @@ -6270,10 +6267,20 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "df_wooden_wall", "wooden wall (DF style)", }, + { + "spring.left", + "spring", + "spring (starts moving left)" + }, + { + "spring.right", + "spring", + "spring (starts moving right)" + }, - /* ----------------------------------------------------------------------- */ - /* "real" (and therefore drawable) runtime elements */ - /* ----------------------------------------------------------------------- */ + // -------------------------------------------------------------------------- + // "real" (and therefore drawable) runtime elements + // -------------------------------------------------------------------------- { "dynabomb_player_1.active", @@ -6682,9 +6689,9 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "pac man (eating down)" }, - /* ----------------------------------------------------------------------- */ - /* "unreal" (and therefore not drawable) runtime elements */ - /* ----------------------------------------------------------------------- */ + // -------------------------------------------------------------------------- + // "unreal" (and therefore not drawable) runtime elements + // -------------------------------------------------------------------------- { "blocked", @@ -6807,9 +6814,9 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "-" }, - /* ----------------------------------------------------------------------- */ - /* dummy elements (never used as game elements, only used as graphics) */ - /* ----------------------------------------------------------------------- */ + // -------------------------------------------------------------------------- + // dummy elements (never used as game elements, only used as graphics) + // -------------------------------------------------------------------------- { "steelwall_topleft", @@ -7237,7 +7244,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "hide elements used in this level" }, - /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */ + // keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! { NULL, @@ -7247,9 +7254,9 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }; -/* ------------------------------------------------------------------------- */ -/* element action and direction definitions */ -/* ------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------- +// element action and direction definitions +// ---------------------------------------------------------------------------- struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { @@ -7372,7 +7379,7 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { ".part_32", ACTION_PART_32, FALSE }, { ".other", ACTION_OTHER, FALSE }, - /* empty suffix always matches -- check as last entry in InitSoundInfo() */ + // empty suffix always matches -- check as last entry in InitSoundInfo() { "", ACTION_DEFAULT, TRUE }, { NULL, 0, 0 } @@ -7428,25 +7435,26 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".TOONS", GFX_SPECIAL_ARG_TOONS, }, { ".SCORESOLD", GFX_SPECIAL_ARG_SCORESOLD, }, { ".SCORESNEW", GFX_SPECIAL_ARG_SCORESNEW, }, + { ".NO_TITLE", GFX_SPECIAL_ARG_NO_TITLE, }, { ".FADING", GFX_SPECIAL_ARG_FADING, }, { ".QUIT", GFX_SPECIAL_ARG_QUIT, }, - /* empty suffix always matches -- check as last entry in InitMusicInfo() */ + // empty suffix always matches -- check as last entry in InitMusicInfo() { "", GFX_SPECIAL_ARG_DEFAULT, }, { NULL, 0, } }; -#include "conf_var.c" /* include auto-generated data structure definitions */ +#include "conf_var.c" // include auto-generated data structure definitions -/* ------------------------------------------------------------------------- */ -/* font definitions */ -/* ------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------- +// font definitions +// ---------------------------------------------------------------------------- -/* Important: When one entry is a prefix of another entry, the longer entry - must come first, because the dynamic configuration does prefix matching! - (These definitions must match the corresponding definitions in "main.h"!) */ +// Important: When one entry is a prefix of another entry, the longer entry +// must come first, because the dynamic configuration does prefix matching! +// (These definitions must match the corresponding definitions in "main.h"!) struct FontInfo font_info[NUM_FONTS + 1] = { @@ -7483,6 +7491,7 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.option_on" }, { "font.value_1" }, { "font.value_2" }, + { "font.value_old_narrow" }, { "font.value_old" }, { "font.value_narrow" }, { "font.level_number.active" }, @@ -7491,16 +7500,17 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.game_info" }, { "font.info.elements" }, { "font.info.levelset" }, + { "font.main.network_players" }, { NULL } }; struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIM_TOKENS + 1]; -/* this contains predefined structure elements to init "global_anim_info" */ +// this contains predefined structure elements to init "global_anim_info" struct GlobalAnimNameInfo global_anim_name_info[NUM_GLOBAL_ANIM_TOKENS + 1] = { - /* (real) graphic definitions used to define animation graphics */ + // (real) graphic definitions used to define animation graphics { "gfx.global.anim_1", }, { "gfx.global.anim_2", }, { "gfx.global.anim_3", }, @@ -7534,7 +7544,7 @@ struct GlobalAnimNameInfo global_anim_name_info[NUM_GLOBAL_ANIM_TOKENS + 1] = { "gfx.global.anim_31", }, { "gfx.global.anim_32", }, - /* (dummy) graphic definitions used to define animation controls */ + // (dummy) graphic definitions used to define animation controls { "global.anim_1", }, { "global.anim_2", }, { "global.anim_3", }, @@ -7571,10 +7581,15 @@ struct GlobalAnimNameInfo global_anim_name_info[NUM_GLOBAL_ANIM_TOKENS + 1] = { NULL } }; +struct GlobalAnimEventInfo global_anim_event_info = +{ + NULL, 0 +}; -/* ------------------------------------------------------------------------- */ -/* music token prefix definitions */ -/* ------------------------------------------------------------------------- */ + +// ---------------------------------------------------------------------------- +// music token prefix definitions +// ---------------------------------------------------------------------------- struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] = { @@ -7584,11 +7599,11 @@ struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] = }; -/* ========================================================================= */ -/* main() */ -/* ========================================================================= */ +// ============================================================================ +// main() +// ============================================================================ -static void print_usage() +static void print_usage(void) { Print("\n" "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n" @@ -7604,7 +7619,7 @@ static void print_usage() " --serveronly only start network server\n" " -v, --verbose verbose mode\n" " -V, --version show program version\n" - " --debug display debugging information\n" + " --debug[=MODE] show (and limit) debug output\n" " -e, --execute COMMAND execute batch COMMAND\n" "\n" "Valid commands for '--execute' option:\n" @@ -7616,10 +7631,12 @@ 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" - " \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n" " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n" " \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n" " \"autowarp LEVELDIR [NR ...]\" warp level tapes for LEVELDIR\n" + " \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n" + " \"autofix LEVELDIR [NR ...]\" test and fix tapes for LEVELDIR\n" + " \"patch tapes MODE LEVELDIR [NR]\" patch level tapes for LEVELDIR\n" " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n" " \"create images DIRECTORY\" write BMP images to DIRECTORY\n" " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n" @@ -7627,7 +7644,7 @@ static void print_usage() program.command_basename); } -static void print_version() +static void print_version(void) { Print("%s", getProgramInitString()); @@ -7635,10 +7652,10 @@ static void print_version() { Print(" (%s %d.%d.%d.%d%s)", PROGRAM_TITLE_STRING, + PROGRAM_VERSION_SUPER, PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH, - PROGRAM_VERSION_BUILD, PROGRAM_VERSION_EXTRA); } @@ -7682,7 +7699,9 @@ static void InitProgramConfig(char *command_filename) char *config_filename = getProgramConfigFilename(command_filename); char *userdata_basename = getBaseNameNoSuffix(command_filename); char *userdata_subdir; +#if defined(PLATFORM_UNIX) char *userdata_subdir_unix; +#endif // read default program config, if existing if (fileExists(config_filename)) @@ -7700,8 +7719,10 @@ static void InitProgramConfig(char *command_filename) LoadSetupFromFilename(config_filename); } +#if defined(PLATFORM_UNIX) // set user data directory for Linux/Unix (but not Mac OS X) userdata_subdir_unix = getStringCat2(".", userdata_basename); +#endif // set program title from potentially redefined program title if (setup.internal.program_title != NULL && @@ -7760,5 +7781,5 @@ int main(int argc, char *argv[]) EventLoop(); CloseAllAndExit(0); - return 0; /* to keep compilers happy */ + return 0; // to keep compilers happy }