From 8a62f4e9783ad6dcdcc7e66201b43f22fbfb7632 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 13 Jul 2026 07:40:13 +0200 Subject: [PATCH] software: move hom removal to R_RenderPlayerView gl also has it there so why not --- src/d_main.c | 14 -------------- src/r_main.cpp | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 2150b1e72..ed0e0199e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -275,20 +275,6 @@ static void D_Renderview(void) R_ApplyLevelInterpolators(R_GetTimeFrac(RTF_LEVEL)); - if (rendermode == render_soft && cv_homremoval.value) - { - if (cv_homremoval.value == 1) - { - // Clear the software screen buffer to remove HOM - memset(vid.screens[0], 31, vid.width * vid.height); - } - else if (cv_homremoval.value == 2) - { - //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. - memset(vid.screens[0], 32+(timeinmap&15), vid.width * vid.height); - } - } - for (i = 0; i <= splitscreen; i++) { if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD) diff --git a/src/r_main.cpp b/src/r_main.cpp index d2b6eed65..d6fe70c2d 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1389,6 +1389,21 @@ void R_RenderPlayerView(player_t *player) maskcount_t* masks = static_cast(malloc(sizeof(maskcount_t))); const boolean skybox = (skyboxmo[0] && cv_skybox.value); + // Only do it if it's the first screen being rendered + if (cv_homremoval.value && viewssnum == 0) + { + if (cv_homremoval.value == 1) + { + // Clear the software screen buffer to remove HOM + memset(vid.screens[0], 31, vid.width * vid.height); + } + else if (cv_homremoval.value == 2) + { + //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. + memset(vid.screens[0], 32+(timeinmap&15), vid.width * vid.height); + } + } + // load previous saved value of skyVisible for the player skyVisible = skyVisiblePerPlayer[viewssnum]; @@ -1455,10 +1470,12 @@ void R_RenderPlayerView(player_t *player) NetUpdate(); R_SetColumnContext(COLUMNCONTEXT_FLUSH); + ps_numbspcalls.value.i = ps_numpolyobjects.value.i = ps_numdrawnodes.value.i = 0; PS_START_TIMING(ps_bsptime); R_RenderViewpoint(&masks[nummasks - 1], true); PS_STOP_TIMING(ps_bsptime); + PS_START_TIMING(ps_sw_spritecliptime); R_ClipSprites(drawsegs, NULL); PS_STOP_TIMING(ps_sw_spritecliptime); @@ -1466,8 +1483,8 @@ void R_RenderPlayerView(player_t *player) ps_numsprites.value.i = numvisiblesprites; - PS_START_TIMING(ps_sw_portaltime); // Portal rendering. Hijacks the BSP traversal. + PS_START_TIMING(ps_sw_portaltime); if (portal_base) { portal_t *portal; @@ -1517,6 +1534,7 @@ void R_RenderPlayerView(player_t *player) PS_START_TIMING(ps_sw_maskedtime); R_DrawMasked(masks, nummasks); PS_STOP_TIMING(ps_sw_maskedtime); + free(masks); // Check for new console commands.