From 50e9300667c8aa50871929e02389723f36122c05 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 26 Sep 2022 12:03:54 +0200 Subject: [PATCH] Game/FPSCounter: change m_fps variable and getFPS() return value from float to double. MSVC complains about loss of information because sp::Time::seconds() returns double. --- include/Spectre/Game/FPSCounter.h | 4 ++-- source/Game/FPSCounter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Spectre/Game/FPSCounter.h b/include/Spectre/Game/FPSCounter.h index 9566fc2..4233d9e 100644 --- a/include/Spectre/Game/FPSCounter.h +++ b/include/Spectre/Game/FPSCounter.h @@ -17,7 +17,7 @@ public : // Should be called whenever a frame has been rendered. void addFrame(); - float getFPS() const; + double getFPS() const; // Set the update rate (in seconds). // How often the FPS should be sampled and calculated. @@ -42,7 +42,7 @@ private : Time m_updateRate; // Calculated Frames per second. - float m_fps; + double m_fps; }; } // namespace sp diff --git a/source/Game/FPSCounter.cpp b/source/Game/FPSCounter.cpp index 70b713c..3de2b38 100644 --- a/source/Game/FPSCounter.cpp +++ b/source/Game/FPSCounter.cpp @@ -16,7 +16,7 @@ void FPSCounter::addFrame() m_count++; } -float FPSCounter::getFPS() const +double FPSCounter::getFPS() const { return m_fps; }