fixed errors with covering BD screen when not using BD engine
authorHolger Schemel <holger.schemel@virtion.de>
Mon, 6 Jan 2025 15:57:45 +0000 (16:57 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Mon, 6 Jan 2025 15:58:05 +0000 (16:58 +0100)
src/game.c
src/tools.c
src/tools.h

index 196e76173876bff18823ccaba0a3ebc7ded1b11e..99ddce52762b0b8c6299de65f047fba5fac8cec1 100644 (file)
@@ -5052,8 +5052,7 @@ static boolean AdvanceToNextLevel(void)
       scores.next_level_nr = level_nr;
 
       // cover screen before loading next level (which may have different size and color)
-      if (game_bd.cover_screen)
-        CoverScreen_BD();
+      CoverScreen();
 
       LoadLevel(level_nr);
 
index 51f3e11b1745e8057cb4487a54b8eb2dad5b666c..b1ae9055745dc1cec74fb54d22d6fc6a9438c31e 100644 (file)
@@ -999,6 +999,12 @@ static void SetScreenStates_AfterFadingOut(void)
     global.border_status = GAME_MODE_PLAYING;
 }
 
+void CoverScreen(void)
+{
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD && game_bd.cover_screen)
+    CoverScreen_BD();
+}
+
 void FadeIn(int fade_mask)
 {
   SetScreenStates_BeforeFadingIn();
@@ -1037,8 +1043,7 @@ void FadeOut(int fade_mask)
     BackToFront();
 
   // when using BD game engine, cover playfield before fading out after a game
-  if (game_bd.cover_screen)
-    CoverScreen_BD();
+  CoverScreen();
 
   SetScreenStates_BeforeFadingOut();
 
index a960946c977ae0f18cac6f929535aacc1ab99b4e..6b318627cbe5f51e0d6bc003447d8761ae3f62ee 100644 (file)
@@ -94,6 +94,8 @@ void BlitScreenToBitmap(Bitmap *);
 void BackToFront(void);
 void BackToFront_WithFrameDelay(unsigned int);
 
+void CoverScreen(void);
+
 void FadeIn(int);
 void FadeOut(int);
 void FadeSetEnterMenu(void);