commit
e278587023
|
@ -41,7 +41,6 @@
|
||||||
#include "VideoCommon/BPStructs.h"
|
#include "VideoCommon/BPStructs.h"
|
||||||
#include "VideoCommon/DriverDetails.h"
|
#include "VideoCommon/DriverDetails.h"
|
||||||
#include "VideoCommon/Fifo.h"
|
#include "VideoCommon/Fifo.h"
|
||||||
#include "VideoCommon/FPSCounter.h"
|
|
||||||
#include "VideoCommon/ImageWrite.h"
|
#include "VideoCommon/ImageWrite.h"
|
||||||
#include "VideoCommon/OnScreenDisplay.h"
|
#include "VideoCommon/OnScreenDisplay.h"
|
||||||
#include "VideoCommon/PixelEngine.h"
|
#include "VideoCommon/PixelEngine.h"
|
||||||
|
|
|
@ -10,12 +10,9 @@
|
||||||
#include "VideoCommon/FPSCounter.h"
|
#include "VideoCommon/FPSCounter.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
|
|
||||||
#define FPS_REFRESH_INTERVAL 1000
|
static constexpr u64 FPS_REFRESH_INTERVAL = 1000;
|
||||||
|
|
||||||
FPSCounter::FPSCounter()
|
FPSCounter::FPSCounter()
|
||||||
: m_fps(0)
|
|
||||||
, m_counter(0)
|
|
||||||
, m_fps_last_counter(0)
|
|
||||||
{
|
{
|
||||||
m_update_time.Update();
|
m_update_time.Update();
|
||||||
m_render_time.Update();
|
m_render_time.Update();
|
||||||
|
@ -29,7 +26,7 @@ void FPSCounter::LogRenderTimeToFile(u64 val)
|
||||||
m_bench_file << val << std::endl;
|
m_bench_file << val << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FPSCounter::Update()
|
void FPSCounter::Update()
|
||||||
{
|
{
|
||||||
if (m_update_time.GetTimeDifference() >= FPS_REFRESH_INTERVAL)
|
if (m_update_time.GetTimeDifference() >= FPS_REFRESH_INTERVAL)
|
||||||
{
|
{
|
||||||
|
@ -46,5 +43,4 @@ int FPSCounter::Update()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_counter++;
|
m_counter++;
|
||||||
return m_fps;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,18 +11,18 @@
|
||||||
class FPSCounter
|
class FPSCounter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unsigned int m_fps;
|
|
||||||
|
|
||||||
// Initializes the FPS counter.
|
// Initializes the FPS counter.
|
||||||
FPSCounter();
|
FPSCounter();
|
||||||
|
|
||||||
// Called when a frame is rendered. Returns the value to be displayed on
|
// Called when a frame is rendered (updated every second).
|
||||||
// screen as the FPS counter (updated every second).
|
void Update();
|
||||||
int Update();
|
|
||||||
|
unsigned int GetFPS() const { return m_fps; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_counter;
|
unsigned int m_fps = 0;
|
||||||
unsigned int m_fps_last_counter;
|
unsigned int m_counter = 0;
|
||||||
|
unsigned int m_fps_last_counter = 0;
|
||||||
Common::Timer m_update_time;
|
Common::Timer m_update_time;
|
||||||
|
|
||||||
Common::Timer m_render_time;
|
Common::Timer m_render_time;
|
||||||
|
|
|
@ -295,7 +295,7 @@ void Renderer::DrawDebugText()
|
||||||
if (g_ActiveConfig.bShowFPS || SConfig::GetInstance().m_ShowFrameCount)
|
if (g_ActiveConfig.bShowFPS || SConfig::GetInstance().m_ShowFrameCount)
|
||||||
{
|
{
|
||||||
if (g_ActiveConfig.bShowFPS)
|
if (g_ActiveConfig.bShowFPS)
|
||||||
final_cyan += StringFromFormat("FPS: %d", g_renderer->m_fps_counter.m_fps);
|
final_cyan += StringFromFormat("FPS: %u", g_renderer->m_fps_counter.GetFPS());
|
||||||
|
|
||||||
if (g_ActiveConfig.bShowFPS && SConfig::GetInstance().m_ShowFrameCount)
|
if (g_ActiveConfig.bShowFPS && SConfig::GetInstance().m_ShowFrameCount)
|
||||||
final_cyan += " - ";
|
final_cyan += " - ";
|
||||||
|
|
Loading…
Reference in New Issue