From 88e888ae8d3ba22caa8b7164011802647662f83c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 23 Mar 2023 11:26:25 -0500 Subject: [PATCH] Move legacy FinishUpdate draws to i_video_common --- src/hwr2/pass_software.cpp | 65 ---------------------------------- src/i_video_common.cpp | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 65 deletions(-) diff --git a/src/hwr2/pass_software.cpp b/src/hwr2/pass_software.cpp index a95576f34..bee9a2234 100644 --- a/src/hwr2/pass_software.cpp +++ b/src/hwr2/pass_software.cpp @@ -12,73 +12,10 @@ #include "../i_video.h" #include "../v_video.h" -#include "../d_netcmd.h" -#ifdef HAVE_DISCORDRPC -#include "../discord.h" -#endif -#include "../doomstat.h" -#ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES -#include "../m_avrecorder.h" -#endif -#include "../st_stuff.h" -#include "../s_sound.h" -#include "../st_stuff.h" -#include "../v_video.h" - using namespace srb2; using namespace srb2::hwr2; using namespace srb2::rhi; -static void temp_legacy_finishupdate_draws() -{ - SCR_CalculateFPS(); - if (st_overlay) - { - if (cv_songcredits.value) - HU_DrawSongCredits(); - - if (cv_ticrate.value) - SCR_DisplayTicRate(); - - if (cv_showping.value && netgame && (consoleplayer != serverplayer || !server_lagless)) - { - if (server_lagless) - { - if (consoleplayer != serverplayer) - SCR_DisplayLocalPing(); - } - else - { - for (int player = 1; player < MAXPLAYERS; player++) - { - if (D_IsPlayerHumanAndGaming(player)) - { - SCR_DisplayLocalPing(); - break; - } - } - } - } - if (cv_mindelay.value && consoleplayer == serverplayer && Playing()) - SCR_DisplayLocalPing(); -#ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES - M_AVRecorder_DrawFrameRate(); -#endif - } - - if (marathonmode) - SCR_DisplayMarathonInfo(); - - // draw captions if enabled - if (cv_closedcaptioning.value) - SCR_ClosedCaptions(); - -#ifdef HAVE_DISCORDRPC - if (discordRequestList != NULL) - ST_AskToJoinEnvelope(); -#endif -} - SoftwarePass::SoftwarePass() : Pass() { } @@ -96,8 +33,6 @@ void SoftwarePass::prepass(Rhi& rhi) // Assume it's already been done and vid.buffer contains the composited splitscreen view. // In the future though, we will want to treat each player viewport separately for postprocessing. - temp_legacy_finishupdate_draws(); - // Prepare RHI resources if (screen_texture_ && (static_cast(width_) != vid.width || static_cast(height_) != vid.height)) { diff --git a/src/i_video_common.cpp b/src/i_video_common.cpp index e12cb712a..f9acae777 100644 --- a/src/i_video_common.cpp +++ b/src/i_video_common.cpp @@ -36,6 +36,20 @@ #include "sdl/ogl_sdl.h" #include "st_stuff.h" // kill +// Legacy FinishUpdate Draws +#include "d_netcmd.h" +#ifdef HAVE_DISCORDRPC +#include "discord.h" +#endif +#include "doomstat.h" +#ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES +#include "m_avrecorder.h" +#endif +#include "st_stuff.h" +#include "s_sound.h" +#include "st_stuff.h" +#include "v_video.h" + using namespace srb2; using namespace srb2::hwr2; using namespace srb2::rhi; @@ -117,6 +131,56 @@ static void finish_legacy_ogl_update() } #endif +static void temp_legacy_finishupdate_draws() +{ + SCR_CalculateFPS(); + if (st_overlay) + { + if (cv_songcredits.value) + HU_DrawSongCredits(); + + if (cv_ticrate.value) + SCR_DisplayTicRate(); + + if (cv_showping.value && netgame && (consoleplayer != serverplayer || !server_lagless)) + { + if (server_lagless) + { + if (consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + } + else + { + for (int player = 1; player < MAXPLAYERS; player++) + { + if (D_IsPlayerHumanAndGaming(player)) + { + SCR_DisplayLocalPing(); + break; + } + } + } + } + if (cv_mindelay.value && consoleplayer == serverplayer && Playing()) + SCR_DisplayLocalPing(); +#ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES + M_AVRecorder_DrawFrameRate(); +#endif + } + + if (marathonmode) + SCR_DisplayMarathonInfo(); + + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + +#ifdef HAVE_DISCORDRPC + if (discordRequestList != NULL) + ST_AskToJoinEnvelope(); +#endif +} + static InternalPassData build_pass_manager() { auto framebuffer_manager = std::make_shared(); @@ -364,6 +428,8 @@ void I_FinishUpdate(void) } #endif + temp_legacy_finishupdate_draws(); + rhi::Rhi* rhi = sys::get_rhi(sys::g_current_rhi); if (rhi == nullptr) @@ -392,6 +458,8 @@ void I_FinishUpdateWipeStartScreen(void) } #endif + temp_legacy_finishupdate_draws(); + rhi::Rhi* rhi = sys::get_rhi(sys::g_current_rhi); if (rhi == nullptr) @@ -420,6 +488,8 @@ void I_FinishUpdateWipeEndScreen(void) } #endif + temp_legacy_finishupdate_draws(); + rhi::Rhi* rhi = sys::get_rhi(sys::g_current_rhi); if (rhi == nullptr) @@ -448,6 +518,8 @@ void I_FinishUpdateWipe(void) } #endif + temp_legacy_finishupdate_draws(); + rhi::Rhi* rhi = sys::get_rhi(sys::g_current_rhi); if (rhi == nullptr)