fixed graphics when digging crumbled sand with BD game engine
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 14 Dec 2024 18:10:30 +0000 (19:10 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 14 Dec 2024 18:10:33 +0000 (19:10 +0100)
This change is needed for BD1 cave scheduling where animation cycle is
not always in sync with the game engine.

src/game_bd/bd_graphics.c
src/tools.c

index c6fd7d0310ee0bf78ba61ac57586f5985c4dcee0..122bd53c4f39b76b142844e45474d52fd01f6eb2 100644 (file)
@@ -620,7 +620,7 @@ 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->animcycle;
+  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];
index 1684a8e09715e27d131173bf8e573a048b9d95ee..6ec7373a21fd804ee06ff2936d762f8f887fedf7 100644 (file)
@@ -11268,7 +11268,7 @@ void InitGraphicInfo_BD(void)
                        e == O_DIRT2_DIGGING_LEFT_CRUMBLED  ||
                        e == O_DIRT2_DIGGING_RIGHT_CRUMBLED ||
                        e == O_DIRT2_DIGGING_UP_CRUMBLED    ||
-                       e == O_DIRT2_DIGGING_DOWN_CRUMBLED ? j * 2 % 8:
+                       e == O_DIRT2_DIGGING_DOWN_CRUMBLED ? j :
                        j * 2);
       int frame = getAnimationFrame(g->anim_frames,
                                    g->anim_delay,