Draw PINGD before delay number

This commit is contained in:
James R 2022-08-19 21:12:43 -07:00 committed by toaster
parent 795aa4b73f
commit a477182ea7
3 changed files with 10 additions and 4 deletions

View file

@ -2329,7 +2329,8 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags)
gfxnum = Ping_gfx_num(lag); gfxnum = Ping_gfx_num(lag);
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]); if (measureid == 1)
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]); V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
if (servermaxping && lag > servermaxping && hu_tick < 4) if (servermaxping && lag > servermaxping && hu_tick < 4)
@ -2343,7 +2344,10 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags)
lag = (INT32)(lag * (1000.00f / TICRATE)); lag = (INT32)(lag * (1000.00f / TICRATE));
} }
V_DrawPingNum(x+11 - pingmeasure[measureid]->width, y+9, flags, lag, colormap); x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+9, flags, lag, colormap);
if (measureid == 0)
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
} }
void void

View file

@ -2247,7 +2247,7 @@ void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, con
// Draws a number using the PING font thingy. // Draws a number using the PING font thingy.
// TODO: Merge number drawing functions into one with "font name" selection. // TODO: Merge number drawing functions into one with "font name" selection.
void V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap) INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap)
{ {
INT32 w = SHORT(fontv[PINGNUM_FONT].font[0]->width); // this SHOULD always be 5 but I guess custom graphics exist. INT32 w = SHORT(fontv[PINGNUM_FONT].font[0]->width); // this SHOULD always be 5 but I guess custom graphics exist.
@ -2264,6 +2264,8 @@ void V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colorm
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, flags, fontv[PINGNUM_FONT].font[num%10], colormap); V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, flags, fontv[PINGNUM_FONT].font[num%10], colormap);
num /= 10; num /= 10;
} while (num); } while (num);
return x;
} }
// Find string width from cred_font chars // Find string width from cred_font chars

View file

@ -280,7 +280,7 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits)
// Draw ping numbers. Used by the scoreboard and that one ping option. :P // Draw ping numbers. Used by the scoreboard and that one ping option. :P
// This is a separate function because IMO lua should have access to it as well. // This is a separate function because IMO lua should have access to it as well.
void V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap); INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap);
// Find string width from lt_font chars // Find string width from lt_font chars
INT32 V_LevelNameWidth(const char *string); INT32 V_LevelNameWidth(const char *string);