added showing optional title screen for native BD cavesets
authorHolger Schemel <info@artsoft.org>
Sat, 16 Mar 2024 11:59:54 +0000 (12:59 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 16 Mar 2024 12:01:24 +0000 (13:01 +0100)
src/screens.c

index aadbe74dcaf486c587c8fe59496d0f4b547695a5..0d7c6dd8079dae94976c2b85059b54430c2b8fb4 100644 (file)
@@ -1142,8 +1142,13 @@ static void InitializeTitleControls_CheckTitleInfo(boolean initial)
     int graphic = getTitleScreenGraphic(i, initial);
     Bitmap *bitmap = graphic_info[graphic].bitmap;
     int sort_priority = graphic_info[graphic].sort_priority;
+    boolean has_title_screen = (bitmap != NULL);
 
-    if (bitmap != NULL)
+    // check for optional title screen of native BD style level set
+    if (!has_title_screen && level.game_engine_type == GAME_ENGINE_TYPE_BD && !initial && i == 0)
+      has_title_screen = (GetTitleScreen_BD() != NULL);
+
+    if (has_title_screen)
       InitializeTitleControlsExt_AddTitleInfo(TRUE, initial, i, sort_priority);
   }
 
@@ -1605,6 +1610,20 @@ static void DrawTitleScreenImage(int nr, boolean initial)
   int src_y = graphic_info[graphic].src_y;
   int dst_x, dst_y;
 
+  // check for optional title screen of native BD style level set
+  if (bitmap == NULL && level.game_engine_type == GAME_ENGINE_TYPE_BD && !initial && nr == 0)
+  {
+    bitmap = GetTitleScreen_BD();
+
+    if (bitmap != NULL)
+    {
+      width  = bitmap->width;
+      height = bitmap->height;
+      src_x = 0;
+      src_y = 0;
+    }
+  }
+
   if (bitmap == NULL)
     return;