mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
remove one pixel trimming for each font character in setup menu (#926)
* set menu font spacing based on font width
This commit is contained in:
parent
f49693b204
commit
60573fa667
@ -2430,6 +2430,7 @@ void D_DoomMain(void)
|
||||
|
||||
puts("HU_Init: Setting up heads up display.");
|
||||
HU_Init();
|
||||
M_SetMenuFontSpacing();
|
||||
|
||||
puts("ST_Init: Init status bar.");
|
||||
ST_Init();
|
||||
|
14
src/m_menu.c
14
src/m_menu.c
@ -5019,6 +5019,8 @@ setup_menu_t helpstrings[] = // HELP screen strings
|
||||
|
||||
#define SPACEWIDTH 4
|
||||
|
||||
static int menu_font_spacing = 0;
|
||||
|
||||
// M_DrawMenuString() draws the string in menu_buffer[]
|
||||
|
||||
void M_DrawStringCR(int cx, int cy, char *color, const char *ch)
|
||||
@ -5046,7 +5048,7 @@ void M_DrawStringCR(int cx, int cy, char *color, const char *ch)
|
||||
|
||||
// The screen is cramped, so trim one unit from each
|
||||
// character so they butt up against each other.
|
||||
cx += w - 1;
|
||||
cx += w + menu_font_spacing;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5088,9 +5090,9 @@ int M_GetPixelWidth(const char *ch)
|
||||
continue;
|
||||
}
|
||||
len += SHORT (hu_font[c]->width);
|
||||
len--; // adjust so everything fits
|
||||
len += menu_font_spacing; // adjust so everything fits
|
||||
}
|
||||
len++; // replace what you took away on the last char only
|
||||
len -= menu_font_spacing; // replace what you took away on the last char only
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -7030,6 +7032,12 @@ void M_Init(void)
|
||||
}
|
||||
}
|
||||
|
||||
void M_SetMenuFontSpacing(void)
|
||||
{
|
||||
if (M_StringWidth("abcdefghijklmnopqrstuvwxyz01234") > 230)
|
||||
menu_font_spacing = -1;
|
||||
}
|
||||
|
||||
// killough 10/98: allow runtime changing of menu order
|
||||
|
||||
void M_ResetMenu(void)
|
||||
|
@ -79,6 +79,8 @@ void M_ResetTimeScale(void);
|
||||
|
||||
void M_DrawCredits(void); // killough 11/98
|
||||
|
||||
void M_SetMenuFontSpacing(void);
|
||||
|
||||
// killough 8/15/98: warn about changes not being committed until next game
|
||||
#define warn_about_changes(x) (warning_about_changes=(x), \
|
||||
print_warning_about_changes = 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user