added support for background image for initial loading screen
authorHolger Schemel <info@artsoft.org>
Tue, 15 Mar 2022 23:52:49 +0000 (00:52 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 15 Mar 2022 23:52:49 +0000 (00:52 +0100)
src/conf_gfx.c
src/init.c

index 3b39306a53007f4df03272fb227bd04cddd41765..8ba2e7f62ea8c85b9ad3d40e45fe73020f85c684 100644 (file)
@@ -7343,6 +7343,7 @@ struct ConfigInfo image_config[] =
   { "global.tile_cursor.frames",               "1"                     },
 
   { "background",                              UNDEFINED_FILENAME      },
+  { "background.LOADING_INITIAL",              UNDEFINED_FILENAME      },
   { "background.LOADING",                      UNDEFINED_FILENAME      },
   { "background.TITLE_INITIAL",                        UNDEFINED_FILENAME      },
   { "background.TITLE",                                UNDEFINED_FILENAME      },
index 041098f2665f427118e8e5a8bce1b539d17e50f2..2e250179934eeeefbf911a3343785c12ef5e7800 100644 (file)
 
 #define CONFIG_TOKEN_FONT_INITIAL              "font.initial"
 #define CONFIG_TOKEN_GLOBAL_BUSY               "global.busy"
+#define CONFIG_TOKEN_BACKGROUND_LOADING_INITIAL        "background.LOADING_INITIAL"
 #define CONFIG_TOKEN_BACKGROUND_LOADING                "background.LOADING"
 
 #define INITIAL_IMG_GLOBAL_BUSY                        0
-#define INITIAL_IMG_BACKGROUND_LOADING         1
+#define INITIAL_IMG_BACKGROUND_LOADING_INITIAL 1
+#define INITIAL_IMG_BACKGROUND_LOADING         2
 
-#define NUM_INITIAL_IMAGES                     2
+#define NUM_INITIAL_IMAGES                     3
 
 
 static struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS];
@@ -102,13 +104,16 @@ static int get_graphic_parameter_value(char *, char *, int);
 static void SetLoadingBackgroundImage(void)
 {
   struct GraphicInfo *graphic_info_last = graphic_info;
+  int background_image = (game_status_last_screen == -1 ?
+                         INITIAL_IMG_BACKGROUND_LOADING_INITIAL :
+                         INITIAL_IMG_BACKGROUND_LOADING);
 
   graphic_info = image_initial;
 
   SetDrawDeactivationMask(REDRAW_NONE);
   SetDrawBackgroundMask(REDRAW_ALL);
 
-  SetWindowBackgroundImage(INITIAL_IMG_BACKGROUND_LOADING);
+  SetWindowBackgroundImage(background_image);
 
   graphic_info = graphic_info_last;
 }
@@ -5567,6 +5572,7 @@ static void InitGfx(void)
   char *image_token[NUM_INITIAL_IMAGES] =
   {
     CONFIG_TOKEN_GLOBAL_BUSY,
+    CONFIG_TOKEN_BACKGROUND_LOADING_INITIAL,
     CONFIG_TOKEN_BACKGROUND_LOADING
   };
   Bitmap *bitmap_font_initial = NULL;