rnd-20030807-1-src
[rocksndiamonds.git] / src / tools.c
index 97853144b22e327fa06080fe9c3097fc6758e7f8..d37a7b0e991b821c3979602a3689758ccdf3504d 100644 (file)
@@ -504,6 +504,9 @@ inline void DrawLevelGraphicAnimationIfNeeded(int x, int y, int graphic)
     return;
 
   DrawGraphicAnimation(sx, sy, graphic);
+
+  if (CAN_BE_CRUMBLED(Feld[x][y]))
+    DrawLevelFieldCrumbledSand(x, y);
 }
 
 void DrawLevelElementAnimationIfNeeded(int x, int y, int element)
@@ -520,6 +523,9 @@ void DrawLevelElementAnimationIfNeeded(int x, int y, int element)
     return;
 
   DrawGraphicAnimation(sx, sy, graphic);
+
+  if (CAN_BE_CRUMBLED(element))
+    DrawLevelFieldCrumbledSand(x, y);
 }
 
 void DrawAllPlayers()
@@ -660,13 +666,14 @@ void DrawPlayer(struct PlayerInfo *player)
     if (player_is_moving && GfxElement[jx][jy] != EL_UNDEFINED)
     {
 #if 1
-      if (CAN_BE_CRUMBLED(GfxElement[jx][jy]))
+      /* !!! insert DrawLevelFieldCrumbledSandDigging code here !!! */
+      if (player->is_digging && CAN_BE_CRUMBLED(GfxElement[jx][jy]))
        DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
 #else
       if (GfxElement[jx][jy] == EL_SAND)
        DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
 #endif
-      else
+      else     /* player->is_collecting */
       {
        int old_element = GfxElement[jx][jy];
        int old_graphic = el_act_dir2img(old_element, action, move_dir);
@@ -1316,7 +1323,9 @@ void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction,
   int sx = SCREENX(x), sy = SCREENY(y);
 
   DrawGraphic(sx, sy, graphic1, frame1);
-  DrawLevelFieldCrumbledSandExt(x, y, graphic2, frame2);
+
+  if (graphic1 != IMG_EMPTY_SPACE)
+    DrawLevelFieldCrumbledSandExt(x, y, graphic2, frame2);
 }
 
 void DrawLevelFieldCrumbledSandNeighbours(int x, int y)