X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_cave.c;h=d946bac4c203a3decaa24f2304211802e40a217c;hb=edaa850fd2d2cae7ec31961fae3d56487e710c71;hp=a115cb00111e0266a596c33320086bd6bc687a7d;hpb=a72adb0be3e9fb9cba32662d9c62a9118d9cdb72;p=rocksndiamonds.git diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index a115cb00..d946bac4 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -1316,7 +1316,8 @@ void gd_cave_count_diamonds(GdCave *cave) if a cell is changed, it is flagged with GD_REDRAW; the flag can be cleared by the caller. */ -void gd_drawcave_game(const GdCave *cave, int **element_buffer, int **gfx_buffer, +void gd_drawcave_game(const GdCave *cave, + int **element_buffer, int **last_element_buffer, int **gfx_buffer, boolean bonus_life_flash, int animcycle, boolean hate_invisible_outbox) { static int player_blinking = 0; @@ -1454,6 +1455,16 @@ void gd_drawcave_game(const GdCave *cave, int **element_buffer, int **gfx_buffer draw = gd_elements[O_PLAYER].image_game; } } + else if (cave->last_direction == GD_MV_UP && use_bd_up_down_graphics()) + { + map = O_PLAYER_UP; + draw = gd_elements[O_PLAYER_UP].image_game; + } + else if (cave->last_direction == GD_MV_DOWN && use_bd_up_down_graphics()) + { + map = O_PLAYER_DOWN; + draw = gd_elements[O_PLAYER_DOWN].image_game; + } else if (cave->last_horizontal_direction == GD_MV_LEFT) { map = O_PLAYER_LEFT; @@ -1511,8 +1522,8 @@ void gd_drawcave_game(const GdCave *cave, int **element_buffer, int **gfx_buffer // change only graphically if (hate_invisible_outbox) { - elemmapping[O_PRE_INVIS_OUTBOX] = O_PRE_OUTBOX; - elemmapping[O_INVIS_OUTBOX] = O_OUTBOX; + elemmapping[O_PRE_INVIS_OUTBOX] = elemmapping[O_PRE_OUTBOX]; + elemmapping[O_INVIS_OUTBOX] = elemmapping[O_OUTBOX]; } if (hate_invisible_outbox) @@ -1539,6 +1550,28 @@ void gd_drawcave_game(const GdCave *cave, int **element_buffer, int **gfx_buffer else draw = elemdrawing[actual]; + // draw special graphics if player is pushing something + if (use_bd_pushing_graphics() && + (cave->last_direction == GD_MV_LEFT || cave->last_direction == GD_MV_RIGHT) && + is_player(cave, x, y) && can_be_pushed_dir(cave, x, y, cave->last_direction)) + { + // special check needed when smooth game element movements selected in setup menu: + // last element must either be player (before pushing) or pushable element (while pushing) + // (extra check needed to prevent pushing animation when moving towards pushable element) + if (!use_bd_smooth_movements() || last_element_buffer[y][x] != O_SPACE) + { + if (cave->last_direction == GD_MV_LEFT) + map = O_PLAYER_PUSH_LEFT; + else + map = O_PLAYER_PUSH_RIGHT; + + if (cave->last_direction == GD_MV_LEFT) + draw = elemdrawing[O_PLAYER_PUSH_LEFT]; + else + draw = elemdrawing[O_PLAYER_PUSH_RIGHT]; + } + } + // if negative, animated. if (draw < 0) draw = -draw + animcycle;