X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=1ec25ad6fd2295d8e2010f2568ef198f575eaa6a;hb=2c89261a1186ffc19bd6e5f82e9369bee1545e2f;hp=541139ceeaf0a0337398b4f6da72872dc7d338bf;hpb=496ac49402b1cfe5e8a664ef351fc3188a20935c;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index 541139ce..1ec25ad6 100644 --- a/src/main.h +++ b/src/main.h @@ -23,6 +23,7 @@ #include #include "libgame/libgame.h" +#include "game_em/game_em.h" #include "conf_gfx.h" /* include auto-generated data structure definitions */ #include "conf_snd.h" /* include auto-generated data structure definitions */ @@ -91,6 +92,7 @@ #define EP_CAN_MOVE_INTO_ACID 27 #define EP_THROWABLE 28 #define EP_CAN_EXPLODE 29 +#define EP_GRAVITY_REACHABLE 30 /* values for pre-defined properties */ #define EP_PLAYER 32 @@ -99,63 +101,61 @@ #define EP_BD_ELEMENT 35 #define EP_SP_ELEMENT 36 #define EP_SB_ELEMENT 37 -#define EP_SP_BUGGY_BASE 38 -#define EP_GEM 39 -#define EP_FOOD_DARK_YAMYAM 40 -#define EP_FOOD_PENGUIN 41 -#define EP_FOOD_PIG 42 -#define EP_HISTORIC_WALL 43 -#define EP_HISTORIC_SOLID 44 -#define EP_CLASSIC_ENEMY 45 -#define EP_BELT 46 -#define EP_BELT_ACTIVE 47 -#define EP_BELT_SWITCH 48 -#define EP_TUBE 49 -#define EP_KEYGATE 50 -#define EP_AMOEBOID 51 -#define EP_AMOEBALIVE 52 -#define EP_HAS_CONTENT 53 -#define EP_CAN_TURN_EACH_MOVE 54 -#define EP_CAN_GROW 55 -#define EP_ACTIVE_BOMB 56 -#define EP_INACTIVE 57 +#define EP_GEM 38 +#define EP_FOOD_DARK_YAMYAM 39 +#define EP_FOOD_PENGUIN 40 +#define EP_FOOD_PIG 41 +#define EP_HISTORIC_WALL 42 +#define EP_HISTORIC_SOLID 43 +#define EP_CLASSIC_ENEMY 44 +#define EP_BELT 45 +#define EP_BELT_ACTIVE 46 +#define EP_BELT_SWITCH 47 +#define EP_TUBE 48 +#define EP_KEYGATE 49 +#define EP_AMOEBOID 50 +#define EP_AMOEBALIVE 51 +#define EP_HAS_CONTENT 52 +#define EP_CAN_TURN_EACH_MOVE 53 +#define EP_CAN_GROW 54 +#define EP_ACTIVE_BOMB 55 +#define EP_INACTIVE 56 /* values for special configurable properties (depending on level settings) */ -#define EP_EM_SLIPPERY_WALL 58 +#define EP_EM_SLIPPERY_WALL 57 /* values for special graphics properties (no effect on game engine) */ -#define EP_GFX_CRUMBLED 59 +#define EP_GFX_CRUMBLED 58 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 60 -#define EP_ACCESSIBLE_INSIDE 61 -#define EP_ACCESSIBLE_UNDER 62 -#define EP_WALKABLE 63 -#define EP_PASSABLE 64 -#define EP_ACCESSIBLE 65 -#define EP_COLLECTIBLE 66 -#define EP_SNAPPABLE 67 -#define EP_WALL 68 -#define EP_SOLID_FOR_PUSHING 69 -#define EP_DRAGONFIRE_PROOF 70 -#define EP_EXPLOSION_PROOF 71 -#define EP_CAN_SMASH 72 -#define EP_EXPLODES_3X3_OLD 73 -#define EP_CAN_EXPLODE_BY_FIRE 74 -#define EP_CAN_EXPLODE_SMASHED 75 -#define EP_CAN_EXPLODE_IMPACT 76 -#define EP_SP_PORT 77 -#define EP_CAN_EXPLODE_BY_DRAGONFIRE 78 -#define EP_CAN_EXPLODE_BY_EXPLOSION 79 -#define EP_COULD_MOVE_INTO_ACID 80 -#define EP_MAYBE_DONT_COLLIDE_WITH 81 -#define EP_DIGGABLE_WITH_GRAVITY 82 +#define EP_ACCESSIBLE_OVER 59 +#define EP_ACCESSIBLE_INSIDE 60 +#define EP_ACCESSIBLE_UNDER 61 +#define EP_WALKABLE 62 +#define EP_PASSABLE 63 +#define EP_ACCESSIBLE 64 +#define EP_COLLECTIBLE 65 +#define EP_SNAPPABLE 66 +#define EP_WALL 67 +#define EP_SOLID_FOR_PUSHING 68 +#define EP_DRAGONFIRE_PROOF 69 +#define EP_EXPLOSION_PROOF 70 +#define EP_CAN_SMASH 71 +#define EP_EXPLODES_3X3_OLD 72 +#define EP_CAN_EXPLODE_BY_FIRE 73 +#define EP_CAN_EXPLODE_SMASHED 74 +#define EP_CAN_EXPLODE_IMPACT 75 +#define EP_SP_PORT 76 +#define EP_CAN_EXPLODE_BY_DRAGONFIRE 77 +#define EP_CAN_EXPLODE_BY_EXPLOSION 78 +#define EP_COULD_MOVE_INTO_ACID 79 +#define EP_MAYBE_DONT_COLLIDE_WITH 80 /* values for internal purpose only (level editor) */ -#define EP_WALK_TO_OBJECT 83 -#define EP_DEADLY 84 +#define EP_WALK_TO_OBJECT 81 +#define EP_DEADLY 82 -#define NUM_ELEMENT_PROPERTIES 85 +#define NUM_ELEMENT_PROPERTIES 83 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -345,6 +345,7 @@ #define CAN_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID) #define IS_THROWABLE(e) HAS_PROPERTY(e, EP_THROWABLE) #define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE) +#define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE) /* macros for special configurable properties */ #define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) @@ -359,7 +360,6 @@ #define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT) #define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT) #define IS_SB_ELEMENT(e) HAS_PROPERTY(e, EP_SB_ELEMENT) -#define IS_SP_BUGGY_BASE(e) HAS_PROPERTY(e, EP_SP_BUGGY_BASE) #define IS_GEM(e) HAS_PROPERTY(e, EP_GEM) #define IS_FOOD_DARK_YAMYAM(e) HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM) #define IS_FOOD_PENGUIN(e) HAS_PROPERTY(e, EP_FOOD_PENGUIN) @@ -405,7 +405,6 @@ HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION) #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID) #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH) -#define IS_DIGGABLE_WITH_GRAVITY(e) HAS_PROPERTY(e, EP_DIGGABLE_WITH_GRAVITY) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ @@ -438,6 +437,14 @@ #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) +/* !!! "use sound" deactivated due to problems with level "bug machine" !!! */ +/* (solution: add separate "use sound of element" to level file and editor) */ +#if 0 +#define SND_ELEMENT(e) GFX_ELEMENT(e) +#else +#define SND_ELEMENT(e) (e) +#endif + #define IS_PLAYER(x, y) (ELEM_IS_PLAYER(StorePlayer[x][y])) #define IS_FREE(x, y) (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x, y)) @@ -535,6 +542,7 @@ #define MIN_ELEMENT_CONTENTS 1 #define STD_ELEMENT_CONTENTS 4 #define MAX_ELEMENT_CONTENTS 8 +#define NUM_MAGIC_BALL_CONTENTS 8 #define LEVEL_SCORE_ELEMENTS 16 /* level elements with score */ @@ -947,7 +955,53 @@ #define EL_TRIGGER_ELEMENT 657 #define EL_TRIGGER_PLAYER 658 -#define NUM_FILE_ELEMENTS 659 +#define EL_SP_GRAVITY_ON_PORT_RIGHT 659 +#define EL_SP_GRAVITY_ON_PORT_DOWN 660 +#define EL_SP_GRAVITY_ON_PORT_LEFT 661 +#define EL_SP_GRAVITY_ON_PORT_UP 662 +#define EL_SP_GRAVITY_OFF_PORT_RIGHT 663 +#define EL_SP_GRAVITY_OFF_PORT_DOWN 664 +#define EL_SP_GRAVITY_OFF_PORT_LEFT 665 +#define EL_SP_GRAVITY_OFF_PORT_UP 666 + + +/* 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_ANDROID 680 +#define EL_EMC_GRASS 681 +#define EL_EMC_MAGIC_BALL 682 +#define EL_EMC_MAGIC_BALL_SWITCH 683 +#define EL_EMC_SPRING_BUMPER 684 +#define EL_EMC_PLANT 685 +#define EL_EMC_LENSES 686 +#define EL_EMC_MAGNIFIER 687 +#define EL_EMC_WALL_9 688 +#define EL_EMC_WALL_10 689 +#define EL_EMC_WALL_11 690 +#define EL_EMC_WALL_12 691 +#define EL_EMC_WALL_13 692 +#define EL_EMC_WALL_14 693 +#define EL_EMC_WALL_15 694 +#define EL_EMC_WALL_16 695 +#define EL_EMC_WALL_SLIPPERY_1 696 +#define EL_EMC_WALL_SLIPPERY_2 697 +#define EL_EMC_WALL_SLIPPERY_3 698 +#define EL_EMC_WALL_SLIPPERY_4 699 +#define EL_EMC_DRIPPER 700 + +#define NUM_FILE_ELEMENTS 701 /* "real" (and therefore drawable) runtime elements */ @@ -1170,14 +1224,17 @@ #define GFX_ARG_POST_DELAY_FIXED 28 #define GFX_ARG_POST_DELAY_RANDOM 29 #define GFX_ARG_NAME 30 +#define GFX_ARG_SCALE_UP_FACTOR 31 -#define NUM_GFX_ARGS 31 +#define NUM_GFX_ARGS 32 /* values for sound configuration suffixes */ #define SND_ARG_MODE_LOOP 0 +#define SND_ARG_VOLUME 1 +#define SND_ARG_PRIORITY 2 -#define NUM_SND_ARGS 1 +#define NUM_SND_ARGS 3 /* values for music configuration suffixes */ @@ -1254,12 +1311,12 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 1 -#define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 3 +#define PROGRAM_VERSION_PATCH 1 +#define PROGRAM_VERSION_BUILD 0 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2003 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2004 by Holger Schemel" #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" @@ -1366,6 +1423,8 @@ struct PlayerInfo boolean use_murphy_graphic; boolean block_last_field; + int block_delay; + boolean can_fall_into_acid; boolean LevelSolved, GameOver; @@ -1402,13 +1461,23 @@ struct PlayerInfo int show_envelope; +#if 1 /* USE_NEW_MOVE_DELAY */ + int move_delay; + int move_delay_value; +#else unsigned long move_delay; int move_delay_value; +#endif int move_delay_reset_counter; +#if 1 /* USE_NEW_PUSH_DELAY */ + int push_delay; + int push_delay_value; +#else unsigned long push_delay; unsigned long push_delay_value; +#endif unsigned long actual_frame_counter; @@ -1447,6 +1516,13 @@ struct LevelFileInfo struct LevelInfo { + struct LevelFileInfo file_info; + + int game_engine_type; + + /* level stored in native format for the alternative native game engines */ + struct LevelInfo_EM *native_em_level; + int file_version; /* file format version the level is stored with */ int game_version; /* game release version the level was created with */ @@ -1478,19 +1554,37 @@ struct LevelInfo int time_light; int time_timegate; + /* values for the new EMC elements */ + int android_move_time; + int android_clone_time; + boolean ball_random; + boolean ball_state_initial; + int ball_time; + int lenses_score; + int magnify_score; + int slurp_score; + int lenses_time; + int magnify_time; + int wind_direction_initial; + int ball_content[NUM_MAGIC_BALL_CONTENTS][3][3]; + boolean android_array[16]; + int can_move_into_acid_bits; /* bitfield to store property for elements */ int dont_collide_with_bits; /* bitfield to store property for elements */ boolean double_speed; boolean initial_gravity; boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */ - boolean block_last_field; /* player blocks previous field while moving */ - boolean sp_block_last_field; /* player blocks previous field while moving */ boolean use_spring_bug; /* for compatibility with old levels */ boolean instant_relocation; /* no visual delay when relocating player */ boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */ + boolean block_last_field; /* player blocks previous field while moving */ + boolean sp_block_last_field; /* player blocks previous field while moving */ + int block_delay; /* delay for blocking previous field */ + int sp_block_delay; /* delay for blocking previous field */ + /* ('int' instead of 'boolean' because used as selectbox value in editor) */ int use_step_counter; /* count steps instead of seconds for level */ @@ -1499,6 +1593,8 @@ struct LevelInfo boolean use_custom_template; /* use custom properties from template file */ boolean no_valid_file; /* set when level file missing or invalid */ + + boolean changed; /* set when level was changed in the editor */ }; struct TapeInfo @@ -1550,6 +1646,10 @@ struct GameInfo int initial_move_delay_value; int initial_push_delay_value; + /* 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; + /* variable within running game */ int yamyam_content_nr; boolean magic_wall_active; @@ -1576,6 +1676,9 @@ struct GlobalInfo char *autoplay_leveldir; int autoplay_level_nr; + char *convert_leveldir; + int convert_level_nr; + int num_toons; float frames_per_second; @@ -1644,6 +1747,15 @@ struct ElementGroupInfo int choice_pos; /* current element choice position */ }; +struct ElementNameInfo +{ + /* ---------- token and description strings ---------- */ + + char *token_name; /* element token used in config files */ + char *class_name; /* element class used in config files */ + char *editor_description; /* pre-defined description for level editor */ +}; + struct ElementInfo { /* ---------- token and description strings ---------- */ @@ -1689,6 +1801,7 @@ struct ElementInfo int move_pattern; /* direction movable element moves to */ int move_direction_initial; /* initial direction element moves to */ int move_stepsize; /* step size element moves with */ + int move_enter_element; /* element that can be entered (and removed) */ int move_leave_element; /* element that can be left behind */ int move_leave_type; /* change (limited) or leave (unlimited) */ @@ -1765,6 +1878,7 @@ struct GraphicInfo int crumbled_like; /* element for cloning crumble graphics */ int diggable_like; /* element for cloning digging graphics */ int border_size; /* border size for "crumbled" graphics */ + int scale_up_factor; /* optional factor for scaling image up */ int anim_delay_fixed; /* optional delay values for bored and */ int anim_delay_random; /* sleeping player animations (animation */ @@ -1787,6 +1901,8 @@ struct GraphicInfo struct SoundInfo { boolean loop; + int volume; + int priority; }; struct MusicInfo @@ -1863,6 +1979,11 @@ extern int game_status; extern boolean level_editor_test_game; extern boolean network_playing; +#if defined(TARGET_SDL) +extern boolean network_server; +extern SDL_Thread *server_thread; +#endif + extern int key_joystick_mapping; extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; @@ -1937,6 +2058,7 @@ extern struct GlobalInfo global; extern struct MenuInfo menu; extern struct DoorInfo door_1, door_2; extern struct ElementInfo element_info[]; +extern struct ElementNameInfo element_name_info[]; extern struct ElementActionInfo element_action_info[]; extern struct ElementDirectionInfo element_direction_info[]; extern struct SpecialSuffixInfo special_suffix_info[]; @@ -1949,12 +2071,12 @@ extern struct MusicInfo *music_info; extern struct MusicFileInfo *music_file_info; extern struct HelpAnimInfo *helpanim_info; extern SetupFileHash *helptext_info; +extern struct ConfigTypeInfo image_config_suffix[]; +extern struct ConfigTypeInfo sound_config_suffix[]; +extern struct ConfigTypeInfo music_config_suffix[]; extern struct ConfigInfo image_config[]; extern struct ConfigInfo sound_config[]; extern struct ConfigInfo music_config[]; -extern struct ConfigInfo image_config_suffix[]; -extern struct ConfigInfo sound_config_suffix[]; -extern struct ConfigInfo music_config_suffix[]; extern struct ConfigInfo helpanim_config[]; extern struct ConfigInfo helptext_config[];