mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-25 03:35:59 +00:00
Fix FPS counter and Game Window speed % breaking on pause/unpause
-Add pause state to FPSCounter. -Add ability to have more than one "OnStateChanged" callback in core. -Add GetActualEmulationSpeed() to Core. Returns 1 by default. It's used by my input PRs.
This commit is contained in:
parent
31780a6059
commit
818672b585
7 changed files with 125 additions and 31 deletions
|
@ -11,20 +11,30 @@
|
|||
class FPSCounter
|
||||
{
|
||||
public:
|
||||
// Initializes the FPS counter.
|
||||
FPSCounter();
|
||||
~FPSCounter();
|
||||
FPSCounter(const FPSCounter&) = delete;
|
||||
FPSCounter& operator=(const FPSCounter&) = delete;
|
||||
FPSCounter(FPSCounter&&) = delete;
|
||||
FPSCounter& operator=(FPSCounter&&) = delete;
|
||||
|
||||
// Called when a frame is rendered (updated every second).
|
||||
void Update();
|
||||
|
||||
float GetFPS() const { return m_fps; }
|
||||
double GetDeltaTime() const { return m_time_diff_secs; }
|
||||
|
||||
private:
|
||||
void SetPaused(bool paused);
|
||||
|
||||
u64 m_last_time = 0;
|
||||
u64 m_time_since_update = 0;
|
||||
u64 m_last_time_pause = 0;
|
||||
u32 m_frame_counter = 0;
|
||||
float m_fps = 0;
|
||||
int m_on_state_changed_handle = -1;
|
||||
float m_fps = 0.f;
|
||||
std::ofstream m_bench_file;
|
||||
double m_time_diff_secs = 0.0;
|
||||
|
||||
void LogRenderTimeToFile(u64 val);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue