Move legacy FinishUpdate draws to i_video_common

This commit is contained in:
Eidolon 2023-03-23 11:26:25 -05:00
parent ecf785f405
commit 88e888ae8d
2 changed files with 72 additions and 65 deletions

View file

@ -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<int32_t>(width_) != vid.width || static_cast<int32_t>(height_) != vid.height))
{

View file

@ -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<FramebufferManager>();
@ -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)