diff --git a/src/hu_stuff.c b/src/hu_stuff.c index e9b3d4c41..2a0bfa90c 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -73,8 +73,6 @@ patch_t *pinggfx[5]; // small ping graphic patch_t *mping[5]; // smaller ping graphic -patch_t *tc_font[2][LT_FONTSIZE]; // Special font stuff for titlecard - patch_t *framecounter; patch_t *frameslash; // framerate stuff. Used in screen.c @@ -180,8 +178,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum); void HU_LoadGraphics(void) { - char buffer[9]; - INT32 i, j; + INT32 i; if (dedicated) return; @@ -194,27 +191,6 @@ void HU_LoadGraphics(void) emblemicon = HU_CachePatch("EMBLICON"); songcreditbg = HU_CachePatch("K_SONGCR"); - // Cache titlecard font - j = LT_FONTSTART; - for (i = 0; i < LT_FONTSIZE; i++, j++) - { - // cache the titlecard font - - // Bottom layer - sprintf(buffer, "GTOL%.3d", j); - if (W_CheckNumForName(buffer) == LUMPERROR) - tc_font[0][i] = NULL; - else - tc_font[0][i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); - - // Top layer - sprintf(buffer, "GTFN%.3d", j); - if (W_CheckNumForName(buffer) == LUMPERROR) - tc_font[1][i] = NULL; - else - tc_font[1][i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); - } - // cache ping gfx: for (i = 0; i < 5; i++) { @@ -279,6 +255,16 @@ void HU_Init(void) PR ("CRFNT"); REG; + DIG (3); + + ADIM (LT); + + PR ("GTOL"); + REG; + + PR ("GTFN"); + REG; + DIG (1); DIM (0, 10); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index a8d8bee22..392ae27a2 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -39,11 +39,6 @@ #define LT_FONTEND 'z' // the last font characters #define LT_FONTSIZE (LT_FONTEND - LT_FONTSTART + 1) -// Under regular circumstances, we'd use the built in font stuff, however this font is a bit messy because of how we're gonna draw shit. -// tc_font[0][n] is used for the "bottom" layer -// tc_font[1][n] is used for the "top" layer -extern patch_t *tc_font[2][LT_FONTSIZE]; - #define CRED_FONTSTART '!' // the first font character #define CRED_FONTEND 'Z' // the last font character #define CRED_FONTSIZE (CRED_FONTEND - CRED_FONTSTART + 1) @@ -59,6 +54,9 @@ enum X (LT), X (CRED), + X (GTOL), + X (GTFN), + X (TALLNUM), X (NIGHTSNUM), X (PINGNUM), diff --git a/src/v_video.c b/src/v_video.c index 5bd7ba733..6367006d7 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1701,13 +1701,13 @@ INT32 V_TitleCardStringWidth(const char *str) c -= LT_FONTSTART; // check if character exists, if not, it's a space. - if (c < 0 || c >= LT_FONTSIZE || !tc_font[0][(INT32)c]) + if (c < 0 || c >= LT_FONTSIZE || !fontv[GTOL_FONT].font[(INT32)c]) { xoffs += 10; continue; } - pp = tc_font[1][(INT32)c]; + pp = fontv[GTFN_FONT].font[(INT32)c]; xoffs += pp->width-5; } @@ -1768,14 +1768,14 @@ void V_DrawTitleCardString(INT32 x, INT32 y, const char *str, INT32 flags, boole c -= LT_FONTSTART; // check if character exists, if not, it's a space. - if (c < 0 || c >= LT_FONTSIZE || !tc_font[1][(INT32)c]) + if (c < 0 || c >= LT_FONTSIZE || !fontv[GTFN_FONT].font[(INT32)c]) { xoffs += 10; continue; } - ol = tc_font[0][(INT32)c]; - pp = tc_font[1][(INT32)c]; + ol = fontv[GTOL_FONT].font[(INT32)c]; + pp = fontv[GTFN_FONT].font[(INT32)c]; if (timer) {