added crumbled graphics support for more BD style game elements
authorHolger Schemel <holger.schemel@virtion.de>
Thu, 12 Dec 2024 00:20:13 +0000 (01:20 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Thu, 12 Dec 2024 00:23:02 +0000 (01:23 +0100)
- bdx_grass
- bdx_sand_glued
- bdx_biter_switch_1/2/3/4

src/conf_gfx.c
src/game_bd/bd_cavedb.c
src/game_bd/bd_elements.h
src/game_bd/bd_graphics.c
src/tools.c

index fa04ef0296e9f26665066ee9a64cd4953789bd38..000572a27b305d17e89397d0469c95cbf43b453b 100644 (file)
@@ -621,6 +621,24 @@ struct ConfigInfo image_config[] =
 
   { "bdx_grass",                                       UNDEFINED_FILENAME              },
   { "bdx_grass.clone_from",                            "emc_grass"                     },
+  { "bdx_grass.CRUMBLED",                              UNDEFINED_FILENAME              },
+  { "bdx_grass.CRUMBLED.clone_from",                   "emc_grass.CRUMBLED"            },
+  { "bdx_grass.digging.left",                          UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.left.clone_from",               "emc_grass.digging.left"        },
+  { "bdx_grass.digging.right",                         UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.right.clone_from",              "emc_grass.digging.right"       },
+  { "bdx_grass.digging.up",                            UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.up.clone_from",                 "emc_grass.digging.up"          },
+  { "bdx_grass.digging.down",                          UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.down.clone_from",               "emc_grass.digging.down"        },
+  { "bdx_grass.digging.left.CRUMBLED",                 UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.left.CRUMBLED.clone_from",      "emc_grass.digging.left.CRUMBLED" },
+  { "bdx_grass.digging.right.CRUMBLED",                        UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.right.CRUMBLED.clone_from",     "emc_grass.digging.right.CRUMBLED" },
+  { "bdx_grass.digging.up.CRUMBLED",                   UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.up.CRUMBLED.clone_from",                "emc_grass.digging.up.CRUMBLED" },
+  { "bdx_grass.digging.down.CRUMBLED",                 UNDEFINED_FILENAME              },
+  { "bdx_grass.digging.down.CRUMBLED.clone_from",      "emc_grass.digging.down.CRUMBLED" },
 
   { "bdx_grass_ball",                                  "RocksBD.png"                   },
   { "bdx_grass_ball.xpos",                             "9"                             },
@@ -657,6 +675,8 @@ struct ConfigInfo image_config[] =
 
   { "bdx_sand_glued",                                  UNDEFINED_FILENAME              },
   { "bdx_sand_glued.clone_from",                       "bdx_sand"                      },
+  { "bdx_sand_glued.CRUMBLED",                         UNDEFINED_FILENAME              },
+  { "bdx_sand_glued.CRUMBLED.clone_from",              "bdx_sand.CRUMBLED"             },
   { "bdx_sand_glued.EDITOR",                           "RocksBD2.png"                  },
   { "bdx_sand_glued.EDITOR.xpos",                      "2"                             },
   { "bdx_sand_glued.EDITOR.ypos",                      "4"                             },
@@ -948,21 +968,29 @@ struct ConfigInfo image_config[] =
   { "bdx_biter_switch_1.xpos",                         "4"                             },
   { "bdx_biter_switch_1.ypos",                         "4"                             },
   { "bdx_biter_switch_1.frames",                       "1"                             },
+  { "bdx_biter_switch_1.CRUMBLED",                     UNDEFINED_FILENAME              },
+  { "bdx_biter_switch_1.CRUMBLED.clone_from",          "bdx_sand.CRUMBLED"             },
 
   { "bdx_biter_switch_2",                              "RocksBD.png"                   },
   { "bdx_biter_switch_2.xpos",                         "5"                             },
   { "bdx_biter_switch_2.ypos",                         "4"                             },
   { "bdx_biter_switch_2.frames",                       "1"                             },
+  { "bdx_biter_switch_2.CRUMBLED",                     UNDEFINED_FILENAME              },
+  { "bdx_biter_switch_2.CRUMBLED.clone_from",          "bdx_sand.CRUMBLED"             },
 
   { "bdx_biter_switch_3",                              "RocksBD.png"                   },
   { "bdx_biter_switch_3.xpos",                         "6"                             },
   { "bdx_biter_switch_3.ypos",                         "4"                             },
   { "bdx_biter_switch_3.frames",                       "1"                             },
+  { "bdx_biter_switch_3.CRUMBLED",                     UNDEFINED_FILENAME              },
+  { "bdx_biter_switch_3.CRUMBLED.clone_from",          "bdx_sand.CRUMBLED"             },
 
   { "bdx_biter_switch_4",                              "RocksBD.png"                   },
   { "bdx_biter_switch_4.xpos",                         "7"                             },
   { "bdx_biter_switch_4.ypos",                         "4"                             },
   { "bdx_biter_switch_4.frames",                       "1"                             },
+  { "bdx_biter_switch_4.CRUMBLED",                     UNDEFINED_FILENAME              },
+  { "bdx_biter_switch_4.CRUMBLED.clone_from",          "bdx_sand.CRUMBLED"             },
 
   { "bdx_replicator",                                  UNDEFINED_FILENAME              },
   { "bdx_replicator.clone_from",                       "emc_magic_ball"                },
index 6be9724ffe45a56d8d8aae202a3396ec2dd37eed..df768a50a71d19cff49c5529bfc40df19c9ad9fe 100644 (file)
@@ -239,6 +239,51 @@ GdElementProperty gd_element_properties[] =
     P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
     "DIRT2", 0, 3, 3, 3
   },
+  {
+    O_DIRT2_CRUMBLED, O_DIRT2_CRUMBLED, N_("Dirt 2 (crumbled)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_CRUMBLED", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_LEFT, O_DIRT2_DIGGING_LEFT, N_("Dirt 2 (digging left)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_LEFT", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_RIGHT, O_DIRT2_DIGGING_RIGHT, N_("Dirt 2 (digging right)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_RIGHT", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_UP, O_DIRT2_DIGGING_UP, N_("Dirt 2 (digging up)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_UP", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_DOWN, O_DIRT2_DIGGING_DOWN, N_("Dirt 2 (digging down)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_LEFT_CRUMBLED, O_DIRT2_DIGGING_LEFT_CRUMBLED, N_("Dirt 2 (digging left, crumbled)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_LEFT_CRUMBLED", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_RIGHT_CRUMBLED, O_DIRT2_DIGGING_RIGHT_CRUMBLED, N_("Dirt 2 (digging right, crumbled)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_RIGHT_CRUMBLED", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_UP_CRUMBLED, O_DIRT2_DIGGING_UP_CRUMBLED, N_("Dirt 2 (digging up, crumbled)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_UP_CRUMBLED", 0, 3, 3, 3
+  },
+  {
+    O_DIRT2_DIGGING_DOWN_CRUMBLED, O_DIRT2_DIGGING_DOWN_CRUMBLED, N_("Dirt 2 (digging down, crumbled)"),
+    P_DIRT | P_AMOEBA_CONSUMES | P_DIGGABLE,
+    "DIRT2_DIGGING_DOWN_CRUMBLED", 0, 3, 3, 3
+  },
   {
     O_BRICK, O_BRICK, N_("Brick wall"),
     P_SLOPED|P_BLADDER_SLOPED|P_CAN_BE_HAMMERED,
@@ -644,6 +689,11 @@ GdElementProperty gd_element_properties[] =
     0,
     "GLUEDDIRT", 0, i_dirt_glued, i_dirt_glued, 2
   },
+  {
+    O_DIRT_GLUED_CRUMBLED, O_DIRT_GLUED_CRUMBLED, N_("Glued dirt (crumbled)"),
+    0,
+    "GLUEDDIRT_CRUMBLED", 0, i_dirt_glued, i_dirt_glued, 2
+  },
   {
     O_KEY_1, O_KEY_1, N_("Key 1"),
     P_COLLECTIBLE,
@@ -1950,6 +2000,26 @@ GdElementProperty gd_element_properties[] =
     0,
     NULL, 0, 15, 15, 15
   },
+  {
+    O_BITER_SWITCH_1_CRUMBLED, O_BITER_SWITCH_1_CRUMBLED, NULL,
+    0,
+    NULL, 0, 12, 12, 12
+  },
+  {
+    O_BITER_SWITCH_2_CRUMBLED, O_BITER_SWITCH_2_CRUMBLED, NULL,
+    0,
+    NULL, 0, 13, 13, 13
+  },
+  {
+    O_BITER_SWITCH_3_CRUMBLED, O_BITER_SWITCH_3_CRUMBLED, NULL,
+    0,
+    NULL, 0, 14, 14, 14
+  },
+  {
+    O_BITER_SWITCH_4_CRUMBLED, O_BITER_SWITCH_4_CRUMBLED, NULL,
+    0,
+    NULL, 0, 15, 15, 15
+  },
 
   {
     O_STONE_MOVE_LEFT, O_STONE_MOVE_LEFT, N_("Stone, moved left"),
index 3d55082d4c14e024dfee7bbcc1851f7dcc441cb6..ab60e908e08860b59bc4cc305ec320dca2079b73 100644 (file)
@@ -48,6 +48,15 @@ typedef enum _element
   O_DIRT_LOOSE_F,
   O_DIRT_LOOSE_F_scanned,
   O_DIRT2,
+  O_DIRT2_CRUMBLED,
+  O_DIRT2_DIGGING_LEFT,
+  O_DIRT2_DIGGING_RIGHT,
+  O_DIRT2_DIGGING_UP,
+  O_DIRT2_DIGGING_DOWN,
+  O_DIRT2_DIGGING_LEFT_CRUMBLED,
+  O_DIRT2_DIGGING_RIGHT_CRUMBLED,
+  O_DIRT2_DIGGING_UP_CRUMBLED,
+  O_DIRT2_DIGGING_DOWN_CRUMBLED,
   O_BRICK,
   O_BRICK_SLOPED_UP_RIGHT,
   O_BRICK_SLOPED_UP_LEFT,
@@ -135,6 +144,7 @@ typedef enum _element
   O_TRAPPED_DIAMOND,
   O_CLOCK,
   O_DIRT_GLUED,
+  O_DIRT_GLUED_CRUMBLED,
   O_KEY_1,
   O_KEY_2,
   O_KEY_3,
@@ -411,6 +421,10 @@ typedef enum _element
   O_BITER_SWITCH_2,
   O_BITER_SWITCH_3,
   O_BITER_SWITCH_4,
+  O_BITER_SWITCH_1_CRUMBLED,
+  O_BITER_SWITCH_2_CRUMBLED,
+  O_BITER_SWITCH_3_CRUMBLED,
+  O_BITER_SWITCH_4_CRUMBLED,
 
   O_STONE_MOVE_LEFT,
   O_STONE_MOVE_RIGHT,
index 817669619b71d9580aefd0453db247662cb3eea9..6aaa0ada5c5dcc2a274295b88d51ea2b46fa9a30 100644 (file)
@@ -506,7 +506,14 @@ static inline boolean el_can_dig(const int element)
 static inline boolean el_has_crumbled(const int element)
 {
   int tile_gfx = element;
-  int tile_crm = (element == O_DIRT ? O_DIRT_CRUMBLED : element);
+  int tile_crm = (element == O_DIRT           ? O_DIRT_CRUMBLED           :
+                  element == O_DIRT2          ? O_DIRT2_CRUMBLED          :
+                  element == O_DIRT_GLUED     ? O_DIRT_GLUED_CRUMBLED     :
+                  element == O_BITER_SWITCH_1 ? O_BITER_SWITCH_1_CRUMBLED :
+                  element == O_BITER_SWITCH_2 ? O_BITER_SWITCH_2_CRUMBLED :
+                  element == O_BITER_SWITCH_3 ? O_BITER_SWITCH_3_CRUMBLED :
+                  element == O_BITER_SWITCH_4 ? O_BITER_SWITCH_4_CRUMBLED :
+                  element);
   struct GraphicInfo_BD *gfx = &graphic_info_bd_object[tile_gfx][0];
   struct GraphicInfo_BD *crm = &graphic_info_bd_object[tile_crm][0];
 
@@ -553,6 +560,56 @@ static inline boolean el_smooth_movable(const int element)
           el_pushable(element));
 }
 
+static int get_dirt_element(int element, int dir, boolean crumbled)
+{
+  switch (element)
+  {
+    case O_DIRT:
+      return (crumbled ?
+              (dir == GD_MV_LEFT  ? O_DIRT_DIGGING_LEFT_CRUMBLED  :
+               dir == GD_MV_RIGHT ? O_DIRT_DIGGING_RIGHT_CRUMBLED :
+               dir == GD_MV_UP    ? O_DIRT_DIGGING_UP_CRUMBLED    :
+               dir == GD_MV_DOWN  ? O_DIRT_DIGGING_DOWN_CRUMBLED  : O_DIRT_CRUMBLED) :
+
+              (dir == GD_MV_LEFT  ? O_DIRT_DIGGING_LEFT   :
+               dir == GD_MV_RIGHT ? O_DIRT_DIGGING_RIGHT  :
+               dir == GD_MV_UP    ? O_DIRT_DIGGING_UP     :
+               dir == GD_MV_DOWN  ? O_DIRT_DIGGING_DOWN   : O_DIRT));
+
+    case O_DIRT2:
+      return (crumbled ?
+              (dir == GD_MV_LEFT  ? O_DIRT2_DIGGING_LEFT_CRUMBLED  :
+               dir == GD_MV_RIGHT ? O_DIRT2_DIGGING_RIGHT_CRUMBLED :
+               dir == GD_MV_UP    ? O_DIRT2_DIGGING_UP_CRUMBLED    :
+               dir == GD_MV_DOWN  ? O_DIRT2_DIGGING_DOWN_CRUMBLED  : O_DIRT2_CRUMBLED) :
+
+              (dir == GD_MV_LEFT  ? O_DIRT2_DIGGING_LEFT   :
+               dir == GD_MV_RIGHT ? O_DIRT2_DIGGING_RIGHT  :
+               dir == GD_MV_UP    ? O_DIRT2_DIGGING_UP     :
+               dir == GD_MV_DOWN  ? O_DIRT2_DIGGING_DOWN   : O_DIRT2));
+
+    case O_DIRT_GLUED:
+      return (crumbled ? O_DIRT_GLUED_CRUMBLED : O_DIRT_GLUED);
+
+    case O_BITER_SWITCH_1:
+      return (crumbled ? O_BITER_SWITCH_1_CRUMBLED : O_BITER_SWITCH_1);
+
+    case O_BITER_SWITCH_2:
+      return (crumbled ? O_BITER_SWITCH_2_CRUMBLED : O_BITER_SWITCH_2);
+
+    case O_BITER_SWITCH_3:
+      return (crumbled ? O_BITER_SWITCH_3_CRUMBLED : O_BITER_SWITCH_3);
+
+    case O_BITER_SWITCH_4:
+      return (crumbled ? O_BITER_SWITCH_4_CRUMBLED : O_BITER_SWITCH_4);
+
+    default:
+      break;
+  }
+
+  return element;
+}
+
 static void gd_drawcave_crumbled(Bitmap *dest, GdGame *game, int x, int y, boolean draw_masked)
 {
   void (*blit_bitmap)(Bitmap *, Bitmap *, int, int, int, int, int, int) =
@@ -562,18 +619,14 @@ static void gd_drawcave_crumbled(Bitmap *dest, GdGame *game, int x, int y, boole
   int sy = y * cell_size - scroll_y;
   int frame = game->animcycle;
   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);
-  int tile_gfx = (!is_moving_to ? O_DIRT :
-                  dir_to == GD_MV_LEFT  ? O_DIRT_DIGGING_LEFT  :
-                  dir_to == GD_MV_RIGHT ? O_DIRT_DIGGING_RIGHT :
-                  dir_to == GD_MV_UP    ? O_DIRT_DIGGING_UP    :
-                  dir_to == GD_MV_DOWN  ? O_DIRT_DIGGING_DOWN  : O_DIRT);
-  int tile_crm = (!is_moving_to ? O_DIRT_CRUMBLED :
-                  dir_to == GD_MV_LEFT  ? O_DIRT_DIGGING_LEFT_CRUMBLED  :
-                  dir_to == GD_MV_RIGHT ? O_DIRT_DIGGING_RIGHT_CRUMBLED :
-                  dir_to == GD_MV_UP    ? O_DIRT_DIGGING_UP_CRUMBLED    :
-                  dir_to == GD_MV_DOWN  ? O_DIRT_DIGGING_DOWN_CRUMBLED  : O_DIRT_CRUMBLED);
+  boolean is_diggable_last = el_diggable(draw_last);
+  int tile = (is_moving_to && is_diggable_last ? draw_last : draw);
+  int tile_gfx = get_dirt_element(tile, dir_to, FALSE);
+  int tile_crm = get_dirt_element(tile, dir_to, TRUE);
   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 };
@@ -592,19 +645,19 @@ static void gd_drawcave_crumbled(Bitmap *dest, GdGame *game, int x, int y, boole
     int dy = gd_dy[dir];
     int xx = (x + dx + cave->w) % cave->w;
     int yy = (y + dy + cave->h) % cave->h;
-    int tile = game->element_buffer[yy][xx];
-    int tile_last = game->last_element_buffer[yy][xx];
     int xoffset = (dx > 0 ? cell_size - border_size : 0);
     int yoffset = (dy > 0 ? cell_size - border_size : 0);
     int xsize = (dx == 0 ? cell_size : border_size);
     int ysize = (dy == 0 ? cell_size : border_size);
 
+    draw = game->drawing_buffer[yy][xx];
+    draw_last = game->last_drawing_buffer[yy][xx];
     dir_to = game->dir_buffer_to[yy][xx];
     is_moving_to = (dir_to != GD_MV_STILL);
 
     // do not crumble border if next tile is also crumbled or is just being digged away
-    boolean draw_normal = ((el_has_crumbled(tile)) ||
-                           (el_has_crumbled(tile_last) && is_moving_to));
+    boolean draw_normal = ((el_has_crumbled(draw)) ||
+                           (el_has_crumbled(draw_last) && is_moving_to));
 
     if (draw_normal)
       blit_bitmap(gfx->bitmap, dest, gfx->src_x + xoffset, gfx->src_y + yoffset,
@@ -767,7 +820,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
     int draw_back = (!is_moving_to ? draw : digging_tile ? draw_last : O_SPACE);
     struct GraphicInfo_BD *g = &graphic_info_bd_object[draw_back][frame];
 
-    if (el_has_crumbled(draw_last))
+    if (el_has_crumbled(draw_back))
     {
       gd_drawcave_crumbled(dest, game, x, y, draw_masked);
 
index 0382598e58eee61fa6995c2cf198407e26750cd4..1684a8e09715e27d131173bf8e573a048b9d95ee 100644 (file)
@@ -6212,6 +6212,42 @@ bd_object_mapping_list[] =
     O_DIRT2,                                   TRUE,
     EL_BDX_GRASS,                              -1, -1
   },
+  {
+    O_DIRT2_CRUMBLED,                          FALSE,
+    EL_BDX_GRASS,                              -1, -1
+  },
+  {
+    O_DIRT2_DIGGING_LEFT,                      FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_LEFT
+  },
+  {
+    O_DIRT2_DIGGING_RIGHT,                     FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_RIGHT
+  },
+  {
+    O_DIRT2_DIGGING_UP,                                FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_UP
+  },
+  {
+    O_DIRT2_DIGGING_DOWN,                      FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_DOWN
+  },
+  {
+    O_DIRT2_DIGGING_LEFT_CRUMBLED,             FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_LEFT
+  },
+  {
+    O_DIRT2_DIGGING_RIGHT_CRUMBLED,            FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_RIGHT
+  },
+  {
+    O_DIRT2_DIGGING_UP_CRUMBLED,                       FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_UP
+  },
+  {
+    O_DIRT2_DIGGING_DOWN_CRUMBLED,             FALSE,
+    EL_BDX_GRASS,                              ACTION_DIGGING, MV_BIT_DOWN
+  },
   {
     O_BRICK,                                   TRUE,
     EL_BDX_WALL,                               -1, -1
@@ -6480,6 +6516,10 @@ bd_object_mapping_list[] =
     O_DIRT_GLUED,                              TRUE,
     EL_BDX_SAND_GLUED,                         -1, -1
   },
+  {
+    O_DIRT_GLUED_CRUMBLED,                     FALSE,
+    EL_BDX_SAND_GLUED,                         -1, -1
+  },
   {
     O_KEY_1,                                   TRUE,
     EL_BDX_KEY_1,                              -1, -1
@@ -7946,6 +7986,22 @@ bd_object_mapping_list[] =
     O_BITER_SWITCH_4,                          FALSE,
     EL_BDX_BITER_SWITCH_4,                     -1, -1
   },
+  {
+    O_BITER_SWITCH_1_CRUMBLED,                 FALSE,
+    EL_BDX_BITER_SWITCH_1,                     -1, -1
+  },
+  {
+    O_BITER_SWITCH_2_CRUMBLED,                 FALSE,
+    EL_BDX_BITER_SWITCH_2,                     -1, -1
+  },
+  {
+    O_BITER_SWITCH_3_CRUMBLED,                 FALSE,
+    EL_BDX_BITER_SWITCH_3,                     -1, -1
+  },
+  {
+    O_BITER_SWITCH_4_CRUMBLED,                 FALSE,
+    EL_BDX_BITER_SWITCH_4,                     -1, -1
+  },
   {
     O_STONE_MOVE_LEFT,                         FALSE,
     EL_BDX_ROCK,                               ACTION_MOVING, MV_BIT_LEFT
@@ -11160,12 +11216,22 @@ void InitGraphicInfo_BD(void)
     {
       int effective_element = element;
       int effective_action = action;
-      int graphic = (i == O_DIRT_CRUMBLED ?
+      int graphic = (i == O_DIRT_CRUMBLED           ||
+                     i == O_DIRT2_CRUMBLED          ||
+                     i == O_DIRT_GLUED_CRUMBLED     ||
+                     i == O_BITER_SWITCH_1_CRUMBLED ||
+                     i == O_BITER_SWITCH_2_CRUMBLED ||
+                     i == O_BITER_SWITCH_3_CRUMBLED ||
+                     i == O_BITER_SWITCH_4_CRUMBLED ?
                      graphic = el_act2crm(effective_element, effective_action) :
-                     i == O_DIRT_DIGGING_LEFT_CRUMBLED  ||
-                     i == O_DIRT_DIGGING_RIGHT_CRUMBLED ||
-                     i == O_DIRT_DIGGING_UP_CRUMBLED    ||
-                     i == O_DIRT_DIGGING_DOWN_CRUMBLED ?
+                     i == O_DIRT_DIGGING_LEFT_CRUMBLED   ||
+                     i == O_DIRT_DIGGING_RIGHT_CRUMBLED  ||
+                     i == O_DIRT_DIGGING_UP_CRUMBLED     ||
+                     i == O_DIRT_DIGGING_DOWN_CRUMBLED   ||
+                     i == O_DIRT2_DIGGING_LEFT_CRUMBLED  ||
+                     i == O_DIRT2_DIGGING_RIGHT_CRUMBLED ||
+                     i == O_DIRT2_DIGGING_UP_CRUMBLED    ||
+                     i == O_DIRT2_DIGGING_DOWN_CRUMBLED ?
                      graphic = el_act_dir2crm(effective_element, effective_action, direction) :
                      direction == MV_NONE ?
                      el_act2img(effective_element, effective_action) :
@@ -11187,14 +11253,22 @@ void InitGraphicInfo_BD(void)
                        BD_GFX_RANGE(O_NITRO_EXPL_1, 4, e)    ? BD_GFX_FRAME(O_NITRO_EXPL_1, e) :
                        BD_GFX_RANGE(O_AMOEBA_2_EXPL_1, 4, e) ? BD_GFX_FRAME(O_AMOEBA_2_EXPL_1, e):
                        e == O_INBOX_OPEN || e == O_OUTBOX_OPEN ? j :
-                       e == O_DIRT_DIGGING_LEFT           ||
-                       e == O_DIRT_DIGGING_RIGHT          ||
-                       e == O_DIRT_DIGGING_UP             ||
-                       e == O_DIRT_DIGGING_DOWN           ||
-                       e == O_DIRT_DIGGING_LEFT_CRUMBLED  ||
-                       e == O_DIRT_DIGGING_RIGHT_CRUMBLED ||
-                       e == O_DIRT_DIGGING_UP_CRUMBLED    ||
-                       e == O_DIRT_DIGGING_DOWN_CRUMBLED ? j * 2 % 8:
+                       e == O_DIRT_DIGGING_LEFT            ||
+                       e == O_DIRT_DIGGING_RIGHT           ||
+                       e == O_DIRT_DIGGING_UP              ||
+                       e == O_DIRT_DIGGING_DOWN            ||
+                       e == O_DIRT_DIGGING_LEFT_CRUMBLED   ||
+                       e == O_DIRT_DIGGING_RIGHT_CRUMBLED  ||
+                       e == O_DIRT_DIGGING_UP_CRUMBLED     ||
+                       e == O_DIRT_DIGGING_DOWN_CRUMBLED   ||
+                       e == O_DIRT2_DIGGING_LEFT           ||
+                       e == O_DIRT2_DIGGING_RIGHT          ||
+                       e == O_DIRT2_DIGGING_UP             ||
+                       e == O_DIRT2_DIGGING_DOWN           ||
+                       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:
                        j * 2);
       int frame = getAnimationFrame(g->anim_frames,
                                    g->anim_delay,