mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-11 00:29:11 +01:00
Use float to calculate the fps/vps
This will round internally, so 59.99 fps will now be shown as 60 fps.
This commit is contained in:
parent
a51b5f7815
commit
532cd44003
@ -673,9 +673,9 @@ void UpdateTitle()
|
|||||||
if (ElapseTime == 0)
|
if (ElapseTime == 0)
|
||||||
ElapseTime = 1;
|
ElapseTime = 1;
|
||||||
|
|
||||||
u32 FPS = Common::AtomicLoad(DrawnFrame) * 1000 / ElapseTime;
|
float FPS = Common::AtomicLoad(DrawnFrame) * 1000.0 / ElapseTime;
|
||||||
u32 VPS = DrawnVideo * 1000 / ElapseTime;
|
float VPS = DrawnVideo * 1000.0 / ElapseTime;
|
||||||
u32 Speed = DrawnVideo * (100 * 1000) / (VideoInterface::TargetRefreshRate * ElapseTime);
|
float Speed = DrawnVideo * (100 * 1000.0) / (VideoInterface::TargetRefreshRate * ElapseTime);
|
||||||
|
|
||||||
// Settings are shown the same for both extended and summary info
|
// 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",
|
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
|
#else // Summary information
|
||||||
std::string SFPS;
|
std::string SFPS;
|
||||||
if (Movie::IsPlayingInput())
|
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())
|
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
|
else
|
||||||
SFPS = StringFromFormat("FPS: %u - VPS: %u - %u%%", FPS, VPS, Speed);
|
SFPS = StringFromFormat("FPS: %.0f - VPS: %.0f - %.0f%%", FPS, VPS, Speed);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This is our final "frame counter" string
|
// This is our final "frame counter" string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user