rnd-20061230-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 30 Dec 2006 10:15:19 +0000 (11:15 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:53:54 +0000 (10:53 +0200)
22 files changed:
src/conf_g2m.c
src/conf_g2s.c
src/conf_gfx.c
src/conf_gfx.h
src/conf_mus.c
src/conf_mus.h
src/conf_snd.c
src/conf_snd.h
src/conftime.h
src/editor.c
src/init.c
src/libgame/setup.c
src/libgame/setup.h
src/libgame/system.c
src/libgame/system.h
src/libgame/text.c
src/libgame/text.h
src/main.c
src/main.h
src/screens.c
src/tools.c
src/tools.h

index 1be3ed4fd7f81d8f406bb08c7d3907075839c394..447025c1b8d548efcdb6e0ebac6e0b72d6099032 100644 (file)
@@ -34,6 +34,10 @@ gamemode_to_music[] =
     GFX_SPECIAL_ARG_TITLE,
     MUS_BACKGROUND_TITLE
   },
+  {
+    GFX_SPECIAL_ARG_MESSAGE,
+    MUS_BACKGROUND_MESSAGE
+  },
   {
     GFX_SPECIAL_ARG_MAIN,
     MUS_BACKGROUND_MAIN
index 059f81187b79139cc768e555ec005f9203adab0d..b4c9ff8f81375f32217f1c2d25d73d6a77041dcc 100644 (file)
@@ -30,6 +30,10 @@ gamemode_to_sound[] =
     GFX_SPECIAL_ARG_TITLE,
     SND_BACKGROUND_TITLE
   },
+  {
+    GFX_SPECIAL_ARG_MESSAGE,
+    SND_BACKGROUND_MESSAGE
+  },
   {
     GFX_SPECIAL_ARG_MAIN,
     SND_BACKGROUND_MAIN
index 5f6583f9383d7b0d070333740c997456038ea5b6..6a8faeec72483d27c57c6835efd449ff527388c7 100644 (file)
@@ -4502,6 +4502,7 @@ struct ConfigInfo image_config[] =
 
   { "background",                              UNDEFINED_FILENAME      },
   { "background.TITLE",                                UNDEFINED_FILENAME      },
+  { "background.MESSAGE",                      UNDEFINED_FILENAME      },
   { "background.MAIN",                         UNDEFINED_FILENAME      },
   { "background.LEVELS",                       UNDEFINED_FILENAME      },
   { "background.SCORES",                       UNDEFINED_FILENAME      },
index e0d76b64b4528caa564943fa8cf15eecef17ab7a..f5c777a3a1f1222cb40f9756830b0d64f0886f87 100644 (file)
 #define IMG_BACKGROUND_ENVELOPE_4                      1545
 #define IMG_BACKGROUND                                 1546
 #define IMG_BACKGROUND_TITLE                           1547
-#define IMG_BACKGROUND_MAIN                            1548
-#define IMG_BACKGROUND_LEVELS                          1549
-#define IMG_BACKGROUND_SCORES                          1550
-#define IMG_BACKGROUND_EDITOR                          1551
-#define IMG_BACKGROUND_INFO                            1552
-#define IMG_BACKGROUND_INFO_ELEMENTS                   1553
-#define IMG_BACKGROUND_INFO_MUSIC                      1554
-#define IMG_BACKGROUND_INFO_CREDITS                    1555
-#define IMG_BACKGROUND_INFO_PROGRAM                    1556
-#define IMG_BACKGROUND_INFO_LEVELSET                   1557
-#define IMG_BACKGROUND_SETUP                           1558
-#define IMG_BACKGROUND_DOOR                            1559
-#define IMG_TITLESCREEN_INITIAL_1                      1560
-#define IMG_TITLESCREEN_INITIAL_2                      1561
-#define IMG_TITLESCREEN_INITIAL_3                      1562
-#define IMG_TITLESCREEN_INITIAL_4                      1563
-#define IMG_TITLESCREEN_INITIAL_5                      1564
-#define IMG_TITLESCREEN_1                              1565
-#define IMG_TITLESCREEN_2                              1566
-#define IMG_TITLESCREEN_3                              1567
-#define IMG_TITLESCREEN_4                              1568
-#define IMG_TITLESCREEN_5                              1569
+#define IMG_BACKGROUND_MESSAGE                         1548
+#define IMG_BACKGROUND_MAIN                            1549
+#define IMG_BACKGROUND_LEVELS                          1550
+#define IMG_BACKGROUND_SCORES                          1551
+#define IMG_BACKGROUND_EDITOR                          1552
+#define IMG_BACKGROUND_INFO                            1553
+#define IMG_BACKGROUND_INFO_ELEMENTS                   1554
+#define IMG_BACKGROUND_INFO_MUSIC                      1555
+#define IMG_BACKGROUND_INFO_CREDITS                    1556
+#define IMG_BACKGROUND_INFO_PROGRAM                    1557
+#define IMG_BACKGROUND_INFO_LEVELSET                   1558
+#define IMG_BACKGROUND_SETUP                           1559
+#define IMG_BACKGROUND_DOOR                            1560
+#define IMG_TITLESCREEN_INITIAL_1                      1561
+#define IMG_TITLESCREEN_INITIAL_2                      1562
+#define IMG_TITLESCREEN_INITIAL_3                      1563
+#define IMG_TITLESCREEN_INITIAL_4                      1564
+#define IMG_TITLESCREEN_INITIAL_5                      1565
+#define IMG_TITLESCREEN_1                              1566
+#define IMG_TITLESCREEN_2                              1567
+#define IMG_TITLESCREEN_3                              1568
+#define IMG_TITLESCREEN_4                              1569
+#define IMG_TITLESCREEN_5                              1570
 
-#define NUM_IMAGE_FILES                                        1570
+#define NUM_IMAGE_FILES                                        1571
 
 #endif /* CONF_GFX_H */
index 834041710a3d668791229dff8709b49df573681d..2d2cd8a9473bedb7045476eb28c4f2d437173103 100644 (file)
@@ -30,6 +30,7 @@ struct ConfigInfo music_config[] =
 {
   { "background",                      UNDEFINED_FILENAME              },
   { "background.TITLE",                        UNDEFINED_FILENAME              },
+  { "background.MESSAGE",              UNDEFINED_FILENAME              },
   { "background.MAIN",                 UNDEFINED_FILENAME              },
   { "background.LEVELS",               UNDEFINED_FILENAME              },
   { "background.SCORES",               UNDEFINED_FILENAME              },
index 8fce300ce5f487f16710803d225bf67384a33ff8..6c7f9352596cc7776e275cb5f8f5b3d4632b26ba 100644 (file)
 
 #define MUS_BACKGROUND                                 0
 #define MUS_BACKGROUND_TITLE                           1
-#define MUS_BACKGROUND_MAIN                            2
-#define MUS_BACKGROUND_LEVELS                          3
-#define MUS_BACKGROUND_SCORES                          4
-#define MUS_BACKGROUND_EDITOR                          5
-#define MUS_BACKGROUND_INFO                            6
-#define MUS_BACKGROUND_SETUP                           7
+#define MUS_BACKGROUND_MESSAGE                         2
+#define MUS_BACKGROUND_MAIN                            3
+#define MUS_BACKGROUND_LEVELS                          4
+#define MUS_BACKGROUND_SCORES                          5
+#define MUS_BACKGROUND_EDITOR                          6
+#define MUS_BACKGROUND_INFO                            7
+#define MUS_BACKGROUND_SETUP                           8
 
-#define NUM_MUSIC_FILES                                        8
+#define NUM_MUSIC_FILES                                        9
 
 #endif /* CONF_MUS_H */
index c18925af126be3d614e11fec29757542a4adcbef..01696a0feb4d94a7acba3344b39b141bb78f59cb 100644 (file)
@@ -245,6 +245,7 @@ struct ConfigInfo sound_config[] =
   { "menu.item.selecting",             "base.wav"                      },
 
   { "background.TITLE",                        UNDEFINED_FILENAME              },
+  { "background.MESSAGE",              UNDEFINED_FILENAME              },
   { "background.MAIN",                 UNDEFINED_FILENAME              },
   { "background.LEVELS",               UNDEFINED_FILENAME              },
   { "background.SCORES",               "halloffame.wav"                },
index 015e3ebab192bdbec967f727aad6568ab07ae6ec..164c2a916c777c2f5ba1f22a86240a0c152851b7 100644 (file)
 #define SND_MENU_ITEM_ACTIVATING                       182
 #define SND_MENU_ITEM_SELECTING                                183
 #define SND_BACKGROUND_TITLE                           184
-#define SND_BACKGROUND_MAIN                            185
-#define SND_BACKGROUND_LEVELS                          186
-#define SND_BACKGROUND_SCORES                          187
-#define SND_BACKGROUND_EDITOR                          188
-#define SND_BACKGROUND_INFO                            189
-#define SND_BACKGROUND_SETUP                           190
+#define SND_BACKGROUND_MESSAGE                         185
+#define SND_BACKGROUND_MAIN                            186
+#define SND_BACKGROUND_LEVELS                          187
+#define SND_BACKGROUND_SCORES                          188
+#define SND_BACKGROUND_EDITOR                          189
+#define SND_BACKGROUND_INFO                            190
+#define SND_BACKGROUND_SETUP                           191
 
-#define NUM_SOUND_FILES                                        191
+#define NUM_SOUND_FILES                                        192
 
 #endif /* CONF_SND_H */
index b269d2abc9bfb5aa8121118430d1121264d94464..3fa4c873e132bc04053fa01b45d88050b20a5e28 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-12-16 14:05]"
+#define COMPILE_DATE_STRING "[2006-12-28 03:16]"
index 69c63d208d74d0668fde7a200d8e3e86c6557b4a..7ace5ece715702a16fdcfe7c503f8ad8f09312df 100644 (file)
@@ -7300,7 +7300,7 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line)
   int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
 
   return DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
-                         max_lines_per_screen);
+                         max_lines_per_screen, TRUE);
 }
 
 static void DrawPropertiesTabulatorGadgets()
index 8da4aaf2298c3712369084d5f6c529aff8dede30..ba94035e224cd3963a6fa907fa1a0172cac7ce00 100644 (file)
@@ -167,7 +167,7 @@ static int getFontBitmapID(int font_nr)
 {
   int special = -1;
 
-  if (game_status >= GAME_MODE_MAIN && game_status <= GAME_MODE_PSEUDO_PREVIEW)
+  if (game_status >= GAME_MODE_TITLE && game_status <= GAME_MODE_PSEUDO_PREVIEW)
     special = game_status;
   else if (game_status == GAME_MODE_PSEUDO_TYPENAME)
     special = GFX_SPECIAL_ARG_MAIN;
@@ -1235,6 +1235,7 @@ static void InitGraphicInfo()
 
     IMG_BACKGROUND,
     IMG_BACKGROUND_TITLE,
+    IMG_BACKGROUND_MESSAGE,
     IMG_BACKGROUND_MAIN,
     IMG_BACKGROUND_LEVELS,
     IMG_BACKGROUND_SCORES,
index b116457e575d5df7addfa73e9571b0027c985395..9df2b53ec2ffe04eadbaafddcdd9634efd2074d6 100644 (file)
@@ -497,6 +497,35 @@ char *getLevelSetInfoFilename()
   return NULL;
 }
 
+char *getLevelSetMessageFilename()
+{
+  static char *filename = NULL;
+  char *basenames[] =
+  {
+    "MESSAGE",
+    "MESSAGE.TXT",
+    "MESSAGE.txt",
+    "Message",
+    "Message.txt",
+    "message",
+    "message.txt",
+
+    NULL
+  };
+  int i;
+
+  for (i = 0; basenames[i] != NULL; i++)
+  {
+    checked_free(filename);
+    filename = getPath2(getCurrentLevelDir(), basenames[i]);
+
+    if (fileExists(filename))
+      return filename;
+  }
+
+  return NULL;
+}
+
 static char *getCorrectedArtworkBasename(char *basename)
 {
   char *basename_corrected = basename;
index 55440806ab4592f26d810f9bf261a30bf3c9374e..6dc15e9cdf4c767d54058745fa7e819d8695598a 100644 (file)
@@ -230,6 +230,7 @@ char *getEditorSetupFilename(void);
 char *getHelpAnimFilename(void);
 char *getHelpTextFilename(void);
 char *getLevelSetInfoFilename(void);
+char *getLevelSetMessageFilename(void);
 char *getImageFilename(char *);
 char *getCustomImageFilename(char *);
 char *getCustomSoundFilename(char *);
index 5ccb5eb71257414f36e6dba3ae7d1a6682fcbdde..7d0099f4af002628d2024ffcee250b18f2942240 100644 (file)
@@ -245,7 +245,10 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
   if (background_bitmap_tile == NULL)  /* empty background requested */
     return;
 
-  if (mask == REDRAW_FIELD)
+  if (mask == REDRAW_ALL)
+    DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
+                      0, 0, video.width, video.height);
+  else if (mask == REDRAW_FIELD)
     DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
                       gfx.real_sx, gfx.real_sy,
                       gfx.full_sxsize, gfx.full_sysize);
@@ -257,13 +260,20 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
   }
 }
 
+void SetWindowBackgroundBitmap(Bitmap *background_bitmap_tile)
+{
+  SetBackgroundBitmap(background_bitmap_tile, REDRAW_ALL);
+}
+
 void SetMainBackgroundBitmap(Bitmap *background_bitmap_tile)
 {
+  SetBackgroundBitmap(NULL, REDRAW_ALL);       /* !!! FIX THIS !!! */
   SetBackgroundBitmap(background_bitmap_tile, REDRAW_FIELD);
 }
 
 void SetDoorBackgroundBitmap(Bitmap *background_bitmap_tile)
 {
+  SetBackgroundBitmap(NULL, REDRAW_ALL);       /* !!! FIX THIS !!! */
   SetBackgroundBitmap(background_bitmap_tile, REDRAW_DOOR_1);
 }
 
index 5d80bff569438af43135976481d66b3df2193b7b..2d10c7b16b8d483718c1735883076c4a85c0e1f6 100644 (file)
@@ -1059,6 +1059,7 @@ void InitGfxDoor2Info(int, int, int, int);
 void InitGfxScrollbufferInfo(int, int);
 void SetDrawDeactivationMask(int);
 void SetDrawBackgroundMask(int);
+void SetWindowBackgroundBitmap(Bitmap *);
 void SetMainBackgroundBitmap(Bitmap *);
 void SetDoorBackgroundBitmap(Bitmap *);
 
index 01689a73a5e85f9cef2a424f00157076185a0c18..83be1dfc0213e972569fa708731c121dd8458bbb 100644 (file)
@@ -156,12 +156,12 @@ int getTextWidth(char *text, int font_nr)
   return (text != NULL ? strlen(text) * getFontWidth(font_nr) : 0);
 }
 
-static char getFontCharPosition(int font_nr, char c)
+static int getFontCharPosition(int font_nr, char c)
 {
   int font_bitmap_id = gfx.select_font_function(font_nr);
   struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
   boolean default_font = (font->num_chars == DEFAULT_NUM_CHARS_PER_FONT);
-  int font_pos = c - 32;
+  int font_pos = (unsigned char)c - 32;
 
   /* map some special characters to their ascii values in default font */
   if (default_font)
@@ -309,7 +309,7 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text,
     char c = *text_ptr++;
 
     if (c == '\n')
-      c = ' ';         /* print space instaed of newline */
+      c = ' ';         /* print space instead of newline */
 
     getFontCharSource(font_nr, c, &src_bitmap, &src_x, &src_y);
 
@@ -523,7 +523,7 @@ void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length,
 }
 
 int DrawTextFromFile(int x, int y, char *filename, int font_nr,
-                    int line_length, int max_lines)
+                    int line_length, int max_lines, boolean rewrap)
 {
   int font_height = getFontHeight(font_nr);
   char line[MAX_LINE_LEN];
@@ -574,10 +574,41 @@ int DrawTextFromFile(int x, int y, char *filename, int font_nr,
 
     while (*line_ptr && current_line < max_lines)
     {
+#if 1
+      boolean buffer_filled;
+
+      if (rewrap)
+      {
+       buffer_filled = RenderLineToBuffer(&line_ptr,
+                                          buffer, &buffer_len,
+                                          last_line_was_empty,
+                                          line_length);
+      }
+      else
+      {
+       if (strlen(line_ptr) <= line_length)
+       {
+         buffer_len = strlen(line_ptr);
+         strcpy(buffer, line_ptr);
+       }
+       else
+       {
+         buffer_len = line_length;
+         strncpy(buffer, line_ptr, line_length);
+       }
+
+       buffer[buffer_len] = '\0';
+       line_ptr += buffer_len;
+
+       buffer_filled = TRUE;
+      }
+#else
       boolean buffer_filled = RenderLineToBuffer(&line_ptr,
                                                 buffer, &buffer_len,
                                                 last_line_was_empty,
                                                 line_length);
+#endif
+
       if (buffer_filled)
       {
        DrawText(x, y + current_line * font_height, buffer, font_nr);
index b518c562370ba54b0e3c41e3dacbdd9e3bade0d9..f21ffdbf755d760a414510c29962dadd7498209c 100644 (file)
@@ -75,6 +75,6 @@ void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
 void DrawTextToTextArea(int, int, char *, int, int, int, int, int);
 boolean RenderLineToBuffer(char **, char *, int *, boolean, int);
 void DrawTextWrapped(int, int, char *, int, int, int);
-int DrawTextFromFile(int, int, char *, int, int, int);
+int DrawTextFromFile(int, int, char *, int, int, int, boolean);
 
 #endif /* TEXT_H */
index 148abb546b7c802d5897b916fd479d41d49b6d1c..3b1eb05e423faa922287e0582bb2702c91e12e88 100644 (file)
@@ -4620,6 +4620,7 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
 {
   { ".[DEFAULT]",      GFX_SPECIAL_ARG_DEFAULT,        },
   { ".TITLE",          GFX_SPECIAL_ARG_TITLE,          },
+  { ".MESSAGE",                GFX_SPECIAL_ARG_MESSAGE,        },
   { ".MAIN",           GFX_SPECIAL_ARG_MAIN,           },
   { ".LEVELS",         GFX_SPECIAL_ARG_LEVELS          },
   { ".SCORES",         GFX_SPECIAL_ARG_SCORES,         },
index 5e5196786e3e90534d9a13e7c3b35d823f9a4ce7..b8430daa574113dcf4d8f24f8836c90b33e04e55 100644 (file)
 /* values for special image configuration suffixes (must match game mode) */
 #define GFX_SPECIAL_ARG_DEFAULT                0
 #define GFX_SPECIAL_ARG_TITLE          1
-#define GFX_SPECIAL_ARG_MAIN           2
-#define GFX_SPECIAL_ARG_LEVELS         3
-#define GFX_SPECIAL_ARG_SCORES         4
-#define GFX_SPECIAL_ARG_EDITOR         5
-#define GFX_SPECIAL_ARG_INFO           6
-#define GFX_SPECIAL_ARG_SETUP          7
-#define GFX_SPECIAL_ARG_PLAYING                8
-#define GFX_SPECIAL_ARG_DOOR           9
-#define GFX_SPECIAL_ARG_PREVIEW                10
-#define GFX_SPECIAL_ARG_CRUMBLED       11
-
-#define NUM_SPECIAL_GFX_ARGS           12
+#define GFX_SPECIAL_ARG_MESSAGE                2
+#define GFX_SPECIAL_ARG_MAIN           3
+#define GFX_SPECIAL_ARG_LEVELS         4
+#define GFX_SPECIAL_ARG_SCORES         5
+#define GFX_SPECIAL_ARG_EDITOR         6
+#define GFX_SPECIAL_ARG_INFO           7
+#define GFX_SPECIAL_ARG_SETUP          8
+#define GFX_SPECIAL_ARG_PLAYING                9
+#define GFX_SPECIAL_ARG_DOOR           10
+#define GFX_SPECIAL_ARG_PREVIEW                11
+#define GFX_SPECIAL_ARG_CRUMBLED       12
+
+#define NUM_SPECIAL_GFX_ARGS           13
 
 /* these additional definitions are currently only used for draw offsets */
 #define GFX_SPECIAL_ARG_INFO_MAIN      0
 /* values for game_status (must match special image configuration suffixes) */
 #define GAME_MODE_DEFAULT              0
 #define GAME_MODE_TITLE                        1
-#define GAME_MODE_MAIN                 2
-#define GAME_MODE_LEVELS               3
-#define GAME_MODE_SCORES               4
-#define GAME_MODE_EDITOR               5
-#define GAME_MODE_INFO                 6
-#define GAME_MODE_SETUP                        7
-#define GAME_MODE_PLAYING              8
-#define GAME_MODE_PSEUDO_DOOR          9
-#define GAME_MODE_PSEUDO_PREVIEW       10
-#define GAME_MODE_PSEUDO_CRUMBLED      11
+#define GAME_MODE_MESSAGE              2
+#define GAME_MODE_MAIN                 3
+#define GAME_MODE_LEVELS               4
+#define GAME_MODE_SCORES               5
+#define GAME_MODE_EDITOR               6
+#define GAME_MODE_INFO                 7
+#define GAME_MODE_SETUP                        8
+#define GAME_MODE_PLAYING              9
+#define GAME_MODE_PSEUDO_DOOR          10
+#define GAME_MODE_PSEUDO_PREVIEW       11
+#define GAME_MODE_PSEUDO_CRUMBLED      12
 
 /* there are no special config file suffixes for these modes */
-#define GAME_MODE_PSEUDO_TYPENAME      12
-#define GAME_MODE_QUIT                 13
+#define GAME_MODE_PSEUDO_TYPENAME      13
+#define GAME_MODE_QUIT                 14
 
 /* special definitions currently only used for custom artwork configuration */
 #define MUSIC_PREFIX_BACKGROUND                0
index a10615890ecf57ede3ee3068ad614a229e34d5fb..c78cfd13bda9f9a3cf12372cea87f4ba3687e84f 100644 (file)
@@ -709,6 +709,41 @@ void DrawTitleScreenImage(int nr)
     title.auto_delay_final = graphic_info[graphic].auto_delay;
 }
 
+void DrawTitleScreenMessage(char *filename)
+{
+  int font_nr = FONT_TEXT_1;
+  int font_width;
+  int font_height;
+  int pad_x = 16;
+  int pad_y = 32;
+  int sx = pad_x;
+  int sy = pad_y;
+  int max_chars_per_line;
+  int max_lines_per_screen;
+  int last_game_status = game_status;  /* save current game status */
+
+  if (filename == NULL)
+    return;
+
+  SetDrawBackgroundMask(REDRAW_ALL);
+  SetWindowBackgroundImageIfDefined(IMG_BACKGROUND_MESSAGE);
+
+  ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
+
+  /* force MESSAGE font on title message screen */
+  game_status = GAME_MODE_MESSAGE;
+
+  font_width = getFontWidth(font_nr);
+  font_height = getFontHeight(font_nr);
+  max_chars_per_line = (WIN_XSIZE - 2 * pad_x) / font_width;
+  max_lines_per_screen = (WIN_YSIZE - pad_y) / font_height - 1;
+
+  DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
+                  max_lines_per_screen, FALSE);
+
+  game_status = last_game_status;      /* restore current game status */
+}
+
 void DrawTitleScreen()
 {
   KeyboardAutoRepeatOff();
@@ -780,7 +815,8 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading)
 
   if (setup.show_titlescreen &&
       ((levelset_has_changed &&
-       graphic_info[IMG_TITLESCREEN_1].bitmap != NULL) ||
+       (graphic_info[IMG_TITLESCREEN_1].bitmap != NULL ||
+        getLevelSetMessageFilename() != NULL)) ||
        (show_titlescreen_initial &&
        graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap != NULL)))
   {
@@ -948,9 +984,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
 {
   static unsigned long title_delay = 0;
   static int title_nr = 0;
+  static boolean showing_message = FALSE;
+  char *filename = getLevelSetMessageFilename();
   boolean return_to_main_menu = FALSE;
   boolean use_fading_main_menu = TRUE;
   boolean use_cross_fading = !show_titlescreen_initial;                /* default */
+  boolean no_title_info = (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL &&
+                          filename == NULL);
 
   if (button == MB_MENU_INITIALIZE)
   {
@@ -958,6 +998,7 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
 
     title_delay = 0;
     title_nr = 0;
+    showing_message = FALSE;
 
     if (show_titlescreen_initial &&
        graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap == NULL)
@@ -965,7 +1006,7 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
 
     if (game_status == GAME_MODE_INFO)
     {
-      if (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
+      if (no_title_info)
       {
        DrawInfoScreen_NotAvailable("Title screen information:",
                                    "No title screen for this level set.");
@@ -988,7 +1029,20 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
 
     game_status = last_game_status;    /* restore current game status */
 
-    DrawTitleScreenImage(title_nr);
+    if (graphic_info[getTitleScreenGraphic()].bitmap != NULL)
+    {
+      DrawTitleScreenImage(title_nr);
+    }
+    else
+    {
+      DrawTitleScreenMessage(filename);
+
+      showing_message = TRUE;
+
+      title.fade_delay_final = title.fade_delay;
+      title.post_delay_final = title.post_delay;
+      title.auto_delay_final = -1;
+    }
 
     FadeIn(REDRAW_ALL);
 
@@ -1010,8 +1064,7 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
   {
     int anim_mode;
 
-    if (game_status == GAME_MODE_INFO &&
-       graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
+    if (game_status == GAME_MODE_INFO && no_title_info)
     {
       FadeOut(REDRAW_FIELD);
 
@@ -1056,6 +1109,22 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
 
       DelayReached(&title_delay, 0);   /* reset delay counter */
     }
+    else if (!showing_message && filename != NULL)
+    {
+      if (use_cross_fading)
+       FadeCrossSaveBackbuffer();
+
+      DrawTitleScreenMessage(filename);
+
+      if (use_cross_fading)
+       FadeCross(REDRAW_ALL);
+      else
+       FadeIn(REDRAW_ALL);
+
+      DelayReached(&title_delay, 0);   /* reset delay counter */
+
+      showing_message = TRUE;
+    }
     else
     {
       FadeSoundsAndMusic();
@@ -2407,7 +2476,7 @@ void DrawInfoScreen_LevelSet()
 
   if (filename != NULL)
     DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
-                    max_lines_per_screen);
+                    max_lines_per_screen, TRUE);
   else
     DrawTextSCentered(ystart, FONT_TEXT_2,
                      "No information for this level set.");
index a10f0dd247ef6ae1ad3f9c5415a0e2e4bd3d3888..e7670d2756048c6e5a0185160197c63f9171fe50 100644 (file)
@@ -242,7 +242,8 @@ void DrawMaskedBorder_ALL()
 void DrawMaskedBorder(int redraw_mask)
 {
   /* do not draw masked screen borders when displaying title screens */
-  if (effectiveGameStatus() == GAME_MODE_TITLE)
+  if (effectiveGameStatus() == GAME_MODE_TITLE ||
+      effectiveGameStatus() == GAME_MODE_MESSAGE)
     return;
 
   if (redraw_mask & REDRAW_ALL)
@@ -587,10 +588,16 @@ void FadeCrossSaveBackbuffer()
   BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
 }
 
+void SetWindowBackgroundImageIfDefined(int graphic)
+{
+  if (graphic_info[graphic].bitmap)
+    SetWindowBackgroundBitmap(graphic_info[graphic].bitmap);
+}
+
 void SetMainBackgroundImageIfDefined(int graphic)
 {
   if (graphic_info[graphic].bitmap)
-    SetMainBackgroundImage(graphic);
+    SetMainBackgroundBitmap(graphic_info[graphic].bitmap);
 }
 
 void SetMainBackgroundImage(int graphic)
index 12d49c994834a7664ca0a50c74c36de5f46773f1..1c26b6d6fdb771c10d4ba1060064e9a0e474c8ce 100644 (file)
@@ -80,6 +80,7 @@ void FadeCross(int);
 void FadeCrossSaveBackbuffer();
 
 void ClearWindow();
+void SetWindowBackgroundImageIfDefined(int);
 void SetMainBackgroundImageIfDefined(int);
 void SetMainBackgroundImage(int);
 void SetDoorBackgroundImage(int);