FPSCounter: Flush the logs every second and close them when the renderer is shut down.
This commit is contained in:
parent
1754cbda9d
commit
6def4ead01
|
@ -34,6 +34,12 @@ void Initialize()
|
|||
s_bench_file.close();
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
if (s_bench_file.is_open())
|
||||
s_bench_file.close();
|
||||
}
|
||||
|
||||
static void LogRenderTimeToFile(u64 val)
|
||||
{
|
||||
if (!s_bench_file.is_open())
|
||||
|
@ -49,6 +55,7 @@ int Update()
|
|||
s_update_time.Update();
|
||||
s_fps = s_counter - s_fps_last_counter;
|
||||
s_fps_last_counter = s_counter;
|
||||
s_bench_file.flush();
|
||||
}
|
||||
|
||||
if (g_ActiveConfig.bLogRenderTimeToFile)
|
||||
|
|
|
@ -9,6 +9,9 @@ namespace FPSCounter
|
|||
// Initializes the FPS counter.
|
||||
void Initialize();
|
||||
|
||||
// Shutdown the FPS counter by closing the logs.
|
||||
void Shutdown();
|
||||
|
||||
// Called when a frame is rendered. Returns the value to be displayed on
|
||||
// screen as the FPS counter (updated every second).
|
||||
int Update();
|
||||
|
|
|
@ -105,6 +105,8 @@ Renderer::~Renderer()
|
|||
if (pFrameDump.IsOpen())
|
||||
pFrameDump.Close();
|
||||
#endif
|
||||
|
||||
FPSCounter::Shutdown();
|
||||
}
|
||||
|
||||
void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbWidth, u32 fbHeight, float Gamma)
|
||||
|
|
Loading…
Reference in New Issue