added new level option to only redraw off-screen player relocation
[rocksndiamonds.git] / src / game.c
index 8273cb71fb796e803a5481e96001a59ce560b30d..cea1b769be4fd43ad9ece0c2710720b63434caa9 100644 (file)
@@ -1949,7 +1949,7 @@ static void InitField(int x, int y, boolean init_game)
     CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X);
 }
 
-static inline void InitField_WithBug1(int x, int y, boolean init_game)
+inline static void InitField_WithBug1(int x, int y, boolean init_game)
 {
   InitField(x, y, init_game);
 
@@ -1959,7 +1959,7 @@ static inline void InitField_WithBug1(int x, int y, boolean init_game)
     InitMovDir(x, y);
 }
 
-static inline void InitField_WithBug2(int x, int y, boolean init_game)
+inline static void InitField_WithBug2(int x, int y, boolean init_game)
 {
   int old_element = Feld[x][y];
 
@@ -3091,9 +3091,10 @@ void InitGame()
   int initial_move_dir = MV_DOWN;
   int i, j, x, y;
 
-  game_status = GAME_MODE_PLAYING;
+  // required here to update video display before fading (FIX THIS)
+  DrawMaskedBorder(REDRAW_DOOR_2);
 
-  StopAnimation();
+  game_status = GAME_MODE_PLAYING;
 
   if (!game.restart_level)
     CloseDoor(DOOR_CLOSE_1);
@@ -3111,6 +3112,8 @@ void InitGame()
 
   FadeOut(fade_mask);
 
+  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
   ClearField();
 
   DrawCompleteVideoDisplay();
@@ -3925,6 +3928,8 @@ void InitGame()
   BlitScreenToBitmap(backbuffer);
   /* !!! FIX THIS (END) !!! */
 
+  DrawMaskedBorder(fade_mask);
+
   FadeIn(fade_mask);
 
 #if 1
@@ -4891,7 +4896,11 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir,
   int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay);
   int wait_delay_value = (no_delay ? 0 : frame_delay_value);
 
-  if (quick_relocation)
+  if (level.lazy_relocation && IN_VIS_FIELD(SCREENX(x), SCREENY(y)))
+  {
+    RedrawPlayfield();
+  }
+  else if (quick_relocation)
   {
     if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen)
     {
@@ -4970,7 +4979,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir,
       }
     }
 
-    RedrawPlayfield(TRUE, 0,0,0,0);
+    RedrawPlayfield();
   }
   else
   {
@@ -5012,7 +5021,6 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir,
                   offset_y - MIDPOSY);
     }
 
-
     ScrollScreen(NULL, SCROLL_GO_ON);  /* scroll last frame to full tile */
 
     while (scroll_x != scroll_xx || scroll_y != scroll_yy)