X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_graphics.c;h=d355212ed6e28bc0a382088cc6163d7591ba9b90;hb=5edfe76e94d71fa7b0024c8ddf74fddf5d26160d;hp=084fb3f0f91cd7712514329e4e91781143498214;hpb=93a37840d8ff4a84fc878f148e3abfeecb701821;p=rocksndiamonds.git diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 084fb3f0..d355212e 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -291,12 +291,36 @@ static inline boolean is_player(const int element) return (gd_elements[element & O_MASK].properties & P_PLAYER) != 0; } +// returns true if the element is diggable +static inline boolean is_diggable(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_DIGGABLE) != 0; +} + // returns true if the element is collectible static inline boolean is_collectible(const int element) { return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0; } +// returns true if the element is pushable +static inline boolean is_pushable(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_PUSHABLE) != 0; +} + +// returns true if the element can move +static inline boolean can_move(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_CAN_MOVE) != 0; +} + +// returns true if the element can fall +static inline boolean can_fall(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_CAN_FALL) != 0; +} + // returns true if the element is exploding static inline boolean is_explosion(const int element) { @@ -374,7 +398,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d int dy = (dir == GD_MV_UP ? +1 : dir == GD_MV_DOWN ? -1 : 0); int old_x = cave->getx(cave, x + dx, y + dy); int old_y = cave->gety(cave, x + dx, y + dy); - int tile_from = game->element_buffer[old_y][old_x]; + int tile_from = game->element_buffer[old_y][old_x] & ~SKIPPED; // should never be skipped struct GraphicInfo_BD *g_from = &graphic_info_bd_object[tile_from][frame]; boolean old_is_player = is_player(tile_from); boolean old_is_moving = (game->dir_buffer[old_y][old_x] != GD_MV_STILL);