added redrawing tile for BD engine if it has animated graphics
authorHolger Schemel <holger.schemel@virtion.de>
Fri, 10 Jan 2025 18:22:10 +0000 (19:22 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Fri, 10 Jan 2025 12:23:12 +0000 (13:23 +0100)
src/game_bd/bd_graphics.c
src/game_bd/export_bd.h
src/tools.c

index 15f7af82485725977bbe85e8b83689dd375352e7..050b9bf1b50156431e4b22075036bcd3f738cec7 100644 (file)
@@ -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 ||
index 018e84e65d9d1aa1ad4952c00546deda6b34d331..ad0aeb771137ac584911e6006f453fd5abae2f57 100644 (file)
@@ -80,6 +80,8 @@ struct GraphicInfo_BD
 
   int graphic;
   int frame;
+
+  boolean animated;
 };
 
 struct EngineSnapshotInfo_BD
index deddc334ba49287586e3481f3ec786cbb03c3172..abefd61c38a29ebf0ca132229a008270036eb1ea 100644 (file)
@@ -11383,6 +11383,8 @@ void InitGraphicInfo_BD(void)
 
       g_bd->graphic = graphic;
       g_bd->frame = frame;
+
+      g_bd->animated = IS_ANIMATED(graphic);
     }
   }
 }