added drawing global borders when fading screens
[rocksndiamonds.git] / src / init.c
index e7cbd04a43af6d10c3515e66e5300a32469dd393..943839edba5acecd02e708e51bce2e444158806a 100644 (file)
@@ -4666,7 +4666,8 @@ static void InitGlobal()
 
   global.frames_per_second = 0;
 
-  global.border_status = GAME_MODE_MAIN;
+  global.border_status = GAME_MODE_LOADING;
+  global.anim_status = global.anim_status_next = GAME_MODE_LOADING;
 
   global.use_envelope_request = FALSE;
 }
@@ -5322,7 +5323,11 @@ void InitGfx()
 
   InitGfxDrawBusyAnimFunction(DrawInitAnim);
   InitGfxDrawGlobalAnimFunction(DrawGlobalAnim);
-  InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToScreen);
+  InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);
+
+  gfx.fade_border_source_status = global.border_status;
+  gfx.fade_border_target_status = global.border_status;
+  gfx.masked_border_bitmap_ptr = backbuffer;
 
   /* use copy of busy animation to prevent change while reloading artwork */
   init_last = init;
@@ -5699,7 +5704,7 @@ void ReloadCustomArtwork(int force_reload)
 
   print_timestamp_init("ReloadCustomArtwork");
 
-  game_status = GAME_MODE_LOADING;
+  SetGameStatus(GAME_MODE_LOADING);
 
   FadeOut(REDRAW_ALL);
 
@@ -5734,7 +5739,7 @@ void ReloadCustomArtwork(int force_reload)
     print_timestamp_time("InitMusic");
   }
 
-  game_status = last_game_status;      /* restore current game status */
+  SetGameStatus(last_game_status);     /* restore current game status */
 
   init_last = init;                    /* switch to new busy animation */
 
@@ -5829,7 +5834,7 @@ void OpenAll()
 {
   print_timestamp_init("OpenAll");
 
-  game_status = GAME_MODE_LOADING;
+  SetGameStatus(GAME_MODE_LOADING);
 
   InitCounter();
 
@@ -5929,7 +5934,7 @@ void OpenAll()
     return;
   }
 
-  game_status = GAME_MODE_MAIN;
+  SetGameStatus(GAME_MODE_MAIN);
 
   FadeSetEnterScreen();
   if (!(fading.fade_mode & FADE_TYPE_TRANSFORM))