-static void DrawInfoScreen_CreditsScreen(int screen_nr)
-{
- int font_title = MENU_INFO_FONT_TITLE;
- int font_text = MENU_INFO_FONT_TEXT;
- int font_foot = MENU_INFO_FONT_FOOT;
- int spacing_title = menu.headline1_spacing_info[info_mode];
- int spacing_line = menu.line_spacing_info[info_mode];
- int ystep_title = getMenuTextStep(spacing_title, font_title);
- int ystart = mSY - SY + MENU_SCREEN_INFO_YSTART1;
- int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
-
- ClearField();
- DrawHeadline();
-
- DrawTextSCentered(ystart, font_title, "Credits:");
-
- char *filename = getCreditsFilename(screen_nr, use_global_credits_screens);
- int width = SXSIZE;
- int height = MENU_SCREEN_INFO_YBOTTOM - MENU_SCREEN_INFO_YSTART1;
- 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);
- boolean autowrap = FALSE;
- boolean centered = TRUE;
- boolean parse_comments = TRUE;
-
- DrawTextFile(mSX + padx, mSY + MENU_SCREEN_INFO_YSTART1 + ystep_title,
- filename, font_text, chars, -1, lines, line_spacing, -1,
- autowrap, centered, parse_comments);
-
- boolean last_screen = (screen_nr == num_credits_screens - 1);
- char *text_foot = (last_screen ? TEXT_INFO_MENU : TEXT_NEXT_PAGE);
-
- DrawTextSCentered(ybottom, font_foot, text_foot);
-}
-
-static void DrawInfoScreen_Credits(void)
-{
- SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS);
-
- FadeMenuSoundsAndMusic();
-
- FadeOut(REDRAW_FIELD);
-
- HandleInfoScreen_Credits(0, 0, MB_MENU_INITIALIZE);
-
- FadeIn(REDRAW_FIELD);
-}
-
-void HandleInfoScreen_Credits(int dx, int dy, int button)
-{
- static int screen_nr = 0;
-
- if (button == MB_MENU_INITIALIZE)
- {
- int i;
-
- // determine number of (global or level set specific) credits screens
- for (i = 0; i < 2; i++)
- {
- num_credits_screens = 0;
- use_global_credits_screens = i;
-
- while (getCreditsFilename(num_credits_screens,
- use_global_credits_screens) != NULL)
- num_credits_screens++;
-
- if (num_credits_screens > 0)
- break;
- }
-
- if (num_credits_screens == 0)
- {
- int font_title = MENU_INFO_FONT_TITLE;
- int font_foot = MENU_INFO_FONT_FOOT;
- int ystart = mSY - SY + MENU_SCREEN_INFO_YSTART1;
- int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
-
- ClearField();
- DrawHeadline();
-
- DrawTextSCentered(ystart, font_title, "No credits for this level set.");
- DrawTextSCentered(ybottom, font_foot, TEXT_INFO_MENU);
-
- return;
- }
-
- screen_nr = 0;
-
- DrawInfoScreen_CreditsScreen(screen_nr);
- }
- else if (button == MB_MENU_LEAVE)
- {
- PlaySound(SND_MENU_ITEM_SELECTING);
-
- info_mode = INFO_MODE_MAIN;
- DrawInfoScreen();
-
- return;
- }
- else if (button == MB_MENU_CHOICE || dx)
- {
- PlaySound(SND_MENU_ITEM_SELECTING);
-
- screen_nr += (dx < 0 ? -1 : +1);
-
- if (screen_nr < 0 || screen_nr >= num_credits_screens)
- {
- FadeMenuSoundsAndMusic();
-
- info_mode = INFO_MODE_MAIN;
- DrawInfoScreen();
-
- return;
- }
-
- FadeSetNextScreen();
-
- FadeOut(REDRAW_FIELD);
-
- DrawInfoScreen_CreditsScreen(screen_nr);
-
- FadeIn(REDRAW_FIELD);
- }
- else
- {
- PlayMenuSoundIfLoop();
- }
-}
-
-static void DrawInfoScreen_ProgramScreen(int screen_nr)
-{
- int font_title = MENU_INFO_FONT_TITLE;
- int font_text = MENU_INFO_FONT_TEXT;
- int font_foot = MENU_INFO_FONT_FOOT;
- int spacing_title = menu.headline1_spacing_info[info_mode];
- int spacing_line = menu.line_spacing_info[info_mode];
- int ystep_title = getMenuTextStep(spacing_title, font_title);
- int ystart = mSY - SY + MENU_SCREEN_INFO_YSTART1;
- int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
-
- ClearField();
- DrawHeadline();
-
- DrawTextSCentered(ystart, font_title, "Program Information:");
-
- char *filename = getProgramInfoFilename(screen_nr);
- int width = SXSIZE;
- int height = MENU_SCREEN_INFO_YBOTTOM - MENU_SCREEN_INFO_YSTART1;
- 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);
- boolean autowrap = FALSE;
- boolean centered = TRUE;
- boolean parse_comments = TRUE;
-
- DrawTextFile(mSX + padx, mSY + MENU_SCREEN_INFO_YSTART1 + ystep_title,
- filename, font_text, chars, -1, lines, line_spacing, -1,
- autowrap, centered, parse_comments);
-
- boolean last_screen = (screen_nr == num_program_info_screens - 1);
- char *text_foot = (last_screen ? TEXT_INFO_MENU : TEXT_NEXT_PAGE);
-
- DrawTextSCentered(ybottom, font_foot, text_foot);
-}
-
-static void DrawInfoScreen_Program(void)
-{
- SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_PROGRAM);
-
- FadeMenuSoundsAndMusic();
-
- FadeOut(REDRAW_FIELD);
-
- HandleInfoScreen_Program(0, 0, MB_MENU_INITIALIZE);
-
- FadeIn(REDRAW_FIELD);
-}
-
-void HandleInfoScreen_Program(int dx, int dy, int button)
-{
- static int screen_nr = 0;
-
- if (button == MB_MENU_INITIALIZE)
- {
- // determine number of program info screens
- num_program_info_screens = 0;
-
- while (getProgramInfoFilename(num_program_info_screens) != NULL)
- num_program_info_screens++;
-
- if (num_program_info_screens == 0)
- {
- int font_title = MENU_INFO_FONT_TITLE;
- int font_foot = MENU_INFO_FONT_FOOT;
- int ystart = mSY - SY + MENU_SCREEN_INFO_YSTART1;
- int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
-
- ClearField();
- DrawHeadline();
-
- DrawTextSCentered(ystart, font_title, "No program info available.");
- DrawTextSCentered(ybottom, font_foot, TEXT_INFO_MENU);
-
- return;
- }
-
- screen_nr = 0;
-
- DrawInfoScreen_ProgramScreen(screen_nr);
- }
- else if (button == MB_MENU_LEAVE)
- {
- PlaySound(SND_MENU_ITEM_SELECTING);
-
- info_mode = INFO_MODE_MAIN;
- DrawInfoScreen();
-
- return;
- }
- else if (button == MB_MENU_CHOICE || dx)
- {
- PlaySound(SND_MENU_ITEM_SELECTING);
-
- screen_nr += (dx < 0 ? -1 : +1);
-
- if (screen_nr < 0 || screen_nr >= num_program_info_screens)
- {
- FadeMenuSoundsAndMusic();
-
- info_mode = INFO_MODE_MAIN;
- DrawInfoScreen();
-
- return;
- }
-
- FadeSetNextScreen();
-
- FadeOut(REDRAW_FIELD);
-
- DrawInfoScreen_ProgramScreen(screen_nr);
-
- FadeIn(REDRAW_FIELD);
- }
- else
- {
- PlayMenuSoundIfLoop();
- }
-}
-