From 18e61fc6160bd7d8480de33183d9e9f80785f049 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 10 Jan 2025 19:22:10 +0100 Subject: [PATCH] added redrawing tile for BD engine if it has animated graphics --- src/game_bd/bd_graphics.c | 7 +++++++ src/game_bd/export_bd.h | 2 ++ src/tools.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 15f7af82..050b9bf1 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -530,6 +530,12 @@ static inline boolean el_has_crumbled(const int element) return (gfx->graphic != crm->graphic); } +// returns true if the element has animated graphics +static inline boolean el_is_animated(const int element) +{ + return graphic_info_bd_object[element][0].animated; +} + // returns true if the element can fall static inline boolean el_falling(const int element) { @@ -973,6 +979,7 @@ int gd_drawcave(Bitmap *dest, GdGame *game, boolean force_redraw) for (x = cave->x1; x <= cave->x2; x++) { if (redraw_all || + el_is_animated(game->drawing_buffer[y][x]) || el_has_crumbled(game->drawing_buffer[y][x]) || game->gfx_buffer[y][x] & GD_REDRAW || game->dir_buffer_from[y][x] != GD_MV_STILL || diff --git a/src/game_bd/export_bd.h b/src/game_bd/export_bd.h index 018e84e6..ad0aeb77 100644 --- a/src/game_bd/export_bd.h +++ b/src/game_bd/export_bd.h @@ -80,6 +80,8 @@ struct GraphicInfo_BD int graphic; int frame; + + boolean animated; }; struct EngineSnapshotInfo_BD diff --git a/src/tools.c b/src/tools.c index deddc334..abefd61c 100644 --- a/src/tools.c +++ b/src/tools.c @@ -11383,6 +11383,8 @@ void InitGraphicInfo_BD(void) g_bd->graphic = graphic; g_bd->frame = frame; + + g_bd->animated = IS_ANIMATED(graphic); } } } -- 2.34.1