Skip to content

Commit

Permalink
Cap FPS before blitting to screen
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Dec 6, 2024
1 parent 3592df5 commit 50d6535
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ void D_Display(void)

if (!dowipe || !melt)
{
if (!vid_vsync)
{
if ((!vid_capfps || vid_capfps > 60)
&& (gamestate != GS_LEVEL || menuactive || consoleactive || paused))
I_CapFPS(60);
else if (vid_capfps >= TICRATE)
I_CapFPS(vid_capfps);
}

if (!paused && !menuactive)
{
if (vid_showfps && !dowipe && !splashscreen && framespersecond)
Expand Down Expand Up @@ -422,15 +431,6 @@ void D_Display(void)
blitfunc();
mapblitfunc();

if (!vid_vsync)
{
if ((!vid_capfps || vid_capfps > 60)
&& (gamestate != GS_LEVEL || menuactive || consoleactive || paused))
I_CapFPS(60);
else if (vid_capfps >= TICRATE)
I_CapFPS(vid_capfps);
}

return;
}

Expand Down

0 comments on commit 50d6535

Please sign in to comment.