From 0647583071fc5783b419d8bc85974339026bcffe Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Jul 2020 18:15:05 -0700 Subject: [PATCH] suffering --- src/hu_stuff.h | 1 - src/lua_hudlib.c | 1 + src/m_menu.c | 2 +- src/st_stuff.c | 10 +++++----- src/v_video.c | 45 ++++++++++++--------------------------------- src/y_inter.c | 4 ++-- 6 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index b2c00be53..d7162cec3 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -48,7 +48,6 @@ enum { X (HU), X (TINY), - X (KART), X (LT), X (CRED), diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 4aa70574b..6341822ea 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -14,6 +14,7 @@ #include "fastcmp.h" #include "r_defs.h" #include "r_local.h" +#include "hu_stuff.h" // fonts #include "st_stuff.h" // hudinfo[] #include "g_game.h" #include "i_video.h" // rendermode diff --git a/src/m_menu.c b/src/m_menu.c index 98178c15c..1085ccd7c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7807,7 +7807,7 @@ static void M_DrawSoundTest(void) { V_DrawFill(165+140-9, y-4, 8, 16, 150); //V_DrawCharacter(165+140-8, y, '\x19' | V_YELLOWMAP, false); - V_DrawFixedPatch((165+140-9)<finishedspheres)); V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 148, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres * 50)); - ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<lastmarescore, nightsnum, SKINCOLOR_AZURE); + ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<lastmarescore, fontv[NIGHTSNUM_FONT].font, SKINCOLOR_AZURE); // If new record, say so! if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore) @@ -1768,7 +1768,7 @@ static void ST_drawNiGHTSLink(void) y -= (11*scale); - ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), nightsnum, colornum); + ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), fontv[NIGHTSNUM_FONT].font, colornum); V_DrawFixedPatch(x+(4*scale), y, scale, aflag, nightslink, colornum == 0 ? colormaps : R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE)); @@ -1983,7 +1983,7 @@ static void ST_drawNiGHTSHUD(void) // Score if (!stplyr->exiting && !oldspecialstage && LUA_HudEnabled(hud_nightsscore)) - ST_DrawNightsOverlayNum(304<marescore, nightsnum, SKINCOLOR_AZURE); + ST_DrawNightsOverlayNum(304<marescore, fontv[NIGHTSNUM_FONT].font, SKINCOLOR_AZURE); // TODO give this its own section for Lua if (!stplyr->exiting && LUA_HudEnabled(hud_nightsscore)) @@ -2049,7 +2049,7 @@ static void ST_drawNiGHTSHUD(void) && !(stplyr->powers[pw_shield] & SH_PROTECTWATER)) col = SKINCOLOR_ORANGE; - ST_DrawNightsOverlayNum((160 + numbersize)<width)/2, width = 0; + INT32 sz = SHORT(fontv[TALLNUM_FONT].font[0]->width)/2, width = 0; do { width += sz; diff --git a/src/v_video.c b/src/v_video.c index b0d30e210..95ee28ce6 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2013,7 +2013,7 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c]) return; - w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. + w = (vid.width < 640 ) ? (SHORT(fontv[HU_FONT].font[c]->width)/2) : (SHORT(fontv[HU_FONT].font[c]->width)); // use normal sized characters if we're using a terribly low resolution. if (x + w > vid.width) return; @@ -2098,6 +2098,7 @@ static inline fixed_t FixedCharacterDim( INT32 dupx, fixed_t * cwp) { + (void)scale; (void)hchw; (void)dupx; (*cwp) = chw; @@ -2239,20 +2240,6 @@ void V_DrawStringScaled( spacewidth = 3;*/ } break; - case KART_FONT: - spacew = 12; - switch (spacing) - { - case V_MONOSPACE: - spacew = 12; - /* FALLTHRU */ - case V_OLDSPACING: - chw = 12; - break; - case V_6WIDTHSPACE: - spacew = 6; - } - break; case LT_FONT: spacew = 12; break; @@ -2265,7 +2252,6 @@ void V_DrawStringScaled( default: case HU_FONT: case TINY_FONT: - case KART_FONT: if (( flags & V_RETURN8 )) lfh = 8; else @@ -2426,13 +2412,6 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // NOTE: the text is centered for screens larger than the base width // // Literally a wrapper. ~Golden -void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) -{ - x <<= FRACBITS; - y <<= FRACBITS; - V_DrawSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); -} - void V_DrawCenteredSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) { x <<= FRACBITS; @@ -2550,9 +2529,9 @@ void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num) while (num > 0) { if (num > 9) // if there are two digits, draw second digit first - V_DrawScaledPatch(x + (V_LevelActNumWidth(num) - V_LevelActNumWidth(num%10)), y, flags, ttlnum[num%10]); + V_DrawScaledPatch(x + (V_LevelActNumWidth(num) - V_LevelActNumWidth(num%10)), y, flags, fontv[TTLNUM_FONT].font[num%10]); else - V_DrawScaledPatch(x, y, flags, ttlnum[num]); + V_DrawScaledPatch(x, y, flags, fontv[TTLNUM_FONT].font[num]); num = num/10; } } @@ -2601,13 +2580,13 @@ static void V_DrawNameTagLine(INT32 x, INT32 y, INT32 option, fixed_t scale, UIN c -= NT_FONTSTART; // character does not exist or is a space - if (c < 0 || c >= NT_FONTSIZE || !ntb_font[c] || !nto_font[c]) + if (c < 0 || c >= NT_FONTSIZE || !fontv[NTB_FONT].font[c] || !fontv[NTO_FONT].font[c]) { cx += FixedMul((4 * dupx)*FRACUNIT, scale); continue; } - w = FixedMul((SHORT(ntb_font[c]->width)+2 * dupx) * FRACUNIT, scale); + w = FixedMul((SHORT(fontv[NTB_FONT].font[c]->width)+2 * dupx) * FRACUNIT, scale); if (FixedInt(cx) > scrwidth) continue; @@ -2617,8 +2596,8 @@ static void V_DrawNameTagLine(INT32 x, INT32 y, INT32 option, fixed_t scale, UIN continue; } - V_DrawFixedPatch(cx, cy, scale, option, nto_font[c], outlinecolormap); - V_DrawFixedPatch(cx, cy, scale, option, ntb_font[c], basecolormap); + V_DrawFixedPatch(cx, cy, scale, option, fontv[NTO_FONT].font[c], outlinecolormap); + V_DrawFixedPatch(cx, cy, scale, option, fontv[NTB_FONT].font[c], basecolormap); cx += w; } @@ -2745,10 +2724,10 @@ INT32 V_NameTagWidth(const char *string) for (i = 0; i < strlen(string); i++) { c = toupper(string[i]) - NT_FONTSTART; - if (c < 0 || c >= NT_FONTSIZE || !ntb_font[c] || !nto_font[c]) + if (c < 0 || c >= NT_FONTSIZE || !fontv[NTB_FONT].font[c] || !fontv[NTO_FONT].font[c]) w += 4; else - w += SHORT(ntb_font[c]->width)+2; + w += SHORT(fontv[NTB_FONT].font[c]->width)+2; } return w; @@ -2826,11 +2805,11 @@ INT16 V_LevelActNumWidth(UINT8 num) INT16 result = 0; if (num == 0) - result = SHORT(ttlnum[num]->width); + result = SHORT(fontv[TTLNUM_FONT].font[num]->width); while (num > 0 && num <= 99) { - result = result + SHORT(ttlnum[num%10]->width); + result = result + SHORT(fontv[TTLNUM_FONT].font[num%10]->width); num = num/10; } diff --git a/src/y_inter.c b/src/y_inter.c index 58e0c4a88..d1606383b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -429,7 +429,7 @@ dontdrawbg: V_DrawScaledPatch(152, bonusy, 0, data.coop.ptotal); V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.total); } - bonusy -= (3*SHORT(tallnum[0]->height)/2) + 1; + bonusy -= (3*SHORT(fontv[TALLNUM_FONT].font[0]->height)/2) + 1; // Draw bonuses for (i = 3; i >= 0; --i) @@ -439,7 +439,7 @@ dontdrawbg: V_DrawScaledPatch(152, bonusy, 0, data.coop.bonuspatches[i]); V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.bonuses[i].points); } - bonusy -= (3*SHORT(tallnum[0]->height)/2) + 1; + bonusy -= (3*SHORT(fontv[TALLNUM_FONT].font[0]->height)/2) + 1; } } else if (intertype == int_spec)