diff options
| author | JosJuice <josjuice@gmail.com> | 2019-01-31 22:44:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-31 22:44:10 +0100 |
| commit | c1492aeb45e471cd37cd562f3fc87c27ab0fcd4c (patch) | |
| tree | 5f46fc0539042a0b59323de07c7e944e1cf4f006 /Source/Core/VideoCommon | |
| parent | 9c38772301101c4cd0f2a7912c9314ce6492cb62 (diff) | |
| parent | b01df8670fd9cf0571230ca7f0e19611e71256dd (diff) | |
Merge pull request #7744 from stenzek/vsync
Renderer: Fix throttle-disable (TAB) hotkey when vsync is enabled
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index aef425a726..5a5b1c5aba 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -243,7 +243,7 @@ void Renderer::CheckForConfigChanges() const u32 old_multisamples = g_ActiveConfig.iMultisamples; const int old_anisotropy = g_ActiveConfig.iMaxAnisotropy; const bool old_force_filtering = g_ActiveConfig.bForceFiltering; - const bool old_vsync = g_ActiveConfig.IsVSync(); + const bool old_vsync = g_ActiveConfig.bVSyncActive; const bool old_bbox = g_ActiveConfig.bBBoxEnable; UpdateActiveConfig(); @@ -264,7 +264,7 @@ void Renderer::CheckForConfigChanges() changed_bits |= CONFIG_CHANGE_BIT_ANISOTROPY; if (old_force_filtering != g_ActiveConfig.bForceFiltering) changed_bits |= CONFIG_CHANGE_BIT_FORCE_TEXTURE_FILTERING; - if (old_vsync != g_ActiveConfig.IsVSync()) + if (old_vsync != g_ActiveConfig.bVSyncActive) changed_bits |= CONFIG_CHANGE_BIT_VSYNC; if (old_bbox != g_ActiveConfig.bBBoxEnable) changed_bits |= CONFIG_CHANGE_BIT_BBOX; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index cc14b191fd..6520cbe7bc 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -19,11 +19,19 @@ VideoConfig g_Config; VideoConfig g_ActiveConfig; static bool s_has_registered_callback = false; +static bool IsVSyncActive(bool enabled) +{ + // Vsync is disabled when the throttler is disabled by the tab key. + return enabled && !Core::GetIsThrottlerTempDisabled() && + SConfig::GetInstance().m_EmulationSpeed == 1.0; +} + void UpdateActiveConfig() { if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) Movie::SetGraphicsConfig(); g_ActiveConfig = g_Config; + g_ActiveConfig.bVSyncActive = IsVSyncActive(g_ActiveConfig.bVSync); } VideoConfig::VideoConfig() @@ -175,12 +183,6 @@ void VideoConfig::VerifyValidity() } } -bool VideoConfig::IsVSync() const -{ - return bVSync && !Core::GetIsThrottlerTempDisabled() && - SConfig::GetInstance().m_EmulationSpeed == 1.0; -} - bool VideoConfig::UsingUberShaders() const { return iShaderCompilationMode == ShaderCompilationMode::SynchronousUberShaders || diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 1ea9f16661..eace03b4a2 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -56,10 +56,10 @@ struct VideoConfig final VideoConfig(); void Refresh(); void VerifyValidity(); - bool IsVSync() const; // General bool bVSync; + bool bVSyncActive; bool bWidescreenHack; AspectMode aspect_mode; AspectMode suggested_aspect_mode; |
