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();
|
s_bench_file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Shutdown()
|
||||||
|
{
|
||||||
|
if (s_bench_file.is_open())
|
||||||
|
s_bench_file.close();
|
||||||
|
}
|
||||||
|
|
||||||
static void LogRenderTimeToFile(u64 val)
|
static void LogRenderTimeToFile(u64 val)
|
||||||
{
|
{
|
||||||
if (!s_bench_file.is_open())
|
if (!s_bench_file.is_open())
|
||||||
|
@ -49,6 +55,7 @@ int Update()
|
||||||
s_update_time.Update();
|
s_update_time.Update();
|
||||||
s_fps = s_counter - s_fps_last_counter;
|
s_fps = s_counter - s_fps_last_counter;
|
||||||
s_fps_last_counter = s_counter;
|
s_fps_last_counter = s_counter;
|
||||||
|
s_bench_file.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ActiveConfig.bLogRenderTimeToFile)
|
if (g_ActiveConfig.bLogRenderTimeToFile)
|
||||||
|
|
|
@ -9,6 +9,9 @@ namespace FPSCounter
|
||||||
// Initializes the FPS counter.
|
// Initializes the FPS counter.
|
||||||
void Initialize();
|
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
|
// Called when a frame is rendered. Returns the value to be displayed on
|
||||||
// screen as the FPS counter (updated every second).
|
// screen as the FPS counter (updated every second).
|
||||||
int Update();
|
int Update();
|
||||||
|
|
|
@ -105,6 +105,8 @@ Renderer::~Renderer()
|
||||||
if (pFrameDump.IsOpen())
|
if (pFrameDump.IsOpen())
|
||||||
pFrameDump.Close();
|
pFrameDump.Close();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FPSCounter::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbWidth, u32 fbHeight, float Gamma)
|
void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbWidth, u32 fbHeight, float Gamma)
|
||||||
|
|
Loading…
Reference in New Issue