Move HOM removal from R_RenderPlayerView to D_Display

This lets duplicate displayplayers[0] render correctly,
since repeating occurrences of displayplayers[0] won't
clear the screen multiple times.
This commit is contained in:
James R. 2023-09-25 03:06:56 -07:00 committed by NepDisk
parent bf9e2cf6a6
commit b819d43296
2 changed files with 23 additions and 15 deletions

View file

@ -470,6 +470,29 @@ static void D_Display(void)
ps_rendercalltime = I_GetPreciseTime();
if (rendermode == render_soft)
{
if (cv_homremoval.value)
{
if (cv_homremoval.value == 1)
{
// Clear the software screen buffer to remove HOM
memset(screens[0], 31, vid.width * vid.height * vid.bpp);
}
else
{
//'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
memset(screens[0], 32+(timeinmap&15), vid.width * vid.height * vid.bpp);
}
}
if (r_splitscreen == 2)
{
// Draw over the fourth screen so you don't have to stare at a HOM :V
V_DrawFill(viewwidth, viewheight, viewwidth, viewheight, 31|V_NOSCALESTART);
}
}
for (i = 0; i <= r_splitscreen; i++)
{
if (players[displayplayers[i]].mo || players[displayplayers[i]].playerstate == PST_DEAD)

View file

@ -1488,24 +1488,9 @@ static void Mask_Post (maskcount_t* m)
void R_RenderPlayerView(void)
{
player_t * player = &players[displayplayers[viewssnum]];
INT32 nummasks = 1;
maskcount_t* masks = static_cast<maskcount_t*>(malloc(sizeof(maskcount_t)));
// if this is display player 1
if (cv_homremoval.value && player == &players[displayplayers[0]])
{
if (cv_homremoval.value == 1)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // No HOM effect!
else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 128+(timeinmap&15));
}
else if (r_splitscreen == 2 && player == &players[displayplayers[2]])
{
// Draw over the fourth screen so you don't have to stare at a HOM :V
V_DrawFill(viewwidth, viewheight, viewwidth, viewheight, 31|V_NOSCALESTART);
}
R_SetupFrame(viewssnum);
framecount++;
validcount++;