added pausing tape after replaying not only for warp mode
[rocksndiamonds.git] / src / game_mm / mm_game.c
index d4838873c978d51a4958a657ed11b76656315572..7b8a139b114fe8647bf23c6e37becc1af4c5b9d5 100644 (file)
@@ -537,7 +537,6 @@ static void InitCycleElements_RotateSingleStep(void)
 
     Tile[x][y] = next_element;
 
-    DrawField_MM(x, y);
     game_mm.cycle[i].steps -= step;
   }
 }
@@ -691,6 +690,11 @@ void InitGameActions_MM(void)
       cycle_steps_done++;
     }
 
+    AdvanceFrameCounter();
+    AdvanceGfxFrame();
+
+    DrawLevel_MM();
+
     BackToFront();
 
     ColorCycling();
@@ -1459,14 +1463,14 @@ boolean HitElement(int element, int hit_mask)
     LX += step_size * XS;
     LY += step_size * YS;
 
-#if 0
     // draw sparkles on mirror
-    if ((IS_MIRROR(element) || IS_MIRROR_FIXED(element)) &&
+    if ((IS_MIRROR(element) ||
+        IS_MIRROR_FIXED(element) ||
+        element == EL_PRISM) &&
        current_angle != laser.current_angle)
     {
-      MoveSprite(vp, &Pfeil[2], 4 + 16 * ELX, 5 + 16 * ELY + 1);
+      MovDelay[ELX][ELY] = 11;         // start animation
     }
-#endif
 
     if ((!IS_POLAR(element) && !IS_POLAR_CROSS(element)) &&
        current_angle != laser.current_angle)
@@ -2398,6 +2402,36 @@ static void GrowAmoeba(int x, int y)
   }
 }
 
+static void DrawFieldAnimated_MM(int x, int y)
+{
+  int element = Tile[x][y];
+
+  if (IS_BLOCKED(x, y))
+    return;
+
+  DrawField_MM(x, y);
+
+  if (IS_MIRROR(element) ||
+      IS_MIRROR_FIXED(element) ||
+      element == EL_PRISM)
+  {
+    if (MovDelay[x][y] != 0)   // wait some time before next frame
+    {
+      MovDelay[x][y]--;
+
+      if (MovDelay[x][y] != 0)
+      {
+       int graphic = IMG_TWINKLE_WHITE;
+       int frame = getGraphicAnimationFrame(graphic, 10 - MovDelay[x][y]);
+
+       DrawGraphicThruMask_MM(SCREENX(x), SCREENY(y), graphic, frame);
+      }
+    }
+  }
+
+  laser.redraw = TRUE;
+}
+
 static void Explode_MM(int x, int y, int phase, int mode)
 {
   int num_phase = 9, delay = 2;
@@ -3084,6 +3118,8 @@ static void GameActions_MM_Ext(void)
       MeltIce(x, y);
     else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA)
       GrowAmoeba(x, y);
+    else
+      DrawFieldAnimated_MM(x, y);
   }
 
   AutoRotateMirrors();