mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-22 07:52:30 +00:00
Fix displayed delay number for HU_drawPing and HU_drawMiniPing
This commit is contained in:
parent
3e5f6466a0
commit
bf381730bd
3 changed files with 26 additions and 31 deletions
|
|
@ -2224,12 +2224,13 @@ PL_gfx_color (int pl)
|
||||||
//
|
//
|
||||||
// HU_drawPing
|
// HU_drawPing
|
||||||
//
|
//
|
||||||
void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, UINT32 lag, UINT32 pl, INT32 flags, SINT8 toside)
|
void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags, SINT8 toside)
|
||||||
{
|
{
|
||||||
const UINT8 *colormap = NULL;
|
const UINT8 *colormap = NULL;
|
||||||
INT32 measureid = cv_pingmeasurement.value ? 1 : 0;
|
INT32 measureid = cv_pingmeasurement.value ? 1 : 0;
|
||||||
INT32 gfxnum; // gfx to draw
|
patch_t *gfx; // gfx to draw
|
||||||
fixed_t x2, y2;
|
fixed_t x2, y2;
|
||||||
|
UINT32 lag = max(ping, mindelay);
|
||||||
|
|
||||||
x2 = x;
|
x2 = x;
|
||||||
y2 = y + FRACUNIT;
|
y2 = y + FRACUNIT;
|
||||||
|
|
@ -2262,39 +2263,33 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, UINT32 lag, UINT32 pl, INT32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxnum = Ping_gfx_num(ping);
|
if (ping <= mindelay)
|
||||||
|
{
|
||||||
|
gfx = pinglocal[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gfx = pinggfx[Ping_gfx_num(ping)];
|
||||||
|
}
|
||||||
|
|
||||||
if (pl)
|
if (pl)
|
||||||
{
|
{
|
||||||
V_DrawFill(
|
V_DrawFill(
|
||||||
-pinggfx[gfxnum]->leftoffset + x/FRACUNIT + 2 - 1,
|
-gfx->leftoffset + x/FRACUNIT + 2 - 1,
|
||||||
-pinggfx[gfxnum]->topoffset + y/FRACUNIT - 1,
|
-gfx->topoffset + y/FRACUNIT - 1,
|
||||||
pinggfx[gfxnum]->width + 2,
|
gfx->width + 2,
|
||||||
pinggfx[gfxnum]->height + 2,
|
gfx->height + 2,
|
||||||
PL_gfx_color(pl) | flags
|
PL_gfx_color(pl) | flags
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ping <= lag)
|
|
||||||
{
|
|
||||||
V_DrawFixedPatch(
|
V_DrawFixedPatch(
|
||||||
x + (2 * FRACUNIT),
|
x + (2 * FRACUNIT),
|
||||||
y,
|
y,
|
||||||
FRACUNIT, flags,
|
FRACUNIT, flags,
|
||||||
pinglocal[0],
|
gfx,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
V_DrawFixedPatch(
|
|
||||||
x + (2 * FRACUNIT),
|
|
||||||
y,
|
|
||||||
FRACUNIT, flags,
|
|
||||||
pinggfx[gfxnum],
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (measureid == 1)
|
if (measureid == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -2329,7 +2324,7 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, UINT32 lag, UINT32 pl, INT32
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, UINT32 lag, INT32 flags)
|
HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, INT32 flags)
|
||||||
{
|
{
|
||||||
patch_t *patch;
|
patch_t *patch;
|
||||||
INT32 w = BASEVIDWIDTH;
|
INT32 w = BASEVIDWIDTH;
|
||||||
|
|
@ -2339,7 +2334,7 @@ HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, UINT32 lag, INT32 flags)
|
||||||
w /= 2;
|
w /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ping <= lag)
|
if (ping <= mindelay)
|
||||||
patch = pinglocal[1]; // stone shoe
|
patch = pinglocal[1]; // stone shoe
|
||||||
else
|
else
|
||||||
patch = mping[Ping_gfx_num(ping)];
|
patch = mping[Ping_gfx_num(ping)];
|
||||||
|
|
|
||||||
|
|
@ -5537,7 +5537,7 @@ Draw_party_ping (int ss, INT32 snap)
|
||||||
{
|
{
|
||||||
UINT32 ping = playerpingtable[displayplayers[ss]];
|
UINT32 ping = playerpingtable[displayplayers[ss]];
|
||||||
UINT32 mindelay = playerdelaytable[displayplayers[ss]];
|
UINT32 mindelay = playerdelaytable[displayplayers[ss]];
|
||||||
HU_drawMiniPing(0, 0, ping, std::max(ping, mindelay), V_SPLITSCREEN|V_SNAPTOTOP|snap);
|
HU_drawMiniPing(0, 0, ping, mindelay, V_SPLITSCREEN|V_SNAPTOTOP|snap);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -583,7 +583,7 @@ void SCR_DisplayLocalPing(void)
|
||||||
|
|
||||||
INT32 dispy = cv_ticrate.value ? 170 : 181;
|
INT32 dispy = cv_ticrate.value ? 170 : 181;
|
||||||
|
|
||||||
HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, max(ping, mindelay), pl, V_SNAPTORIGHT | V_SNAPTOBOTTOM, 0);
|
HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, mindelay, pl, V_SNAPTORIGHT | V_SNAPTOBOTTOM, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue