+static char *getInfoScreenTitle_Generic(void)
+{
+ return (info_mode == INFO_MODE_MAIN ? STR_INFO_MAIN :
+ info_mode == INFO_MODE_TITLE ? STR_INFO_TITLE :
+ info_mode == INFO_MODE_ELEMENTS ? STR_INFO_ELEMENTS :
+ info_mode == INFO_MODE_MUSIC ? STR_INFO_MUSIC :
+ info_mode == INFO_MODE_CREDITS ? STR_INFO_CREDITS :
+ info_mode == INFO_MODE_PROGRAM ? STR_INFO_PROGRAM :
+ info_mode == INFO_MODE_VERSION ? STR_INFO_VERSION :
+ info_mode == INFO_MODE_LEVELSET ? STR_INFO_LEVELSET :
+ "");
+}
+
+static int getInfoScreenBackgroundImage_Generic(void)
+{
+ return (info_mode == INFO_MODE_ELEMENTS ? IMG_BACKGROUND_INFO_ELEMENTS :
+ info_mode == INFO_MODE_MUSIC ? IMG_BACKGROUND_INFO_MUSIC :
+ info_mode == INFO_MODE_CREDITS ? IMG_BACKGROUND_INFO_CREDITS :
+ info_mode == INFO_MODE_PROGRAM ? IMG_BACKGROUND_INFO_PROGRAM :
+ info_mode == INFO_MODE_VERSION ? IMG_BACKGROUND_INFO_VERSION :
+ info_mode == INFO_MODE_LEVELSET ? IMG_BACKGROUND_INFO_LEVELSET :
+ IMG_BACKGROUND_INFO);
+}
+
+static int getInfoScreenBackgroundSound_Generic(void)
+{
+ return (info_mode == INFO_MODE_ELEMENTS ? SND_BACKGROUND_INFO_ELEMENTS :
+ info_mode == INFO_MODE_CREDITS ? SND_BACKGROUND_INFO_CREDITS :
+ info_mode == INFO_MODE_PROGRAM ? SND_BACKGROUND_INFO_PROGRAM :
+ info_mode == INFO_MODE_VERSION ? SND_BACKGROUND_INFO_VERSION :
+ info_mode == INFO_MODE_LEVELSET ? SND_BACKGROUND_INFO_LEVELSET :
+ SND_BACKGROUND_INFO);
+}
+
+static int getInfoScreenBackgroundMusic_Generic(void)
+{
+ return (info_mode == INFO_MODE_ELEMENTS ? MUS_BACKGROUND_INFO_ELEMENTS :
+ info_mode == INFO_MODE_CREDITS ? MUS_BACKGROUND_INFO_CREDITS :
+ info_mode == INFO_MODE_PROGRAM ? MUS_BACKGROUND_INFO_PROGRAM :
+ info_mode == INFO_MODE_VERSION ? MUS_BACKGROUND_INFO_VERSION :
+ info_mode == INFO_MODE_LEVELSET ? MUS_BACKGROUND_INFO_LEVELSET :
+ MUS_BACKGROUND_INFO);
+}
+
+static char *getInfoScreenFilename_Generic(int nr, boolean global)
+{
+ return (info_mode == INFO_MODE_CREDITS ? getCreditsFilename(nr, global) :
+ info_mode == INFO_MODE_PROGRAM ? getProgramInfoFilename(nr) :
+ info_mode == INFO_MODE_LEVELSET ? getLevelSetInfoFilename(nr) :
+ NULL);
+}
+
+static void DrawInfoScreen_GenericScreen(int screen_nr, int num_screens,
+ int use_global_screens)
+{
+ char *filename = getInfoScreenFilename_Generic(screen_nr, use_global_screens);
+ int font_text = MENU_INFO_FONT_TEXT;
+ int font_foot = MENU_INFO_FONT_FOOT;
+ int spacing_line = menu.line_spacing_info[info_mode];
+ int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
+
+ ClearField();
+
+ DrawInfoScreen_Headline(screen_nr, num_screens, use_global_screens);
+
+ if (info_mode == INFO_MODE_CREDITS ||
+ info_mode == INFO_MODE_PROGRAM)
+ {
+ int width = SXSIZE;
+ int height = MENU_SCREEN_INFO_YBOTTOM - MENU_SCREEN_INFO_YSTART;
+ int chars = width / getFontWidth(font_text);
+ int lines = height / getFontHeight(font_text);
+ int padx = (width - chars * getFontWidth(font_text)) / 2;
+ int line_spacing = getMenuTextSpacing(spacing_line, font_text);
+ int xstart = mSX + padx;
+ int ystart = mSY + MENU_SCREEN_INFO_YSTART + getHeadlineSpacing();
+ boolean autowrap = FALSE;
+ boolean centered = TRUE;
+ boolean parse_comments = TRUE;
+
+ DrawTextFile(xstart, ystart,
+ filename, font_text, chars, -1, lines, line_spacing, -1,
+ autowrap, centered, parse_comments);
+ }
+ else if (info_mode == INFO_MODE_LEVELSET)
+ {
+ struct TitleMessageInfo *tmi = &readme;
+
+ // if x position set to "-1", automatically determine by playfield width
+ if (tmi->x == -1)
+ tmi->x = SXSIZE / 2;
+
+ // if y position set to "-1", use static default value
+ if (tmi->y == -1)
+ tmi->y = MENU_SCREEN_INFO_YSTART + getHeadlineSpacing();
+
+ // if width set to "-1", automatically determine by playfield width
+ if (tmi->width == -1)
+ tmi->width = SXSIZE - 2 * TILEX;
+
+ // if height set to "-1", automatically determine by playfield height
+ if (tmi->height == -1)
+ tmi->height = MENU_SCREEN_INFO_YBOTTOM - tmi->y - 10;
+
+ // if chars set to "-1", automatically determine by text and font width
+ if (tmi->chars == -1)
+ tmi->chars = tmi->width / getFontWidth(tmi->font);
+ else
+ tmi->width = tmi->chars * getFontWidth(tmi->font);
+
+ // if lines set to "-1", automatically determine by text and font height
+ if (tmi->lines == -1)
+ tmi->lines = tmi->height / getFontHeight(tmi->font);
+ else
+ tmi->height = tmi->lines * getFontHeight(tmi->font);
+
+ DrawTextFile(mSX + ALIGNED_TEXT_XPOS(tmi), mSY + ALIGNED_TEXT_YPOS(tmi),
+ filename, tmi->font, tmi->chars, -1, tmi->lines, 0, -1,
+ tmi->autowrap, tmi->centered, tmi->parse_comments);
+ }
+
+ boolean last_screen = (screen_nr == num_screens - 1);
+ char *text_foot = (last_screen ? TEXT_NEXT_MENU : TEXT_NEXT_PAGE);
+
+ DrawTextSCentered(ybottom, font_foot, text_foot);
+}
+
+static void DrawInfoScreen_Generic(void)
+{
+ SetMainBackgroundImageIfDefined(getInfoScreenBackgroundImage_Generic());
+
+ UnmapAllGadgets();
+ FadeInfoSoundsAndMusic();
+
+ FadeOut(REDRAW_FIELD);
+
+ HandleInfoScreen_Generic(0, 0, MB_MENU_INITIALIZE);
+
+ PlayInfoSoundsAndMusic();
+
+ FadeIn(REDRAW_FIELD);
+}
+
+void HandleInfoScreen_Generic(int dx, int dy, int button)