rnd-20021118-1-src
[rocksndiamonds.git] / src / tools.c
index fed92762a5c67701cefcf9d6da900ee2d97e729a..fa883f4ca3be24822e9c4731c140850a4d23d49e 100644 (file)
@@ -700,18 +700,23 @@ void DrawPlayer(struct PlayerInfo *player)
 
   if (player_is_moving && last_element == EL_EXPLOSION)
   {
-    int frame = Frame[last_jx][last_jy];
-    int delay = 2;
+    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);
+    int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
+    int phase = Frame[last_jx][last_jy] - 1;
+    int frame = getGraphicAnimationFrame(graphic, phase - delay);
 
-    if (frame > 2)
-      DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), GFX_EXPLOSION,
-                         ((frame - 1) / delay - 1));
+    if (phase >= delay)
+      DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), graphic, frame);
   }
 
   /* draw elements that stay over the player */
   /* handle the field the player is leaving ... */
   if (player_is_moving && IS_OVER_PLAYER(last_element))
     DrawLevelField(last_jx, last_jy);
+
   /* ... and the field the player is entering */
   if (IS_OVER_PLAYER(element))
     DrawLevelField(jx, jy);
@@ -2839,7 +2844,6 @@ int el2gfx_OLD(int element)
     case EL_TUBE_RIGHT_UP:             return GFX_TUBE_RIGHT_UP;
     case EL_TUBE_RIGHT_DOWN:           return GFX_TUBE_RIGHT_DOWN;
     case EL_SPRING:                    return GFX_SPRING;
-    case EL_SPRING_MOVING:             return GFX_SPRING;
     case EL_TRAP:                      return GFX_TRAP_INACTIVE;
     case EL_TRAP_ACTIVE:               return GFX_TRAP_ACTIVE;
     case EL_BD_WALL:                   return GFX_BD_WALL;