moved code to draw content of score info screen to separate function
authorHolger Schemel <info@artsoft.org>
Thu, 24 Feb 2022 00:57:42 +0000 (01:57 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 24 Feb 2022 00:57:42 +0000 (01:57 +0100)
src/screens.c

index 8e95e47beb1e93aa44d6c024e330312f128cc88f..459fd00143a5e88e441f8af09d5d8ec71107249d 100644 (file)
@@ -5855,7 +5855,7 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
   HandleChooseTree(mx, my, dx, dy, button, &score_entry_current);
 }
 
-static void DrawScoreInfo(int entry_nr)
+static void DrawScoreInfo_Content(int entry_nr)
 {
   struct ScoreEntry *entry = &scores.entry[entry_nr];
   char *pos_text = getHallOfFameRankText(entry_nr);
@@ -5875,12 +5875,6 @@ static void DrawScoreInfo(int entry_nr)
   int xstart1 = mSX - SX + 2 * xstep;
   int xstart2 = mSX - SX + 14 * xstep;
 
-  SetMainBackgroundImageIfDefined(IMG_BACKGROUND_SCOREINFO);
-
-  UnmapAllGadgets();
-
-  FadeOut(REDRAW_FIELD);
-
   ClearField();
 
   drawChooseTreeHead(score_entries);
@@ -5926,6 +5920,17 @@ static void DrawScoreInfo(int entry_nr)
   }
 
   DrawTextSCentered(ybottom, font_foot, "Press any key or button to go back");
+}
+
+static void DrawScoreInfo(int entry_nr)
+{
+  SetMainBackgroundImageIfDefined(IMG_BACKGROUND_SCOREINFO);
+
+  UnmapAllGadgets();
+
+  FadeOut(REDRAW_FIELD);
+
+  DrawScoreInfo_Content(entry_nr);
 
   FadeIn(REDRAW_FIELD);
 }