From 532cd4400347363123316cffaa3ac1268240d7b5 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 10 Feb 2014 12:12:23 +0100 Subject: [PATCH] Use float to calculate the fps/vps This will round internally, so 59.99 fps will now be shown as 60 fps. --- Source/Core/Core/Core.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 93576e554f..342d241842 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -673,9 +673,9 @@ void UpdateTitle() if (ElapseTime == 0) ElapseTime = 1; - u32 FPS = Common::AtomicLoad(DrawnFrame) * 1000 / ElapseTime; - u32 VPS = DrawnVideo * 1000 / ElapseTime; - u32 Speed = DrawnVideo * (100 * 1000) / (VideoInterface::TargetRefreshRate * ElapseTime); + float FPS = Common::AtomicLoad(DrawnFrame) * 1000.0 / ElapseTime; + float VPS = DrawnVideo * 1000.0 / ElapseTime; + float Speed = DrawnVideo * (100 * 1000.0) / (VideoInterface::TargetRefreshRate * ElapseTime); // Settings are shown the same for both extended and summary info std::string SSettings = StringFromFormat("%s %s | %s | %s", cpu_core_base->GetName(), _CoreParameter.bCPUThread ? "DC" : "SC", @@ -711,11 +711,11 @@ void UpdateTitle() #else // Summary information std::string SFPS; if (Movie::IsPlayingInput()) - SFPS = StringFromFormat("VI: %u/%u - Frame: %u/%u - FPS: %u - VPS: %u - %u%%", (u32)Movie::g_currentFrame, (u32)Movie::g_totalFrames, (u32)Movie::g_currentInputCount, (u32)Movie::g_totalInputCount, FPS, VPS, Speed); + SFPS = StringFromFormat("VI: %u/%u - Frame: %u/%u - FPS: %.0f - VPS: %.0f - %.0f%%", (u32)Movie::g_currentFrame, (u32)Movie::g_totalFrames, (u32)Movie::g_currentInputCount, (u32)Movie::g_totalInputCount, FPS, VPS, Speed); else if (Movie::IsRecordingInput()) - SFPS = StringFromFormat("VI: %u - Frame: %u - FPS: %u - VPS: %u - %u%%", (u32)Movie::g_currentFrame, (u32)Movie::g_currentInputCount, FPS, VPS, Speed); + SFPS = StringFromFormat("VI: %u - Frame: %u - FPS: %.0f - VPS: %.0f - %.0f%%", (u32)Movie::g_currentFrame, (u32)Movie::g_currentInputCount, FPS, VPS, Speed); else - SFPS = StringFromFormat("FPS: %u - VPS: %u - %u%%", FPS, VPS, Speed); + SFPS = StringFromFormat("FPS: %.0f - VPS: %.0f - %.0f%%", FPS, VPS, Speed); #endif // This is our final "frame counter" string