HUD: fix alignment of delay indicator digits

- Tab
  - Fix alignment on right side of tab rankings
  - Fix alignment in milliseconds mode
- Fix packet loss indicator overlapping ms graphic
This commit is contained in:
James R 2024-04-27 04:18:31 -07:00
parent 1bf2b9a7db
commit 64a4bcad34

View file

@ -2218,11 +2218,7 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, UINT32 pl, INT32 flags, boole
if (toside == 0)
{
if (measureid == 1)
{
x2 += ((11 - pingmeasure[measureid]->width) * FRACUNIT);
}
else
if (measureid == 0)
{
x2 += (10 * FRACUNIT);
}
@ -2231,23 +2227,25 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, UINT32 pl, INT32 flags, boole
}
else if (toside > 0)
{
x2 += (20 * FRACUNIT);
// V_DrawPingNum
const fixed_t w = (fontv[PINGNUM_FONT].font[0]->width) * FRACUNIT - FRACUNIT;
x2 += (16 * FRACUNIT) + (int)(log(Ping_conversion(lag)) / log(10)) * w;
if (measureid == 0)
{
x2 += (4 * FRACUNIT);
}
}
else if (toside < 0)
{
if (measureid == 1)
{
x2 -= (pingmeasure[measureid]->width * FRACUNIT);
}
}
//else if (toside < 0)
gfxnum = Ping_gfx_num(lag);
if (measureid == 1)
{
V_DrawFixedPatch(
x2,
y2,
FRACUNIT, flags,
pingmeasure[measureid],
NULL
);
}
if (pl)
{
V_DrawFill(
@ -2280,6 +2278,17 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, UINT32 pl, INT32 flags, boole
);
}
if (measureid == 1)
{
V_DrawFixedPatch(
x2,
y2,
FRACUNIT, flags,
pingmeasure[measureid],
NULL
);
}
colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(lag), GTC_CACHE);
if (servermaxping && lag > servermaxping && hu_tick < 4)