X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.h;h=7f6e8c6c40cb91f72a3591954a4384dc1fc154a6;hb=ccd9456f41e68c8c6db6d6ea59d880b8f55dba0b;hp=d3c293354acd80b0cb1385d72345936adf0ed732;hpb=ec36fe263402351ac67b70400f11096a044365fe;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index d3c29335..7f6e8c6c 100644 --- a/src/main.h +++ b/src/main.h @@ -418,17 +418,53 @@ #define IS_ENVELOPE(e) ((e) >= EL_ENVELOPE_1 && \ (e) <= EL_ENVELOPE_4) -#define IS_GATE(e) ((e) >= EL_GATE_1 && \ +#define IS_RND_KEY(e) ((e) >= EL_KEY_1 && \ + (e) <= EL_KEY_4) +#define IS_EM_KEY(e) ((e) >= EL_EM_KEY_1 && \ + (e) <= EL_EM_KEY_4) +#define IS_EMC_KEY(e) ((e) >= EL_EMC_KEY_5 && \ + (e) <= EL_EMC_KEY_8) +#define IS_KEY(e) (IS_RND_KEY(e) || \ + IS_EM_KEY(e) || \ + IS_EMC_KEY(e)) +#define RND_KEY_NR(e) ((e) - EL_KEY_1) +#define EM_KEY_NR(e) ((e) - EL_EM_KEY_1) +#define EMC_KEY_NR(e) ((e) - EL_EMC_KEY_5 + 4) +#define KEY_NR(e) (IS_RND_KEY(e) ? RND_KEY_NR(e) : \ + IS_EM_KEY(e) ? EM_KEY_NR(e) : \ + IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0) + +#define IS_RND_GATE(e) ((e) >= EL_GATE_1 && \ (e) <= EL_GATE_4) - -#define IS_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \ - (e) <= EL_GATE_4_GRAY) - #define IS_EM_GATE(e) ((e) >= EL_EM_GATE_1 && \ (e) <= EL_EM_GATE_4) - +#define IS_EMC_GATE(e) ((e) >= EL_EMC_GATE_5 && \ + (e) <= EL_EMC_GATE_8) +#define IS_GATE(e) (IS_RND_GATE(e) || \ + IS_EM_GATE(e) || \ + IS_EMC_GATE(e)) +#define RND_GATE_NR(e) ((e) - EL_GATE_1) +#define EM_GATE_NR(e) ((e) - EL_EM_GATE_1) +#define EMC_GATE_NR(e) ((e) - EL_EMC_GATE_5 + 4) +#define GATE_NR(e) (IS_RND_GATE(e) ? RND_GATE_NR(e) : \ + IS_EM_GATE(e) ? EM_GATE_NR(e) : \ + IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0) + +#define IS_RND_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \ + (e) <= EL_GATE_4_GRAY) #define IS_EM_GATE_GRAY(e) ((e) >= EL_EM_GATE_1_GRAY && \ (e) <= EL_EM_GATE_4_GRAY) +#define IS_EMC_GATE_GRAY(e) ((e) >= EL_EMC_GATE_5_GRAY && \ + (e) <= EL_EMC_GATE_8_GRAY) +#define IS_GATE_GRAY(e) (IS_RND_GATE_GRAY(e) || \ + IS_EM_GATE_GRAY(e) || \ + IS_EMC_GATE_GRAY(e)) +#define RND_GATE_GRAY_NR(e) ((e) - EL_GATE_1_GRAY) +#define EM_GATE_GRAY_NR(e) ((e) - EL_EM_GATE_1_GRAY) +#define EMC_GATE_GRAY_NR(e) ((e) - EL_EMC_GATE_5_GRAY + 4) +#define GATE_GRAY_NR(e) (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) : \ + IS_EM_GATE_GRAY(e) ? EM_GATE_GRAY_NR(e) : \ + IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0) #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) @@ -517,11 +553,13 @@ #define MAX_LEVEL_NAME_LEN 32 #define MAX_LEVEL_AUTHOR_LEN 32 #define MAX_ELEMENT_NAME_LEN 32 -#define MAX_TAPELEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */ +#define MAX_TAPE_LEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */ +#define MAX_TAPES_PER_SET 1024 #define MAX_SCORE_ENTRIES 100 #define MAX_NUM_AMOEBA 100 #define MAX_INVENTORY_SIZE 1000 -#define MAX_KEYS 4 +#define STD_NUM_KEYS 4 +#define MAX_NUM_KEYS 8 #define NUM_BELTS 4 #define NUM_BELT_PARTS 3 #define MIN_ENVELOPE_XSIZE 1 @@ -576,11 +614,12 @@ #define EYSIZE (VYSIZE + 44) #define FULL_SXSIZE (2 + SXSIZE + 2) #define FULL_SYSIZE (2 + SYSIZE + 2) -#define MICROLEV_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX) -#define MICROLEV_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY) -#define MICROLEV_XPOS (SX + (SXSIZE - MICROLEV_XSIZE) / 2) -#define MICROLEV_YPOS (SX + 12 * TILEY - MICRO_TILEY) -#define MICROLABEL_YPOS (MICROLEV_YPOS + MICROLEV_YSIZE + 7) +#define MICROLEVEL_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX) +#define MICROLEVEL_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY) +#define MICROLEVEL_XPOS (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2) +#define MICROLEVEL_YPOS (SX + 12 * TILEY - MICRO_TILEY) +#define MICROLABEL1_YPOS (MICROLEVEL_YPOS - 36) +#define MICROLABEL2_YPOS (MICROLEVEL_YPOS + MICROLEVEL_YSIZE + 7) /* score for elements */ @@ -966,18 +1005,18 @@ /* the following EMC style elements are currently not implemented in R'n'D */ #define EL_BALLOON_SWITCH_NONE 667 -#define EL_EM_GATE_5 668 -#define EL_EM_GATE_6 669 -#define EL_EM_GATE_7 670 -#define EL_EM_GATE_8 671 -#define EL_EM_GATE_5_GRAY 672 -#define EL_EM_GATE_6_GRAY 673 -#define EL_EM_GATE_7_GRAY 674 -#define EL_EM_GATE_8_GRAY 675 -#define EL_EM_KEY_5 676 -#define EL_EM_KEY_6 677 -#define EL_EM_KEY_7 678 -#define EL_EM_KEY_8 679 +#define EL_EMC_GATE_5 668 +#define EL_EMC_GATE_6 669 +#define EL_EMC_GATE_7 670 +#define EL_EMC_GATE_8 671 +#define EL_EMC_GATE_5_GRAY 672 +#define EL_EMC_GATE_6_GRAY 673 +#define EL_EMC_GATE_7_GRAY 674 +#define EL_EMC_GATE_8_GRAY 675 +#define EL_EMC_KEY_5 676 +#define EL_EMC_KEY_6 677 +#define EL_EMC_KEY_7 678 +#define EL_EMC_KEY_8 679 #define EL_EMC_ANDROID 680 #define EL_EMC_GRASS 681 #define EL_EMC_MAGIC_BALL 682 @@ -1001,9 +1040,10 @@ #define EL_EMC_WALL_SLIPPERY_3 700 #define EL_EMC_WALL_SLIPPERY_4 701 #define EL_EMC_FAKE_GRASS 702 -#define EL_EMC_DRIPPER 703 +#define EL_EMC_FAKE_ACID 703 +#define EL_EMC_DRIPPER 704 -#define NUM_FILE_ELEMENTS 704 +#define NUM_FILE_ELEMENTS 705 /* "real" (and therefore drawable) runtime elements */ @@ -1174,9 +1214,10 @@ #define ACTION_SMASHED_BY_SPRING 48 #define ACTION_SLURPED_BY_SPRING 49 #define ACTION_TWINKLING 50 -#define ACTION_OTHER 51 +#define ACTION_SPLASHING 51 +#define ACTION_OTHER 52 -#define NUM_ACTIONS 52 +#define NUM_ACTIONS 53 #define ACTION_BORING_LAST ACTION_BORING_10 #define ACTION_SLEEPING_LAST ACTION_SLEEPING_3 @@ -1324,7 +1365,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 1 +#define PROGRAM_VERSION_BUILD 3 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" @@ -1401,14 +1442,11 @@ struct MenuInfo { - int draw_xoffset_default; - int draw_yoffset_default; int draw_xoffset[NUM_SPECIAL_GFX_ARGS]; int draw_yoffset[NUM_SPECIAL_GFX_ARGS]; int scrollbar_xoffset; - int list_size_default; int list_size[NUM_SPECIAL_GFX_ARGS]; int sound[NUM_SPECIAL_GFX_ARGS]; @@ -1455,7 +1493,7 @@ struct PlayerInfo boolean use_murphy_graphic; boolean block_last_field; - int block_delay; + int block_delay_adjustment; /* needed for different engine versions */ boolean can_fall_into_acid; @@ -1522,7 +1560,7 @@ struct PlayerInfo int sokobanfields_still_needed; int lights_still_needed; int friends_still_needed; - int key[4]; + int key[MAX_NUM_KEYS]; int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl; int shield_normal_time_left; int shield_deadly_time_left; @@ -1614,8 +1652,11 @@ struct LevelInfo boolean block_last_field; /* player blocks previous field while moving */ boolean sp_block_last_field; /* player blocks previous field while moving */ + +#if 0 /* !!! THIS IS NOT A LEVEL SETTING => LOGIC MOVED TO "game.c" !!! */ int block_delay; /* delay for blocking previous field */ int sp_block_delay; /* delay for blocking previous field */ +#endif /* ('int' instead of 'boolean' because used as selectbox value in editor) */ int use_step_counter; /* count steps instead of seconds for level */ @@ -1660,7 +1701,7 @@ struct TapeInfo { byte action[MAX_PLAYERS]; byte delay; - } pos[MAX_TAPELEN]; + } pos[MAX_TAPE_LEN]; boolean no_valid_file; /* set when tape file missing or invalid */ }; @@ -1680,7 +1721,8 @@ struct GameInfo /* flags to handle bugs in and changes between different engine versions */ /* (for the latest engine version, these flags should always be "FALSE") */ - boolean use_bug_change_when_pushing; + boolean use_change_when_pushing_bug; + boolean use_block_last_field_bug; /* variable within running game */ int yamyam_content_nr; @@ -1706,7 +1748,8 @@ struct GameInfo struct GlobalInfo { char *autoplay_leveldir; - int autoplay_level_nr; + int autoplay_level[MAX_TAPES_PER_SET]; + boolean autoplay_all; char *convert_leveldir; int convert_level_nr;