diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 2681ffa56..ae4e41efd 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2343,12 +2343,13 @@ Ping_gfx_color (int lag) // // HU_drawPing // -void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, INT32 flags, boolean offline) +void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, INT32 flags, boolean offline, SINT8 toside) { UINT8 *colormap = NULL; INT32 measureid = cv_pingmeasurement.value ? 1 : 0; INT32 gfxnum; // gfx to draw boolean drawlocal = (offline && cv_mindelay.value && lag <= (tic_t)cv_mindelay.value); + fixed_t x2, y2; if (!server && lag <= (tic_t)cv_mindelay.value) { @@ -2356,13 +2357,35 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, INT32 flags, boolean offline) drawlocal = true; } + x2 = x; + y2 = y + FRACUNIT; + + if (toside == 0) + { + if (measureid == 1) + { + x2 += ((11 - pingmeasure[measureid]->width) * FRACUNIT); + } + else + { + x2 += (10 * FRACUNIT); + } + + y2 += (8 * FRACUNIT); + } + else if (toside > 0) + { + x2 += (20 * FRACUNIT); + } + //else if (toside < 0) + gfxnum = Ping_gfx_num(lag); if (measureid == 1) { V_DrawFixedPatch( - x + ((11 - pingmeasure[measureid]->width) * FRACUNIT), - y + (9 * FRACUNIT), + x2, + y2, FRACUNIT, flags, pingmeasure[measureid], NULL @@ -2403,9 +2426,9 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, INT32 flags, boolean offline) lag = (INT32)(lag * (1000.00f / TICRATE)); } - x = V_DrawPingNum( - x + (((measureid == 1) ? 11 - pingmeasure[measureid]->width : 10) * FRACUNIT), - y + (9 * FRACUNIT), + x2 = V_DrawPingNum( + x2, + y2, flags, lag, colormap ); @@ -2413,8 +2436,8 @@ void HU_drawPing(fixed_t x, fixed_t y, UINT32 lag, INT32 flags, boolean offline) if (measureid == 0) { V_DrawFixedPatch( - x + ((1 - pingmeasure[measureid]->width) * FRACUNIT), - y + (9 * FRACUNIT), + x2 + ((1 - pingmeasure[measureid]->width) * FRACUNIT), + y2, FRACUNIT, flags, pingmeasure[measureid], NULL diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 084a7d51b..6e647e401 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -146,7 +146,7 @@ void HU_TickSongCredits(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, INT32 flags, boolean offline); // Lat': Ping drawer for scoreboard. +void HU_drawPing(fixed_t x, fixed_t y, UINT32 ping, INT32 flags, boolean offline, SINT8 toside); // Lat': Ping drawer for scoreboard. void HU_drawMiniPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // CECHO interface. diff --git a/src/screen.c b/src/screen.c index 1b10c0373..b584cb9f8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -660,7 +660,7 @@ void SCR_DisplayLocalPing(void) { INT32 dispy = cv_ticrate.value ? 160 : 181; offline = (consoleplayer == serverplayer); - HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM | V_HUDTRANS, offline); + HU_drawPing(307 * FRACUNIT, dispy * FRACUNIT, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM | V_HUDTRANS, offline, 0); } } diff --git a/src/y_inter.c b/src/y_inter.c index 9f570e997..7c15b4453 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -413,9 +413,12 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) SINT8 yspacing = 14; INT32 heightcount = (standings->numplayers - 1); - INT32 x, y, returny; + INT32 x, y; + INT32 x2, returny; boolean verticalresults = (standings->numplayers < 4); + boolean datarightofcolumn = false; + boolean drawping = (netgame && gamestate == GS_LEVEL); INT32 hilicol = highlightflags; @@ -424,6 +427,11 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) if (verticalresults) { x = (BASEVIDWIDTH/2) - 61; + + if (drawping) + { + x += 9; + } } else { @@ -432,6 +440,7 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) } x += xoffset; + x2 = x - 9; if (standings->numplayers > 10) { @@ -535,6 +544,28 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) standings->strval[i] ); + if (drawping) + { + if (players[pnum].bot) + { + /*V_DrawScaledPatch( + x2, y-1, + 0, + kp_cpu + );*/ + } + else if (pnum != serverplayer || !server_lagless) + { + HU_drawPing( + (x2 - 2) * FRACUNIT, (y-2) * FRACUNIT, + playerpingtable[pnum], + 0, + false, + (datarightofcolumn ? 1 : -1) + ); + } + } + // Reverse the jitter offset if (standings->jitter[pnum] > 0) y++; @@ -546,6 +577,9 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) { x = 169 + xoffset; y = returny; + + datarightofcolumn = true; + x2 = x + 118 + 5; } } }