rnd-20030703-1-src
[rocksndiamonds.git] / src / tools.c
index f2f3cdd03859b746a9b97f774d6854db2c8d7a0c..974765111a020583fdfddb12566c784b84a37c0a 100644 (file)
@@ -600,6 +600,9 @@ void DrawPlayer(struct PlayerInfo *player)
 
     if (player->Pushing && IN_SCR_FIELD(SCREENX(next_jx), SCREENY(next_jy)))
     {
+#if 1
+      DrawLevelElement(next_jx, next_jy, EL_EMPTY);
+#else
       if (player->GfxPos)
       {
        if (Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL)
@@ -609,6 +612,7 @@ void DrawPlayer(struct PlayerInfo *player)
       }
       else
        DrawLevelField(next_jx, next_jy);
+#endif
     }
   }
 
@@ -700,14 +704,28 @@ void DrawPlayer(struct PlayerInfo *player)
   {
     int px = SCREENX(next_jx), py = SCREENY(next_jy);
 
+    if (Back[next_jx][next_jy])
+      DrawLevelElement(next_jx, next_jy, Back[next_jx][next_jy]);
+
+#if 1
+    if ((sxx || syy) && element == EL_SOKOBAN_OBJECT)
+      DrawGraphicShiftedThruMask(px, py, sxx, syy, IMG_SOKOBAN_OBJECT, 0,
+                                NO_CUTTING);
+#else
     if ((sxx || syy) &&
        (element == EL_SOKOBAN_FIELD_EMPTY ||
         Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL))
       DrawGraphicShiftedThruMask(px, py, sxx, syy, IMG_SOKOBAN_OBJECT, 0,
                                 NO_CUTTING);
+#endif
     else
     {
+#if 1
+      int element = Feld[jx][jy];
+#else
       int element = Feld[next_jx][next_jy];
+#endif
+
       int graphic = el2img(element);
       int frame = 0;
 
@@ -739,10 +757,14 @@ void DrawPlayer(struct PlayerInfo *player)
 
   if (player_is_moving && last_element == EL_EXPLOSION)
   {
+#if 1
+    int graphic = el_act2img(GfxElement[last_jx][last_jy], ACTION_EXPLODING);
+#else
     int stored = Store[last_jx][last_jy];
     int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
                   stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
                   IMG_SP_EXPLOSION);
+#endif
     int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
     int phase = ExplodePhase[last_jx][last_jy] - 1;
     int frame = getGraphicAnimationFrame(graphic, phase - delay);
@@ -1191,7 +1213,7 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
   element = (GfxElement[x][y] != EL_UNDEFINED ? GfxElement[x][y] : Feld[x][y]);
 
   /* crumble field itself */
-  if (CAN_BE_CRUMBLED(element))
+  if (CAN_BE_CRUMBLED(element) && !IS_MOVING(x, y))
   {
     if (!IN_SCR_FIELD(sx, sy))
       return;
@@ -1206,7 +1228,7 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
       element = (IN_LEV_FIELD(xx, yy) ? Feld[xx][yy] : EL_STEELWALL);
 
       /* check if neighbour field is of same type */
-      if (CAN_BE_CRUMBLED(element))
+      if (CAN_BE_CRUMBLED(element) && !IS_MOVING(xx, yy))
        continue;
 
       if (i == 1 || i == 2)
@@ -1243,7 +1265,8 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
 
       if (!IN_LEV_FIELD(xx, yy) ||
          !IN_SCR_FIELD(sxx, syy) ||
-         !CAN_BE_CRUMBLED(Feld[xx][yy]))
+         !CAN_BE_CRUMBLED(Feld[xx][yy]) ||
+         IS_MOVING(xx, yy))
        continue;
 
       if (i == 1 || i == 2)