From: Holger Schemel Date: Wed, 16 Apr 2003 17:40:58 +0000 (+0200) Subject: rnd-20030416-2-src X-Git-Tag: 3.0.0^2~98 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b98c54e042b8dd87b4a42f0a038a600bdd23ffd4;p=rocksndiamonds.git rnd-20030416-2-src --- diff --git a/src/conftime.h b/src/conftime.h index 6338934d..26c387b9 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-15 23:44]" +#define COMPILE_DATE_STRING "[2003-04-16 19:38]" diff --git a/src/game.c b/src/game.c index 338e670b..ce66ee87 100644 --- a/src/game.c +++ b/src/game.c @@ -5030,7 +5030,7 @@ static void CheckGravityMovement(struct PlayerInfo *player) if (field_under_player_is_free && !player_is_moving_to_valid_field && - !IS_WALKABLE_UNDER(Feld[jx][jy])) + !IS_WALKABLE_THROUGH(Feld[jx][jy])) player->programmed_action = MV_DOWN; } } @@ -5706,7 +5706,7 @@ int DigField(struct PlayerInfo *player, if (IS_MOVING(x, y) || IS_PLAYER(x, y)) return MF_NO_ACTION; - if (IS_WALKABLE_UNDER(Feld[jx][jy])) + if (IS_WALKABLE_THROUGH(Feld[jx][jy])) { int i = 0; int tube_leave_directions[][2] = diff --git a/src/init.c b/src/init.c index 508a50af..9224bb64 100644 --- a/src/init.c +++ b/src/init.c @@ -1957,6 +1957,63 @@ void InitElementProperties() -1 }; + static int ep_walkable_through[] = + { + EL_TUBE_ANY, + EL_TUBE_VERTICAL, + EL_TUBE_HORIZONTAL, + EL_TUBE_VERTICAL_LEFT, + EL_TUBE_VERTICAL_RIGHT, + EL_TUBE_HORIZONTAL_UP, + EL_TUBE_HORIZONTAL_DOWN, + EL_TUBE_LEFT_UP, + EL_TUBE_LEFT_DOWN, + EL_TUBE_RIGHT_UP, + EL_TUBE_RIGHT_DOWN, + -1 + }; + + static int ep_walkable_under[] = + { + -1 + }; + + static int ep_passable_over[] = + { + EL_EM_GATE_1, + EL_EM_GATE_2, + EL_EM_GATE_3, + EL_EM_GATE_4, + EL_EM_GATE_1_GRAY, + EL_EM_GATE_2_GRAY, + EL_EM_GATE_3_GRAY, + EL_EM_GATE_4_GRAY, + EL_SWITCHGATE_OPEN, + EL_TIMEGATE_OPEN, + -1 + }; + + static int ep_passable_through[] = + { + EL_SP_PORT_LEFT, + EL_SP_PORT_RIGHT, + EL_SP_PORT_UP, + EL_SP_PORT_DOWN, + EL_SP_PORT_HORIZONTAL, + EL_SP_PORT_VERTICAL, + EL_SP_PORT_ANY, + EL_SP_GRAVITY_PORT_LEFT, + EL_SP_GRAVITY_PORT_RIGHT, + EL_SP_GRAVITY_PORT_UP, + EL_SP_GRAVITY_PORT_DOWN, + -1 + }; + + static int ep_passable_under[] = + { + -1 + }; + static int ep_diggable[] = { EL_SAND, @@ -2006,32 +2063,6 @@ void InitElementProperties() -1 }; - static int ep_walkable_through[] = - { - EL_EM_GATE_1, - EL_EM_GATE_2, - EL_EM_GATE_3, - EL_EM_GATE_4, - EL_EM_GATE_1_GRAY, - EL_EM_GATE_2_GRAY, - EL_EM_GATE_3_GRAY, - EL_EM_GATE_4_GRAY, - EL_SP_PORT_LEFT, - EL_SP_PORT_RIGHT, - EL_SP_PORT_UP, - EL_SP_PORT_DOWN, - EL_SP_PORT_HORIZONTAL, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_ANY, - EL_SP_GRAVITY_PORT_LEFT, - EL_SP_GRAVITY_PORT_RIGHT, - EL_SP_GRAVITY_PORT_UP, - EL_SP_GRAVITY_PORT_DOWN, - EL_SWITCHGATE_OPEN, - EL_TIMEGATE_OPEN, - -1 - }; - static int ep_over_player[] = { EL_SP_PORT_LEFT, @@ -2121,22 +2152,6 @@ void InitElementProperties() -1 }; - static int ep_walkable_under[] = - { - EL_TUBE_ANY, - EL_TUBE_VERTICAL, - EL_TUBE_HORIZONTAL, - EL_TUBE_VERTICAL_LEFT, - EL_TUBE_VERTICAL_RIGHT, - EL_TUBE_HORIZONTAL_UP, - EL_TUBE_HORIZONTAL_DOWN, - EL_TUBE_LEFT_UP, - EL_TUBE_LEFT_DOWN, - EL_TUBE_RIGHT_UP, - EL_TUBE_RIGHT_DOWN, - -1 - }; - static int ep_sp_element[] = { EL_SP_EMPTY, @@ -2197,11 +2212,6 @@ void InitElementProperties() -1 }; - static int ep_solid_new[] = - { - -1 - }; - static struct { int *elements; @@ -2234,18 +2244,21 @@ void InitElementProperties() { ep_pushable, EP_PUSHABLE }, { ep_player, EP_PLAYER }, { ep_walkable_over, EP_WALKABLE_OVER }, + { ep_walkable_through, EP_WALKABLE_THROUGH }, + { ep_walkable_under, EP_WALKABLE_UNDER }, + { ep_passable_over, EP_PASSABLE_OVER }, + { ep_passable_through, EP_PASSABLE_THROUGH }, + { ep_passable_under, EP_PASSABLE_UNDER }, + { ep_diggable, EP_DIGGABLE }, { ep_collectible, EP_COLLECTIBLE }, - { ep_walkable_through, EP_WALKABLE_THROUGH }, { ep_over_player, EP_OVER_PLAYER }, { ep_active_bomb, EP_ACTIVE_BOMB }, { ep_belt, EP_BELT }, { ep_belt_active, EP_BELT_ACTIVE }, { ep_belt_switch, EP_BELT_SWITCH }, - { ep_walkable_under, EP_WALKABLE_UNDER }, { ep_sp_element, EP_SP_ELEMENT }, { ep_has_content, EP_HAS_CONTENT }, - { ep_solid_new, EP_SOLID_NEW }, { NULL, -1 } }; @@ -2271,7 +2284,7 @@ void InitElementProperties() EP_PLAYER, EP_HAS_CONTENT, EP_DIGGABLE, - EP_WALKABLE_THROUGH, + EP_PASSABLE_THROUGH, EP_OVER_PLAYER, EP_ACTIVE_BOMB, @@ -2299,6 +2312,25 @@ void InitElementProperties() for (i=EL_CHAR_START; i<=EL_CHAR_END; i++) SET_PROPERTY(i, EP_INACTIVE, TRUE); + /* set properties derived from other properties */ + for (i=0; i=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) diff --git a/src/tools.c b/src/tools.c index 8582ac84..f0a26776 100644 --- a/src/tools.c +++ b/src/tools.c @@ -745,16 +745,20 @@ void DrawPlayer(struct PlayerInfo *player) } /* ----------------------------------------------------------------------- */ - /* draw elements that stay over the player */ + /* draw elements the player is just walking/passing through/under */ /* ----------------------------------------------------------------------- */ /* handle the field the player is leaving ... */ - if (player_is_moving && IS_OVER_PLAYER(last_element)) + if (player_is_moving && IS_PLAYER_INSIDE(last_element)) DrawLevelField(last_jx, last_jy); + else if (player_is_moving && IS_PLAYER_UNDER(last_element)) + DrawLevelFieldThruMask(last_jx, last_jy); /* ... and the field the player is entering */ - if (IS_OVER_PLAYER(element)) + if (IS_PLAYER_INSIDE(element)) DrawLevelField(jx, jy); + else if (IS_PLAYER_UNDER(element)) + DrawLevelFieldThruMask(jx, jy); if (setup.direct_draw) {