diff --git a/src/hu_stuff.c b/src/hu_stuff.c index b7a4a43b9..10ea6de04 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -232,25 +232,12 @@ void HU_LoadGraphics(void) nto_font.chars[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); } - hu_font.kerning = 0; - hu_font.spacewidth = 4; - hu_font.linespacing = 12; - - tny_font.kerning = 0; - tny_font.spacewidth = 2; - tny_font.linespacing = 12; - - cred_font.kerning = 0; - cred_font.spacewidth = 16; - cred_font.linespacing = 16; - - lt_font.kerning = 0; - lt_font.spacewidth = 16; - lt_font.linespacing = 20; - - ntb_font.kerning = nto_font.kerning = 0; - ntb_font.spacewidth = nto_font.spacewidth = 4; - ntb_font.linespacing = nto_font.linespacing = 21; + HU_LoadFontProperties(&hu_font, 0, 4, 12); + HU_LoadFontProperties(&tny_font, 0, 2, 12); + HU_LoadFontProperties(&cred_font, 0, 16, 16); + HU_LoadFontProperties(<_font, 0, 16, 20); + HU_LoadFontProperties(&ntb_font, 0, 4, 21); + HU_LoadFontProperties(&nto_font, 0, 4, 21); //cache numbers too! for (i = 0; i < 10; i++) @@ -308,6 +295,13 @@ void HU_LoadGraphics(void) //emeraldpics[2][7] = W_CachePatchName("EMBOX8", PU_HUDGFX); -- unused } +void HU_LoadFontProperties(fontdef_t *font, INT32 kerning, UINT32 spacewidth, UINT32 linespacing) +{ + font->kerning = kerning; + font->spacewidth = spacewidth; + font->linespacing = linespacing; +} + // Initialise Heads up // once at game startup. // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 2ecafd04a..fc70a4ec3 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -94,6 +94,7 @@ void HU_Init(void); void HU_LoadGraphics(void); +void HU_LoadFontProperties(fontdef_t *font, INT32 k, UINT32 sw, UINT32 ls); // reset heads up when consoleplayer respawns. void HU_Start(void);