From: Holger Schemel Date: Sun, 15 Dec 2024 20:33:08 +0000 (+0100) Subject: fixed drawing graphics for crumbled sand with BD game engine X-Git-Tag: 4.4.0.0~18 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c94920decbff4019ebce9313f52ec1bc65a672cf;p=rocksndiamonds.git fixed drawing graphics for crumbled sand with BD game engine This change handles another special case when using non-standard cave scheduling (that is, using either non-milliseconds scheduling, or using a game cycle delay other than 160 ms). --- diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 122bd53c..d93ef969 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -620,16 +620,19 @@ static void gd_drawcave_crumbled(Bitmap *dest, GdGame *game, int x, int y, boole GdCave *cave = game->cave; int sx = x * cell_size - scroll_x; int sy = y * cell_size - scroll_y; - int frame = game->itercycle; int border_size = cell_size / 8; int draw = game->drawing_buffer[y][x]; int draw_last = game->last_drawing_buffer[y][x]; int dir_to = game->dir_buffer_to[y][x]; boolean is_moving_to = (dir_to != GD_MV_STILL); boolean is_diggable_last = el_diggable(draw_last); - int tile = (is_moving_to && is_diggable_last ? draw_last : draw); + boolean is_digging = (is_moving_to && is_diggable_last); + int tile = (is_digging ? draw_last : draw); int tile_gfx = get_dirt_element(tile, dir_to, FALSE); int tile_crm = get_dirt_element(tile, dir_to, TRUE); + int animcycle = game->animcycle; + int itercycle = MIN(game->itercycle * 8 / game->itermax, 7); + int frame = (is_digging ? itercycle : animcycle); struct GraphicInfo_BD *gfx = &graphic_info_bd_object[tile_gfx][frame]; struct GraphicInfo_BD *crm = &graphic_info_bd_object[tile_crm][frame]; int dirs[] = { GD_MV_UP, GD_MV_LEFT, GD_MV_RIGHT, GD_MV_DOWN };