- xpos = MENU_SCREEN_VALUE_XPOS - 1;
- }
-
- startx = mSX + xpos * 32;
- starty = mSY + ypos * 32;
- font_nr = getSetupValueFont(type, value);
- font_width = getFontWidth(font_nr);
-#if 0
- font_height = getFontHeight(font_nr);
-#endif
-
- /* downward compatibility correction for Juergen Bonhagen's menu settings */
- if (setup_mode != SETUP_MODE_INPUT)
- {
- int check_font_nr = FONT_OPTION_ON; /* known font that needs correction */
- int font1_xoffset = getFontBitmapInfo(font_nr)->draw_xoffset;
- int font2_xoffset = getFontBitmapInfo(check_font_nr)->draw_xoffset;
- int text_startx = mSX + MENU_SCREEN_START_XPOS * 32;
- int text_font_nr = getSetupTextFont(FONT_MENU_2);
- int text_font_xoffset = getFontBitmapInfo(text_font_nr)->draw_xoffset;
- int text_width = MAX_MENU_TEXT_LENGTH_MEDIUM * getFontWidth(text_font_nr);
- boolean correct_font_draw_xoffset = FALSE;
-
- if (xpos == MENU_SCREEN_START_XPOS &&
- startx + font1_xoffset < text_startx + text_font_xoffset)
- correct_font_draw_xoffset = TRUE;
-
- if (xpos == MENU_SCREEN_VALUE_XPOS &&
- startx + font2_xoffset < text_startx + text_width + text_font_xoffset)
- correct_font_draw_xoffset = TRUE;
-
- /* check if setup value would overlap with setup text when printed */
- /* (this can happen for extreme/wrong values for font draw offset) */
- if (correct_font_draw_xoffset)
- {
- font_draw_xoffset_old = getFontBitmapInfo(font_nr)->draw_xoffset;
- font_draw_xoffset_modified = TRUE;
-
- if (type & TYPE_KEY)
- getFontBitmapInfo(font_nr)->draw_xoffset += 2 * getFontWidth(font_nr);
- else if (!(type & TYPE_STRING))
- getFontBitmapInfo(font_nr)->draw_xoffset = text_font_xoffset + 20 -
- MAX_MENU_TEXT_LENGTH_MEDIUM * (16 - getFontWidth(text_font_nr));
- }
- }
-
-#if 0
- DrawBackground(startx, starty, SX + SXSIZE - startx, font_height);
-#else
- for (i = 0; i <= MENU_SCREEN_MAX_XPOS - xpos; i++)
- DrawText(startx + i * font_width, starty, " ", font_nr);
-#endif
-
- DrawText(startx, starty, value_string, font_nr);
-
- if (font_draw_xoffset_modified)
- getFontBitmapInfo(font_nr)->draw_xoffset = font_draw_xoffset_old;
-}
-#endif
-
-#if 1
-static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx)
-{
- int si_pos = (setup_info_pos_raw < 0 ? screen_pos : setup_info_pos_raw);
- struct TokenInfo *si = &setup_info[si_pos];
-
- if (si->type & TYPE_BOOLEAN_STYLE)
- {
- *(boolean *)si->value ^= TRUE;
- }
- else if (si->type & TYPE_YES_NO_AUTO)
- {
- *(int *)si->value =
- (dx == -1 ?
- (*(int *)si->value == AUTO ? TRUE :
- *(int *)si->value == TRUE ? FALSE : AUTO) :
- (*(int *)si->value == TRUE ? AUTO :
- *(int *)si->value == AUTO ? FALSE : TRUE));
- }
- else if (si->type & TYPE_KEY)
- {
- Key key;