mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Take into account television refresh rates
TV's tend to output @59.939999 FPS, set out frame limiter's to that if FPS happens to be 59 or 60.
This commit is contained in:
parent
1baaf25929
commit
85de096f98
@ -83,16 +83,7 @@ void CFrameLimit::Run(void)
|
||||
// the desktop's refresh rate; not adhering to
|
||||
// this will result in a major performance drop.
|
||||
if (globalFps == 0.0f && targetFps == -1)
|
||||
{
|
||||
float desktopRefreshRate = (float)g_pGame->GetDesktopRefreshRate();
|
||||
|
||||
//if (dekstopRefreshRate == 59.0f || dekstopRefreshRate == 60.0f)
|
||||
//{
|
||||
// desktopRefreshRate = 59.939999f;
|
||||
//}
|
||||
|
||||
targetFps = desktopRefreshRate;
|
||||
}
|
||||
targetFps = g_pGame->GetTVRefreshRate();
|
||||
|
||||
if (m_FramesPerSecond != targetFps)
|
||||
Reset(targetFps);
|
||||
|
@ -186,13 +186,9 @@ bool CEngineAPI::MainLoop()
|
||||
// the desktop's refresh rate; not adhering to
|
||||
// this will result in a major performance drop.
|
||||
if (globalFps == 0.0f)
|
||||
{
|
||||
fpsMax = (float)g_pGame->GetDesktopRefreshRate();
|
||||
}
|
||||
else // Don't let NVIDIA limit the frame rate.
|
||||
{
|
||||
fpsMax = 0.0f;
|
||||
}
|
||||
fpsMax = g_pGame->GetTVRefreshRate();
|
||||
else
|
||||
fpsMax = 0.0f; // Don't let NVIDIA limit the frame rate.
|
||||
}
|
||||
|
||||
NV_SET_SLEEP_MODE_PARAMS_V1 params = {};
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
inline int GetDesktopWidth() const { return m_iDesktopWidth; }
|
||||
inline int GetDesktopHeight() const { return m_iDesktopHeight; }
|
||||
inline int GetDesktopRefreshRate() const { return m_iDesktopRefreshRate; }
|
||||
inline float GetTVRefreshRate() const // Avoid stutter on TV's running on broadcast frame rates.
|
||||
{ return ((float)m_iDesktopRefreshRate == 59.0f || (float)m_iDesktopRefreshRate == 60.0f) ? 59.939999f : (float)m_iDesktopRefreshRate; }
|
||||
|
||||
private:
|
||||
HWND m_hWindow;
|
||||
|
Loading…
x
Reference in New Issue
Block a user