Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 22, 2024
1 parent bbc46ae commit 55eda89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,12 +1172,6 @@ void R_RenderPlayerView(void)

R_DrawPlanes();

if (consoleactive || paused || freeze)
{
M_Fuzz1Seed(maptime);
M_Fuzz2Seed(maptime);
}

R_DrawMasked();

if (!r_textures && viewplayer->fixedcolormap == INVERSECOLORMAP)
Expand Down
12 changes: 10 additions & 2 deletions src/r_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,17 @@ void R_ClearPlanes(void)
ceilingclip[i] = -1;
}

// [PN] Optimize loop by avoiding unnecessary assignments and checks.
// Only process non-null visplanes and simplify inner loop performance.
for (int i = 0; i < MAXVISPLANES; i++)
for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; )
freehead = &(*freehead)->next;
if (visplanes[i])
{
*freehead = visplanes[i];
visplanes[i] = NULL;

while (*freehead)
freehead = &(*freehead)->next;
}

lastopening = openings;

Expand Down
6 changes: 6 additions & 0 deletions src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,12 @@ static void R_DrawSprite(const vissprite_t *spr)
//
void R_DrawMasked(void)
{
if (consoleactive || paused || freeze)
{
M_Fuzz1Seed(maptime);
M_Fuzz2Seed(maptime);
}

interpolatesprites = (vid_capfps != TICRATE && !consoleactive && !freeze);
invulnerable = (viewplayer->fixedcolormap == INVERSECOLORMAP && r_sprites_translucency);

Expand Down

0 comments on commit 55eda89

Please sign in to comment.