rnd-20030703-1-src
[rocksndiamonds.git] / src / tools.c
index 369e0488f9c81eebd52549ea9b348267d1f036bb..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);