X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=1ab53e5bdcbf10fa5cd7ed8e217ebe4ab2351f4e;hb=445f1cdcd097f1ede6f6224c1aeef91c7f8eae81;hp=c8aca94af96d16e06271779961fb97522ed3f0f0;hpb=cdc3c940197937b0508a1eb7dcf44874951908b7;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index c8aca94a..1ab53e5b 100644 --- a/src/main.h +++ b/src/main.h @@ -157,8 +157,9 @@ /* values for internal purpose only (game engine) */ #define EP_HAS_ACTION 83 +#define EP_CAN_CHANGE_OR_HAS_ACTION 84 -#define NUM_ELEMENT_PROPERTIES 84 +#define NUM_ELEMENT_PROPERTIES 85 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -190,15 +191,8 @@ #define CE_PLAYER_PUSHES_X 13 #define CE_PLAYER_COLLECTS_X 14 #define CE_PLAYER_DROPS_X 15 - -#if 1 #define CE_COUNT_AT_ZERO 16 #define CE_COUNT_AT_ZERO_OF_X 17 -#else -#define CE_BY_PLAYER_OBSOLETE 16 /* obsolete; now CE_BY_DIRECT_ACTION */ -#define CE_BY_COLLISION_OBSOLETE 17 /* obsolete; now CE_BY_DIRECT_ACTION */ -#endif - #define CE_BY_OTHER_ACTION 18 /* activates other element events */ #define CE_BY_DIRECT_ACTION 19 /* activates direct element events */ #define CE_PLAYER_DIGS_X 20 @@ -217,8 +211,6 @@ #define CE_BITMASK_DEFAULT 0 -#if 1 - #define CH_EVENT_VAR(e,c) (element_info[e].change->has_event[c]) #define CH_ANY_EVENT_VAR(e,c) (element_info[e].has_change_event[c]) @@ -233,26 +225,6 @@ #define SET_ANY_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \ CH_ANY_EVENT_VAR(e,c) = (v) : 0) -#else - -#define CH_EVENT_BIT(c) (1 << (c)) -#define CH_EVENT_VAR(e) (element_info[e].change->events) -#define CH_ANY_EVENT_VAR(e) (element_info[e].change_events) - -#define HAS_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \ - (CH_EVENT_VAR(e) & CH_EVENT_BIT(c)) != 0) -#define HAS_ANY_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \ - (CH_ANY_EVENT_VAR(e) & CH_EVENT_BIT(c)) != 0) -#define SET_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \ - ((v) ? \ - (CH_EVENT_VAR(e) |= CH_EVENT_BIT(c)) : \ - (CH_EVENT_VAR(e) &= ~CH_EVENT_BIT(c))) : 0) -#define SET_ANY_CHANGE_EVENT(e,c,v) (IS_CUSTOM_ELEMENT(e) ? \ - ((v) ? \ - (CH_ANY_EVENT_VAR(e) |= CH_EVENT_BIT(c)) : \ - (CH_ANY_EVENT_VAR(e) &= ~CH_EVENT_BIT(c))) : 0) -#endif - /* values for player bitmasks */ #define PLAYER_BITS_NONE 0 #define PLAYER_BITS_1 (1 << 0) @@ -318,11 +290,12 @@ /* values for change action mode for custom elements */ #define CA_MODE_UNDEFINED 0 -#define CA_MODE_ADD 1 -#define CA_MODE_SUBTRACT 2 -#define CA_MODE_MULTIPLY 3 -#define CA_MODE_DIVIDE 4 -#define CA_MODE_SET 5 +#define CA_MODE_SET 1 +#define CA_MODE_ADD 2 +#define CA_MODE_SUBTRACT 3 +#define CA_MODE_MULTIPLY 4 +#define CA_MODE_DIVIDE 5 +#define CA_MODE_MODULO 6 /* values for change action parameters for custom elements */ #define CA_ARG_MIN 0 @@ -510,6 +483,8 @@ #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 HAS_ACTION(e) HAS_PROPERTY(e, EP_HAS_ACTION) +#define CAN_CHANGE_OR_HAS_ACTION(e) \ + HAS_PROPERTY(e, EP_CAN_CHANGE_OR_HAS_ACTION) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ @@ -613,8 +588,6 @@ #define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_PLAYER_1]) #define SHIELD_ON(p) ((p)->shield_normal_time_left > 0) -#if 1 - #define ENEMY_PROTECTED_FIELD(x,y) (IS_PROTECTED(Feld[x][y]) || \ IS_PROTECTED(Back[x][y])) #define EXPLOSION_PROTECTED_FIELD(x,y) (IS_EXPLOSION_PROOF(Feld[x][y])) @@ -623,16 +596,6 @@ #define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ EXPLOSION_PROTECTED_FIELD(x, y)) -#else - -#define PROTECTED_FIELD(x,y) (IS_ACCESSIBLE_INSIDE(Feld[x][y]) && \ - IS_INDESTRUCTIBLE(Feld[x][y])) -#define PLAYER_ENEMY_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ - PROTECTED_FIELD(x, y)) -#define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ - PROTECTED_FIELD(x, y)) -#endif - #define PLAYER_SWITCHING(p,x,y) ((p)->is_switching && \ (p)->switch_x == (x) && (p)->switch_y == (y)) @@ -1390,8 +1353,9 @@ #define GFX_ARG_POST_DELAY_RANDOM 35 #define GFX_ARG_NAME 36 #define GFX_ARG_SCALE_UP_FACTOR 37 +#define GFX_ARG_CLONE_FROM 38 -#define NUM_GFX_ARGS 38 +#define NUM_GFX_ARGS 39 /* values for sound configuration suffixes */ @@ -1654,23 +1618,12 @@ 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; @@ -1776,11 +1729,6 @@ 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 */ @@ -1891,11 +1839,7 @@ struct ElementChangeInfo { boolean can_change; /* use or ignore this change info */ -#if 1 boolean has_event[NUM_CHANGE_EVENTS]; /* change events */ -#else - unsigned long events; /* change events */ -#endif int trigger_player; /* player triggering change */ int trigger_side; /* side triggering change */ @@ -1918,7 +1862,7 @@ struct ElementChangeInfo boolean explode; /* explode instead of change */ - boolean use_action; /* execute action on specified condition */ + boolean has_action; /* execute action on specified condition */ int action_type; /* type of action */ int action_mode; /* mode of action */ int action_arg; /* parameter of action */ @@ -1934,6 +1878,8 @@ struct ElementChangeInfo short actual_trigger_element; /* element that actually triggered change */ int actual_trigger_player; /* player which actually triggered change */ + boolean can_change_or_has_action; /* can_change | has_action */ + /* ---------- internal values used in level editor ---------- */ int direct_action; /* change triggered by actions on element */ @@ -1998,8 +1944,8 @@ struct ElementInfo int access_direction; /* accessible from which direction */ - int collect_score; /* score value for collecting */ - int collect_count; /* count value for collecting */ + int collect_score_initial; /* initial score value for collecting */ + int collect_count_initial; /* initial count value for collecting */ int push_delay_fixed; /* constant delay before pushing */ int push_delay_random; /* additional random delay before pushing */ @@ -2024,8 +1970,6 @@ struct ElementInfo int explosion_delay; /* duration of explosion of this element */ int ignition_delay; /* delay for explosion by other explosion */ - int counter_initial; /* initial value of generic CE counter */ - struct ElementChangeInfo *change_page; /* actual list of change pages */ struct ElementChangeInfo *change; /* pointer to current change page */ @@ -2036,23 +1980,14 @@ struct ElementInfo /* ---------- internal values used at runtime when playing ---------- */ -#if 1 boolean has_change_event[NUM_CHANGE_EVENTS]; -#else - unsigned long change_events; /* bitfield for combined change events */ -#endif int event_page_nr[NUM_CHANGE_EVENTS]; /* page number for each event */ struct ElementChangeInfo *event_page[NUM_CHANGE_EVENTS]; /* page for event */ boolean in_group[NUM_GROUP_ELEMENTS]; -#if 0 - boolean can_leave_element; /* element can leave other element behind */ - boolean can_leave_element_last; -#endif - - int counter; /* current value of generic CE counter */ + int collect_score; /* runtime score value for collecting */ /* ---------- internal values used in level editor ---------- */ @@ -2084,6 +2019,9 @@ struct FontInfo struct GraphicInfo { Bitmap *bitmap; + int src_image_width; /* scaled bitmap size, but w/o small images */ + int src_image_height; /* scaled bitmap size, but w/o small images */ + int src_x, src_y; /* start position of animation frames */ int width, height; /* width/height of each animation frame */ int offset_x, offset_y; /* x/y offset to next animation frame */ @@ -2100,6 +2038,7 @@ struct GraphicInfo 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 clone_from; /* graphic for cloning *all* settings */ int anim_delay_fixed; /* optional delay values for bored and */ int anim_delay_random; /* sleeping player animations (animation */ @@ -2187,10 +2126,6 @@ struct HelpAnimInfo }; -#if 0 -extern GC tile_clip_gc; -extern Bitmap *pix[]; -#endif extern Bitmap *bitmap_db_field, *bitmap_db_door; extern Pixmap tile_clipmask[]; extern DrawBuffer *fieldbuffer; @@ -2216,6 +2151,7 @@ extern short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short Count[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];