X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=29e4f3cb7fe53435d4a88343eb94dca0d3b7717d;hb=b6b5d3fe94b178e8e48e9c51b61f3b1b8383a42f;hp=9d4157c026829febf36f9ee8fa325dec8f31abd5;hpb=2f108aeda582d7ea4578ab6a87fb74c2e533dbe3;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 9d4157c0..29e4f3cb 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1142,8 +1142,13 @@ static void InitializeTitleControls_CheckTitleInfo(boolean initial) int graphic = getTitleScreenGraphic(i, initial); Bitmap *bitmap = graphic_info[graphic].bitmap; int sort_priority = graphic_info[graphic].sort_priority; + boolean has_title_screen = (bitmap != NULL); - if (bitmap != NULL) + // check for optional title screen of native BD style level set + if (!has_title_screen && level.game_engine_type == GAME_ENGINE_TYPE_BD && !initial && i == 0) + has_title_screen = (GetTitleScreen_BD() != NULL); + + if (has_title_screen) InitializeTitleControlsExt_AddTitleInfo(TRUE, initial, i, sort_priority); } @@ -1605,6 +1610,20 @@ static void DrawTitleScreenImage(int nr, boolean initial) int src_y = graphic_info[graphic].src_y; int dst_x, dst_y; + // check for optional title screen of native BD style level set + if (bitmap == NULL && level.game_engine_type == GAME_ENGINE_TYPE_BD && !initial && nr == 0) + { + bitmap = GetTitleScreen_BD(); + + if (bitmap != NULL) + { + width = bitmap->width; + height = bitmap->height; + src_x = 0; + src_y = 0; + } + } + if (bitmap == NULL) return; @@ -1785,6 +1804,15 @@ void DrawMainMenu(void) // store first level of this level set for "level_nr" style animations SetAnimationFirstLevel(leveldir_current->first_level); + // level_nr may have been set to value over handicap with level editor + if (setup.handicap && level_nr > leveldir_current->handicap_level) + level_nr = leveldir_current->handicap_level; + + LoadLevel(level_nr); + LoadScore(level_nr); + + SaveLevelSetup_SeriesInfo(); + // needed if last screen (level choice) changed graphics, sounds or music ReloadCustomArtwork(0); @@ -1810,15 +1838,6 @@ void DrawMainMenu(void) SetDrawtoField(DRAW_TO_BACKBUFFER); - // level_nr may have been set to value over handicap with level editor - if (setup.handicap && level_nr > leveldir_current->handicap_level) - level_nr = leveldir_current->handicap_level; - - LoadLevel(level_nr); - LoadScore(level_nr); - - SaveLevelSetup_SeriesInfo(); - // set this after "ChangeViewportPropertiesIfNeeded()" (which may reset it) SetDrawDeactivationMask(REDRAW_NONE); SetDrawBackgroundMask(REDRAW_FIELD); @@ -2131,8 +2150,10 @@ static void HandleMainMenu_SelectLevel(int step, int direction, if (setup.handicap && new_level_nr > leveldir_current->handicap_level) { // skipping levels is only allowed when trying to skip single level - if (setup.skip_levels && new_level_nr == old_level_nr + 1 && - Request("Level still unsolved! Skip it anyway?", REQ_ASK)) + // (also, skipping BD style intermission levels is always possible) + if (new_level_nr == old_level_nr + 1 && + (level.bd_intermission || + (setup.skip_levels && Request("Level still unsolved! Skip it anyway?", REQ_ASK)))) { leveldir_current->handicap_level++; SaveLevelSetup_SeriesInfo(); @@ -7468,6 +7489,8 @@ static struct TokenInfo setup_info_engines[] = { TYPE_HEADLINE, NULL, "Boulder Dash" }, { TYPE_SWITCH, &setup.bd_skip_uncovering, "Skip (un)covering screen:" }, { TYPE_SWITCH, &setup.bd_skip_hatching, "Skip hatching player:" }, + { TYPE_SWITCH, &setup.bd_scroll_delay, "Scroll Delay:" }, + { TYPE_YES_NO_AUTO, &setup.bd_smooth_movements, "Smooth Element Movement:" }, { TYPE_EMPTY, NULL, "" }, { TYPE_HEADLINE, NULL, "Emerald Mine" }, { TYPE_SWITCH, &setup.forced_scroll_delay, "Scroll Delay:" }, @@ -7859,10 +7882,11 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) struct TokenInfo *si = &setup_info[si_pos]; boolean font_draw_xoffset_modified = FALSE; boolean scrollbar_needed = (num_setup_info < max_setup_info); + int mx_scrollbar = screen_gadget[SCREEN_CTRL_ID_SCROLL_VERTICAL]->x; + int mx_right_border = (scrollbar_needed ? mx_scrollbar : SX + SXSIZE); int font_draw_xoffset_old = -1; - int xoffset = (scrollbar_needed ? -1 : 0); + int xoffset = (scrollbar_needed ? 0 : 1); int menu_screen_value_xpos = MENU_SCREEN_VALUE_XPOS + xoffset; - int menu_screen_max_xpos = MENU_SCREEN_MAX_XPOS + xoffset; int xpos = menu_screen_value_xpos; int ypos = MENU_SCREEN_START_YPOS + screen_pos; int startx = mSX + xpos * 32; @@ -7873,7 +7897,6 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) int font_nr_default = getSetupValueFont(type, value); int font_width_default = getFontWidth(font_nr_default); int font_nr = font_nr_default; - int i; if (value_string == NULL) return; @@ -7894,10 +7917,6 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) if (strlen(value_string) > max_value_len) value_string[max_value_len] = '\0'; } - else if (type & TYPE_YES_NO_AUTO) - { - xpos = menu_screen_value_xpos - 1; - } else if (type & TYPE_PLAYER) { int displayed_player_nr = *(int *)value + 1; @@ -7908,28 +7927,9 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) startx = mSX + xpos * 32; starty = mSY + ypos * 32; - // special check if right-side setup values moved left due to scrollbar - if (scrollbar_needed && xpos > MENU_SCREEN_START_XPOS) - { - int max_menu_text_length = 26; // maximum text length for classic menu - int font_xoffset = getFontDrawOffsetX(font_nr); - int text_startx = mSX + MENU_SCREEN_START_XPOS * 32; - int text_font_nr = getMenuTextFont(FONT_MENU_2); - int text_font_xoffset = getFontDrawOffsetX(text_font_nr); - int text_width = max_menu_text_length * getFontWidth(text_font_nr); - - if (startx + font_xoffset < text_startx + text_width + text_font_xoffset) - { - // when using narrow font, left-shifting text "auto" not needed - if (type & TYPE_YES_NO_AUTO) - xpos += 1; - - xpos += 1; - startx = mSX + xpos * 32; - - font_nr = getSetupValueFontNarrow(type, font_nr); - } - } + // always use narrow font for setup values on right screen side + if (xpos > MENU_SCREEN_START_XPOS) + font_nr = getSetupValueFontNarrow(type, font_nr); // downward compatibility correction for Juergen Bonhagen's menu settings if (setup_mode != SETUP_MODE_INPUT) @@ -7969,9 +7969,7 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) } } - for (i = 0; i <= menu_screen_max_xpos - xpos; i++) - DrawText(startx + i * font_width_default, starty, " ", font_nr_default); - + DrawBackground(startx, starty, mx_right_border - startx, getFontHeight(font_nr)); DrawText(startx, starty, value_string, font_nr); if (type & TYPE_PLAYER) @@ -10287,7 +10285,7 @@ static void MapScreenGadgets(int num_entries) MapGadget(screen_gadget[scrollbar_info[i].gadget_id]); } -static void UnmapScreenGadgets() +static void UnmapScreenGadgets(void) { int i;