+ DrawText(mSX + xpos * 32, mSY + ypos * 32, ti->text, font_nr);
+
+ if (ti->type & ~TYPE_SKIP_ENTRY)
+ drawCursor(screen_pos, active);
+}
+
+static void DrawCursorAndText_Menu(int screen_pos, int menu_info_pos_raw,
+ boolean active)
+{
+ DrawCursorAndText_Menu_Ext(menu_info, screen_pos, menu_info_pos_raw, active);
+}
+
+static void DrawCursorAndText_Setup(int screen_pos, int menu_info_pos_raw,
+ boolean active)
+{
+ DrawCursorAndText_Menu_Ext(setup_info, screen_pos, menu_info_pos_raw, active);
+}
+
+static char *window_size_text;
+static char *scaling_type_text;
+
+static void drawSetupValue(int, int);
+
+static void drawMenuInfoList(int first_entry, int num_page_entries,
+ int max_page_entries)
+{
+ int i;
+
+ if (first_entry + num_page_entries > max_page_entries)
+ first_entry = 0;
+
+ clearMenuListArea();
+
+ for (i = 0; i < num_page_entries; i++)
+ {
+ int menu_info_pos = first_entry + i;
+ struct TokenInfo *si = &menu_info[menu_info_pos];
+ void *value_ptr = si->value;
+
+ /* set some entries to "unchangeable" according to other variables */
+ if ((value_ptr == &setup.sound_simple && !audio.sound_available) ||
+ (value_ptr == &setup.sound_loops && !audio.loops_available) ||
+ (value_ptr == &setup.sound_music && !audio.music_available) ||
+ (value_ptr == &setup.fullscreen && !video.fullscreen_available) ||
+ (value_ptr == &window_size_text && !video.window_scaling_available) ||
+ (value_ptr == &scaling_type_text && !video.window_scaling_available))
+ si->type |= TYPE_GHOSTED;
+
+ if (si->type & (TYPE_ENTER_MENU|TYPE_ENTER_LIST))
+ initCursor(i, IMG_MENU_BUTTON_ENTER_MENU);
+ else if (si->type & (TYPE_LEAVE_MENU|TYPE_LEAVE_LIST))
+ initCursor(i, IMG_MENU_BUTTON_LEAVE_MENU);
+ else if (si->type & ~TYPE_SKIP_ENTRY)
+ initCursor(i, IMG_MENU_BUTTON);
+
+ DrawCursorAndText_Menu(i, menu_info_pos, FALSE);
+
+ if (si->type & TYPE_VALUE &&
+ menu_info == setup_info)
+ drawSetupValue(i, menu_info_pos);
+ }
+}
+
+static void DrawInfoScreen_Main()
+{
+ int fade_mask = REDRAW_FIELD;
+ int i;
+
+ if (redraw_mask & REDRAW_ALL)
+ fade_mask = REDRAW_ALL;
+
+ if (CheckIfGlobalBorderHasChanged())
+ fade_mask = REDRAW_ALL;
+
+ UnmapAllGadgets();
+ FadeSoundsAndMusic();
+
+ FreeScreenGadgets();
+ CreateScreenGadgets();
+
+ /* (needed after displaying title screens which disable auto repeat) */
+ KeyboardAutoRepeatOn();
+
+ FadeSetLeaveScreen();
+
+ FadeOut(fade_mask);
+
+ /* needed if different viewport properties defined for info screen */
+ ChangeViewportPropertiesIfNeeded();
+
+ SetMainBackgroundImage(IMG_BACKGROUND_INFO);
+
+ ClearField();
+
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
+ DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Info Screen");
+
+ info_info = info_info_main;
+
+ // determine maximal number of info entries that can be displayed on screen
+ num_info_info = 0;
+ for (i = 0; info_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
+ num_info_info++;
+
+ // determine maximal number of info entries available for menu of info screen
+ max_info_info = 0;
+ for (i = 0; info_info[i].type != 0; i++)
+ max_info_info++;
+
+ HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE);
+
+ MapScreenGadgets(max_info_info);
+
+ PlayMenuSound();
+ PlayMenuMusic();
+
+ DrawMaskedBorder(fade_mask);
+
+ FadeIn(fade_mask);
+}
+
+static void changeSetupValue(int, int, int);
+
+void HandleMenuScreen(int mx, int my, int dx, int dy, int button,
+ int mode, int num_page_entries, int max_page_entries)
+{
+ static int num_page_entries_all_last[NUM_SPECIAL_GFX_ARGS][MAX_MENU_MODES];
+ static int choice_stores[NUM_SPECIAL_GFX_ARGS][MAX_MENU_MODES];
+ static int first_entry_stores[NUM_SPECIAL_GFX_ARGS][MAX_MENU_MODES];
+ int *num_page_entries_last = num_page_entries_all_last[game_status];
+ int *choice_store = choice_stores[game_status];
+ int *first_entry_store = first_entry_stores[game_status];
+ int choice = choice_store[mode]; /* starts with 0 */
+ int first_entry = first_entry_store[mode]; /* starts with 0 */
+ int x = 0;
+ int y = choice - first_entry;
+ int y_old = y;
+ boolean position_set_by_scrollbar = (dx == 999);
+ int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
+ int i;
+
+ if (button == MB_MENU_INITIALIZE)
+ {
+ // check if number of menu page entries has changed (may happen by change
+ // of custom artwork definition value for 'list_size' for this menu screen)
+ // (in this case, the last menu position most probably has to be corrected)
+ if (num_page_entries != num_page_entries_last[mode])
+ {
+ choice_store[mode] = first_entry_store[mode] = 0;
+
+ choice = first_entry = 0;
+ y = y_old = 0;
+
+ num_page_entries_last[mode] = num_page_entries;
+ }
+
+ /* advance to first valid menu entry */
+ while (choice < num_page_entries &&
+ menu_info[choice].type & TYPE_SKIP_ENTRY)
+ choice++;
+
+ if (position_set_by_scrollbar)
+ first_entry = first_entry_store[mode] = dy;
+ else
+ AdjustScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL, max_page_entries,
+ NUM_MENU_ENTRIES_ON_SCREEN, first_entry);
+
+ drawMenuInfoList(first_entry, num_page_entries, max_page_entries);
+
+ if (choice < first_entry)
+ {
+ choice = first_entry;
+
+ if (menu_info[choice].type & TYPE_SKIP_ENTRY)
+ choice++;
+ }
+ else if (choice > first_entry + num_page_entries - 1)
+ {
+ choice = first_entry + num_page_entries - 1;
+
+ if (menu_info[choice].type & TYPE_SKIP_ENTRY)
+ choice--;
+ }
+
+ choice_store[mode] = choice;
+
+ DrawCursorAndText_Menu(choice - first_entry, choice, TRUE);
+
+ return;
+ }
+ else if (button == MB_MENU_LEAVE)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ for (i = 0; i < max_page_entries; i++)
+ {
+ if (menu_info[i].type & TYPE_LEAVE_MENU)
+ {
+ void (*menu_callback_function)(void) = menu_info[i].value;
+
+ FadeSetLeaveMenu();
+
+ menu_callback_function();
+
+ break; /* absolutely needed because function changes 'menu_info'! */
+ }
+ }
+
+ return;
+ }
+
+ if (mx || my) /* mouse input */
+ {
+ x = (mx - mSX) / 32;
+ y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
+ }
+ else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
+ {
+ /* move cursor instead of scrolling when already at start/end of list */
+ if (dy == -1 * SCROLL_LINE && first_entry == 0)
+ dy = -1;
+ else if (dy == +1 * SCROLL_LINE &&
+ first_entry + num_page_entries == max_page_entries)
+ dy = 1;
+
+ /* handle scrolling screen one line or page */
+ if (y + dy < 0 ||
+ y + dy > num_page_entries - 1)
+ {
+ boolean redraw = FALSE;
+
+ if (ABS(dy) == SCROLL_PAGE)
+ step = num_page_entries - 1;
+
+ if (dy < 0 && first_entry > 0)
+ {
+ /* scroll page/line up */
+
+ first_entry -= step;
+ if (first_entry < 0)
+ first_entry = 0;
+
+ redraw = TRUE;
+ }
+ else if (dy > 0 && first_entry + num_page_entries < max_page_entries)
+ {
+ /* scroll page/line down */
+
+ first_entry += step;
+ if (first_entry + num_page_entries > max_page_entries)
+ first_entry = MAX(0, max_page_entries - num_page_entries);
+
+ redraw = TRUE;
+ }
+
+ if (redraw)
+ {
+ choice += first_entry - first_entry_store[mode];
+
+ if (choice < first_entry)
+ {
+ choice = first_entry;
+
+ if (menu_info[choice].type & TYPE_SKIP_ENTRY)
+ choice++;
+ }
+ else if (choice > first_entry + num_page_entries - 1)
+ {
+ choice = first_entry + num_page_entries - 1;
+
+ if (menu_info[choice].type & TYPE_SKIP_ENTRY)
+ choice--;
+ }
+ else if (menu_info[choice].type & TYPE_SKIP_ENTRY)
+ {
+ choice += SIGN(dy);
+
+ if (choice < first_entry ||
+ choice > first_entry + num_page_entries - 1)
+ first_entry += SIGN(dy);
+ }
+
+ first_entry_store[mode] = first_entry;
+ choice_store[mode] = choice;
+
+ drawMenuInfoList(first_entry, num_page_entries, max_page_entries);
+
+ DrawCursorAndText_Menu(choice - first_entry, choice, TRUE);
+
+ AdjustScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL, max_page_entries,
+ NUM_MENU_ENTRIES_ON_SCREEN, first_entry);
+ }
+
+ return;
+ }
+
+ if (dx)
+ {
+ int menu_navigation_type = (dx < 0 ? TYPE_LEAVE : TYPE_ENTER);
+
+ if (menu_info[choice].type & menu_navigation_type ||
+ menu_info[choice].type & TYPE_BOOLEAN_STYLE ||
+ menu_info[choice].type & TYPE_YES_NO_AUTO)
+ button = MB_MENU_CHOICE;
+ }
+ else if (dy)
+ y += dy;
+
+ /* jump to next non-empty menu entry (up or down) */
+ while (first_entry + y > 0 &&
+ first_entry + y < max_page_entries - 1 &&
+ menu_info[first_entry + y].type & TYPE_SKIP_ENTRY)
+ y += dy;
+
+ if (!IN_VIS_MENU(x, y))
+ {
+ choice += y - y_old;
+
+ if (choice < first_entry)
+ first_entry = choice;
+ else if (choice > first_entry + num_page_entries - 1)
+ first_entry = choice - num_page_entries + 1;
+
+ if (first_entry >= 0 &&
+ first_entry + num_page_entries <= max_page_entries)
+ {
+ first_entry_store[mode] = first_entry;
+
+ if (choice < first_entry)
+ choice = first_entry;
+ else if (choice > first_entry + num_page_entries - 1)
+ choice = first_entry + num_page_entries - 1;
+
+ choice_store[mode] = choice;
+
+ drawMenuInfoList(first_entry, num_page_entries, max_page_entries);
+
+ DrawCursorAndText_Menu(choice - first_entry, choice, TRUE);
+
+ AdjustScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL, max_page_entries,
+ NUM_MENU_ENTRIES_ON_SCREEN, first_entry);
+ }
+
+ return;
+ }
+ }
+
+ if (!anyScrollbarGadgetActive() &&
+ IN_VIS_MENU(x, y) &&
+ mx < screen_gadget[SCREEN_CTRL_ID_SCROLL_VERTICAL]->x &&
+ y >= 0 && y < num_page_entries)
+ {
+ if (button)
+ {
+ if (first_entry + y != choice &&
+ menu_info[first_entry + y].type & ~TYPE_SKIP_ENTRY)
+ {
+ PlaySound(SND_MENU_ITEM_ACTIVATING);
+
+ DrawCursorAndText_Menu(choice - first_entry, choice, FALSE);
+ DrawCursorAndText_Menu(y, first_entry + y, TRUE);
+
+ choice = choice_store[mode] = first_entry + y;
+ }
+ }
+ else if (!(menu_info[first_entry + y].type & TYPE_GHOSTED))
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ /* when selecting key headline, execute function for key value change */
+ if (menu_info[first_entry + y].type & TYPE_KEYTEXT &&
+ menu_info[first_entry + y + 1].type & TYPE_KEY)
+ y++;
+
+ /* when selecting string value, execute function for list selection */
+ if (menu_info[first_entry + y].type & TYPE_STRING && y > 0 &&
+ menu_info[first_entry + y - 1].type & TYPE_ENTER_LIST)
+ y--;
+
+ if (menu_info[first_entry + y].type & TYPE_ENTER_OR_LEAVE)
+ {
+ void (*menu_callback_function)(void) =
+ menu_info[first_entry + y].value;
+
+ FadeSetFromType(menu_info[first_entry + y].type);
+
+ menu_callback_function();
+ }
+ else if (menu_info[first_entry + y].type & TYPE_VALUE &&
+ menu_info == setup_info)
+ {
+ changeSetupValue(y, first_entry + y, dx);
+ }
+ }
+ }
+}
+
+void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button)
+{
+ menu_info = info_info;
+
+ HandleMenuScreen(mx, my, dx, dy, button,
+ info_mode, num_info_info, max_info_info);
+}
+
+void DrawInfoScreen_NotAvailable(char *text_title, char *text_error)
+{
+ int ystart1 = mSY - SY + 100;
+ int ystart2 = mSY - SY + 150;
+ int ybottom = mSY - SY + SYSIZE - 20;
+
+ SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO);
+
+ FadeOut(REDRAW_FIELD);
+
+ ClearField();
+ DrawHeadline();
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1, text_title);
+ DrawTextSCentered(ystart2, FONT_TEXT_2, text_error);
+
+ DrawTextSCentered(ybottom, FONT_TEXT_4,
+ "Press any key or button for info menu");
+
+ FadeIn(REDRAW_FIELD);
+}
+
+void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init)
+{
+ static int infoscreen_step[MAX_INFO_ELEMENTS_ON_SCREEN];
+ static int infoscreen_frame[MAX_INFO_ELEMENTS_ON_SCREEN];
+ int xstart = mSX + MENU_SCREEN_INFO_XSTART;
+ int ystart1 = mSY - SY + MENU_SCREEN_INFO_YSTART1;
+ int ystart2 = mSY + MENU_SCREEN_INFO_YSTART2;
+ int ybottom = mSY - SY + MENU_SCREEN_INFO_YBOTTOM;
+ int ystep = MENU_SCREEN_INFO_YSTEP;
+ int element, action, direction;
+ int graphic;
+ int delay;
+ int sync_frame;
+ int i, j;
+
+ if (init)
+ {
+ for (i = 0; i < NUM_INFO_ELEMENTS_ON_SCREEN; i++)
+ infoscreen_step[i] = infoscreen_frame[i] = 0;
+
+ ClearField();
+ DrawHeadline();
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Elements:");
+
+ DrawTextSCentered(ybottom, FONT_TEXT_4,
+ "Press any key or button for next page");
+
+ FrameCounter = 0;
+ }
+
+ i = j = 0;
+ while (helpanim_info[j].element != HELPANIM_LIST_END)
+ {
+ if (i >= start + NUM_INFO_ELEMENTS_ON_SCREEN ||
+ i >= max_anims)
+ break;
+ else if (i < start)
+ {
+ while (helpanim_info[j].element != HELPANIM_LIST_NEXT)
+ j++;
+
+ j++;
+ i++;
+
+ continue;
+ }
+
+ j += infoscreen_step[i - start];
+
+ element = helpanim_info[j].element;
+ action = helpanim_info[j].action;
+ direction = helpanim_info[j].direction;
+
+ if (element < 0)
+ element = EL_UNKNOWN;
+
+ if (action != -1 && direction != -1)
+ graphic = el_act_dir2img(element, action, direction);
+ else if (action != -1)
+ graphic = el_act2img(element, action);
+ else if (direction != -1)
+ graphic = el_dir2img(element, direction);
+ else
+ graphic = el2img(element);
+
+ delay = helpanim_info[j++].delay;
+
+ if (delay == -1)
+ delay = 1000000;
+
+ if (infoscreen_frame[i - start] == 0)
+ {
+ sync_frame = 0;
+ infoscreen_frame[i - start] = delay - 1;
+ }
+ else
+ {
+ sync_frame = delay - infoscreen_frame[i - start];
+ infoscreen_frame[i - start]--;
+ }
+
+ if (helpanim_info[j].element == HELPANIM_LIST_NEXT)
+ {
+ if (!infoscreen_frame[i - start])
+ infoscreen_step[i - start] = 0;
+ }
+ else
+ {
+ if (!infoscreen_frame[i - start])
+ infoscreen_step[i - start]++;
+ while (helpanim_info[j].element != HELPANIM_LIST_NEXT)
+ j++;
+ }
+
+ j++;
+
+ ClearRectangleOnBackground(drawto, xstart, ystart2 + (i - start) * ystep,
+ TILEX, TILEY);
+ DrawFixedGraphicAnimationExt(drawto, xstart, ystart2 + (i - start) * ystep,
+ graphic, sync_frame, USE_MASKING);
+
+ if (init)
+ DrawInfoScreen_HelpText(element, action, direction, i - start);
+
+ i++;
+ }
+
+ redraw_mask |= REDRAW_FIELD;
+
+ FrameCounter++;
+}
+
+static char *getHelpText(int element, int action, int direction)
+{
+ char token[MAX_LINE_LEN];
+
+ strcpy(token, element_info[element].token_name);
+
+ if (action != -1)
+ strcat(token, element_action_info[action].suffix);
+
+ if (direction != -1)
+ strcat(token, element_direction_info[MV_DIR_TO_BIT(direction)].suffix);
+
+ return getHashEntry(helptext_info, token);
+}
+
+void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
+{
+ int font_nr = FONT_INFO_ELEMENTS;
+ int font_width = getFontWidth(font_nr);
+ int sx = mSX + MINI_TILEX + TILEX + MINI_TILEX;
+ int sy = mSY + 65 + 2 * 32 + 1;
+ int ystep = TILEY + 4;
+ int pad_x = sx - SX;
+ int max_chars_per_line = (SXSIZE - pad_x - MINI_TILEX) / font_width;
+ int max_lines_per_text = 2;
+ char *text = NULL;
+
+ if (action != -1 && direction != -1) /* element.action.direction */
+ text = getHelpText(element, action, direction);
+
+ if (text == NULL && action != -1) /* element.action */
+ text = getHelpText(element, action, -1);
+
+ if (text == NULL && direction != -1) /* element.direction */
+ text = getHelpText(element, -1, direction);
+
+ if (text == NULL) /* base element */
+ text = getHelpText(element, -1, -1);
+
+ if (text == NULL) /* not found */
+ text = "No description available";
+
+ if (strlen(text) <= max_chars_per_line) /* only one line of text */
+ sy += getFontHeight(font_nr) / 2;
+
+ DrawTextBuffer(sx, sy + ypos * ystep, text, font_nr,
+ max_chars_per_line, -1, max_lines_per_text, 0, -1,
+ TRUE, FALSE, FALSE);
+}
+
+void DrawInfoScreen_TitleScreen()
+{
+ game_status_last_screen = GAME_MODE_INFO;
+
+ SetGameStatus(GAME_MODE_TITLE);
+
+ DrawTitleScreen();
+}
+
+void HandleInfoScreen_TitleScreen(int button)
+{
+ HandleTitleScreen(0, 0, 0, 0, button);
+}
+
+void DrawInfoScreen_Elements()
+{
+ SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_ELEMENTS);
+
+ FadeOut(REDRAW_FIELD);
+
+ LoadHelpAnimInfo();
+ LoadHelpTextInfo();
+
+ HandleInfoScreen_Elements(MB_MENU_INITIALIZE);
+
+ FadeIn(REDRAW_FIELD);
+}
+
+void HandleInfoScreen_Elements(int button)
+{
+ static unsigned int info_delay = 0;
+ static int num_anims;
+ static int num_pages;
+ static int page;
+ int anims_per_page = NUM_INFO_ELEMENTS_ON_SCREEN;
+ int i;
+
+ if (button == MB_MENU_INITIALIZE)
+ {
+ boolean new_element = TRUE;
+
+ num_anims = 0;
+
+ for (i = 0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
+ {
+ if (helpanim_info[i].element == HELPANIM_LIST_NEXT)
+ new_element = TRUE;
+ else if (new_element)
+ {
+ num_anims++;
+ new_element = FALSE;
+ }
+ }
+
+ num_pages = (num_anims + anims_per_page - 1) / anims_per_page;
+ page = 0;
+ }
+
+ if (button == MB_MENU_LEAVE)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ info_mode = INFO_MODE_MAIN;
+ DrawInfoScreen();
+
+ return;
+ }
+ else if (button == MB_MENU_CHOICE || button == MB_MENU_INITIALIZE)
+ {
+ if (button != MB_MENU_INITIALIZE)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ page++;
+ }
+
+ if (page >= num_pages)
+ {
+ FadeSoundsAndMusic();
+
+ info_mode = INFO_MODE_MAIN;
+ DrawInfoScreen();
+
+ return;
+ }
+
+ if (page > 0)
+ FadeSetNextScreen();
+
+ if (button != MB_MENU_INITIALIZE)
+ FadeOut(REDRAW_FIELD);
+
+ DrawInfoScreen_HelpAnim(page * anims_per_page, num_anims, TRUE);
+
+ if (button != MB_MENU_INITIALIZE)
+ FadeIn(REDRAW_FIELD);
+ }
+ else
+ {
+ if (DelayReached(&info_delay, GameFrameDelay))
+ if (page < num_pages)
+ DrawInfoScreen_HelpAnim(page * anims_per_page, num_anims, FALSE);
+
+ PlayMenuSoundIfLoop();
+ }
+}
+
+void DrawInfoScreen_Music()
+{
+ SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_MUSIC);
+
+ FadeOut(REDRAW_FIELD);
+
+ ClearField();
+ DrawHeadline();
+
+ LoadMusicInfo();
+
+ HandleInfoScreen_Music(MB_MENU_INITIALIZE);
+
+ FadeIn(REDRAW_FIELD);
+}
+
+void HandleInfoScreen_Music(int button)
+{
+ static struct MusicFileInfo *list = NULL;
+ int ystart1 = mSY - SY + 100;
+ int ystart2 = mSY - SY + 150;
+ int ybottom = mSY - SY + SYSIZE - 20;
+ int dy = 30;
+
+ if (button == MB_MENU_INITIALIZE)
+ {
+ list = music_file_info;
+
+ if (list == NULL)
+ {
+ FadeSoundsAndMusic();
+
+ ClearField();
+ DrawHeadline();
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1,
+ "No music info for this level set.");
+
+ DrawTextSCentered(ybottom, FONT_TEXT_4,
+ "Press any key or button for info menu");
+
+ return;
+ }
+ }
+
+ if (button == MB_MENU_LEAVE)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ FadeSoundsAndMusic();
+
+ info_mode = INFO_MODE_MAIN;
+ DrawInfoScreen();
+
+ return;
+ }
+ else if (button == MB_MENU_CHOICE || button == MB_MENU_INITIALIZE)
+ {
+ int y = 0;
+
+ if (button != MB_MENU_INITIALIZE)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ if (list != NULL)
+ list = list->next;
+ }
+
+ if (list == NULL)
+ {
+ FadeSoundsAndMusic();
+
+ info_mode = INFO_MODE_MAIN;
+ DrawInfoScreen();
+
+ return;
+ }
+
+ FadeSoundsAndMusic();
+
+ if (list != music_file_info)
+ FadeSetNextScreen();
+
+ if (button != MB_MENU_INITIALIZE)
+ FadeOut(REDRAW_FIELD);
+
+ ClearField();
+ DrawHeadline();
+
+ if (list->is_sound)
+ {
+ int sound = list->music;
+
+ if (sound_info[sound].loop)
+ PlaySoundLoop(sound);
+ else
+ PlaySound(sound);
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Background Sounds:");
+ }
+ else
+ {
+ PlayMusic(list->music);
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Background Music:");
+ }
+
+ if (!strEqual(list->title, UNKNOWN_NAME))
+ {
+ if (!strEqual(list->title_header, UNKNOWN_NAME))
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->title_header);
+
+ DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "\"%s\"", list->title);
+ }
+
+ if (!strEqual(list->artist, UNKNOWN_NAME))
+ {
+ if (!strEqual(list->artist_header, UNKNOWN_NAME))
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->artist_header);
+ else
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "by");
+
+ DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "%s", list->artist);
+ }
+
+ if (!strEqual(list->album, UNKNOWN_NAME))
+ {
+ if (!strEqual(list->album_header, UNKNOWN_NAME))
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->album_header);
+ else
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "from the album");
+
+ DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "\"%s\"", list->album);
+ }
+
+ if (!strEqual(list->year, UNKNOWN_NAME))
+ {
+ if (!strEqual(list->year_header, UNKNOWN_NAME))
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->year_header);
+ else
+ DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "from the year");
+
+ DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "%s", list->year);
+ }
+
+ DrawTextSCentered(ybottom, FONT_TEXT_4,
+ "Press any key or button for next page");
+
+ if (button != MB_MENU_INITIALIZE)
+ FadeIn(REDRAW_FIELD);
+ }
+
+ if (list != NULL && list->is_sound && sound_info[list->music].loop)
+ PlaySoundLoop(list->music);
+}
+
+static void DrawInfoScreen_CreditsScreen(int screen_nr)
+{
+ int ystart1 = mSY - SY + 100;
+ int ystart2 = mSY - SY + 150;
+ int ybottom = mSY - SY + SYSIZE - 20;
+ int ystep = 30;
+
+ ClearField();
+ DrawHeadline();
+
+ DrawTextSCentered(ystart1, FONT_TEXT_1, "Credits:");
+
+ if (screen_nr == 0)
+ {
+ DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2,
+ "Special thanks to");
+ DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3,
+ "Peter Liepa");
+ DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2,
+ "for creating");
+ DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3,
+ "\"Boulder Dash\"");
+ DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2,
+ "in the year");
+ DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3,
+ "1984");
+ DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2,