Skip to content

Commit

Permalink
- I_FPSTime may not return the time at frame start.
Browse files Browse the repository at this point in the history
This is used for real-time profiling and as such needs to return the current time or most of its uses will break.
  • Loading branch information
coelckers committed Nov 12, 2017
1 parent 93e9c38 commit f54475b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/gl/utility/gl_clock.cpp
Expand Up @@ -226,7 +226,7 @@ void CheckBench()
{
// if we started the FPS counter ourselves or ran from the console
// we need to wait for it to stabilize before using it.
if (waitstart > 0 && I_MSTime() < waitstart + 5000) return;
if (waitstart > 0 && I_FPSTime() - waitstart < 5000) return;

FString compose;

Expand Down Expand Up @@ -257,12 +257,12 @@ CCMD(bench)
if (vid_fps == 0)
{
vid_fps = 1;
waitstart = I_MSTime();
waitstart = I_FPSTime();
switchfps = true;
}
else
{
if (ConsoleState == c_up) waitstart = I_MSTime();
if (ConsoleState == c_up) waitstart = I_FPSTime();
switchfps = false;
}
C_HideConsole ();
Expand Down
5 changes: 1 addition & 4 deletions src/i_time.cpp
Expand Up @@ -142,10 +142,7 @@ uint64_t I_NSTime()

uint64_t I_FPSTimeNS()
{
if (FreezeTime == 0)
return CurrentFrameStartTime;
else
return GetClockTimeNS();
return GetClockTimeNS();
}

unsigned int I_MSTime()
Expand Down

0 comments on commit f54475b

Please sign in to comment.