mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-28 16:11:38 +00:00
commit
e278587023
@ -41,7 +41,6 @@
|
||||
#include "VideoCommon/BPStructs.h"
|
||||
#include "VideoCommon/DriverDetails.h"
|
||||
#include "VideoCommon/Fifo.h"
|
||||
#include "VideoCommon/FPSCounter.h"
|
||||
#include "VideoCommon/ImageWrite.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/PixelEngine.h"
|
||||
|
@ -10,12 +10,9 @@
|
||||
#include "VideoCommon/FPSCounter.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
#define FPS_REFRESH_INTERVAL 1000
|
||||
static constexpr u64 FPS_REFRESH_INTERVAL = 1000;
|
||||
|
||||
FPSCounter::FPSCounter()
|
||||
: m_fps(0)
|
||||
, m_counter(0)
|
||||
, m_fps_last_counter(0)
|
||||
{
|
||||
m_update_time.Update();
|
||||
m_render_time.Update();
|
||||
@ -29,7 +26,7 @@ void FPSCounter::LogRenderTimeToFile(u64 val)
|
||||
m_bench_file << val << std::endl;
|
||||
}
|
||||
|
||||
int FPSCounter::Update()
|
||||
void FPSCounter::Update()
|
||||
{
|
||||
if (m_update_time.GetTimeDifference() >= FPS_REFRESH_INTERVAL)
|
||||
{
|
||||
@ -46,5 +43,4 @@ int FPSCounter::Update()
|
||||
}
|
||||
|
||||
m_counter++;
|
||||
return m_fps;
|
||||
}
|
||||
|
@ -11,18 +11,18 @@
|
||||
class FPSCounter
|
||||
{
|
||||
public:
|
||||
unsigned int m_fps;
|
||||
|
||||
// Initializes the FPS counter.
|
||||
FPSCounter();
|
||||
|
||||
// Called when a frame is rendered. Returns the value to be displayed on
|
||||
// screen as the FPS counter (updated every second).
|
||||
int Update();
|
||||
// Called when a frame is rendered (updated every second).
|
||||
void Update();
|
||||
|
||||
unsigned int GetFPS() const { return m_fps; }
|
||||
|
||||
private:
|
||||
unsigned int m_counter;
|
||||
unsigned int m_fps_last_counter;
|
||||
unsigned int m_fps = 0;
|
||||
unsigned int m_counter = 0;
|
||||
unsigned int m_fps_last_counter = 0;
|
||||
Common::Timer m_update_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)
|
||||
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)
|
||||
final_cyan += " - ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user