From 1fb65c72ff0b1db2546830bf825b19da75b42d9e Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 18:52:57 -0600 Subject: [PATCH] Reorganization + kill old interfaces --- src/djgppdos/i_video.c | 5 ----- src/hu_stuff.c | 15 --------------- src/hu_stuff.h | 1 - src/screen.c | 13 +++++++++++++ src/screen.h | 1 + src/sdl/i_video.c | 8 +++----- src/sdl12/i_video.c | 5 ----- src/win32/win_vid.c | 5 ----- src/win32ce/win_vid.c | 5 ----- 9 files changed, 17 insertions(+), 41 deletions(-) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 69addfb0..612c7221 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -41,7 +41,6 @@ #include "../m_argv.h" #include "vid_vesa.h" #include "../i_video.h" -#include "../hu_stuff.h" //dosstuff -newly added @@ -94,10 +93,6 @@ void I_FinishUpdate (void) // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); //blast it to the screen // this code sucks diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 175c8bf3..1ae48886 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2199,21 +2199,6 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans< servermaxping)) // only show 2 (warning) if our ping is at a bad level - { - INT32 dispy = cv_ticrate.value ? 160 : 181; - HU_drawPing(307, dispy, ping, V_SNAPTORIGHT|V_SNAPTOBOTTOM); - } -} // Heads up displays drawer, call each frame // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 6788c701..0f316bc7 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -109,7 +109,6 @@ void HU_Start(void); boolean HU_Responder(event_t *ev); void HU_Ticker(void); -void HU_drawLocalPing(void); void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); diff --git a/src/screen.c b/src/screen.c index 937d6caa..4de2abd0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -434,3 +434,16 @@ void SCR_DisplayTicRate(void) lasttic = ontic; } + +// SCR_DisplayLocalPing +// Used to draw the user's local ping next to the framerate for a quick check without having to hold TAB for instance. By default, it only shows up if your ping is too high and risks getting you kicked. + +void SCR_DisplayLocalPing(void) +{ + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level + { + INT32 dispy = cv_ticrate.value ? 160 : 181; + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM); + } +} diff --git a/src/screen.h b/src/screen.h index 9ad254d3..5b4a8e58 100644 --- a/src/screen.h +++ b/src/screen.h @@ -180,5 +180,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height); // move out to main code for consistency void SCR_DisplayTicRate(void); +void SCR_DisplayLocalPing(void); #undef DNWH #endif //__SCREEN_H__ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 9e5e4b60..39a2c5ef 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -67,7 +67,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" // ping drawer #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1361,10 +1360,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); + + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); if (rendermode == render_soft && screens[0]) { diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 08e6bd94..69cf5ca9 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -99,7 +99,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1343,10 +1342,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); if (render_soft == rendermode && screens[0]) { diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index cba0c209..9f3d13f8 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -28,7 +28,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -366,10 +365,6 @@ void I_FinishUpdate(void) // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); // if (bDIBMode) diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index c6610fa0..5e8e7e1f 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -26,7 +26,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -199,10 +198,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); - // if (bDIBMode) {