Add m_vsyncDisabled to new settings API

This commit is contained in:
Vasily
2019-12-10 08:28:41 +01:00
committed by username223
parent f945bd06bd
commit 4ae8bd8fb5
4 changed files with 12 additions and 19 deletions
+7 -18
View File
@@ -281,12 +281,7 @@ OverlayController::OverlayController( bool desktopMode,
// Keep the settings for vsyncDisabled and crash recovery here in main
// overlaycontroller
appSettings()->beginGroup( "applicationSettings" );
auto value = appSettings()->value( "vsyncDisabled", m_vsyncDisabled );
if ( value.isValid() && !value.isNull() )
{
m_vsyncDisabled = value.toBool();
}
value = appSettings()->value( "customTickRateMs", m_customTickRateMs );
auto value = appSettings()->value( "customTickRateMs", m_customTickRateMs );
if ( value.isValid() && !value.isNull() )
{
// keep sane tickrate (between 1~k_maxCustomTickRate)
@@ -768,23 +763,17 @@ void OverlayController::setCrashRecoveryDisabled( bool value, bool notify )
bool OverlayController::vsyncDisabled() const
{
return m_vsyncDisabled;
return settings::getSetting(
settings::BoolSetting::APPLICATION_vsyncDisabled );
}
void OverlayController::setVsyncDisabled( bool value, bool notify )
{
if ( m_vsyncDisabled == value )
{
return;
}
m_vsyncDisabled = value;
appSettings()->beginGroup( "applicationSettings" );
appSettings()->setValue( "vsyncDisabled", m_vsyncDisabled );
appSettings()->endGroup();
appSettings()->sync();
settings::setSetting( settings::BoolSetting::APPLICATION_vsyncDisabled,
value );
if ( notify )
{
emit vsyncDisabledChanged( m_vsyncDisabled );
emit vsyncDisabledChanged( value );
}
}
@@ -947,7 +936,7 @@ void OverlayController::setCustomTickRateMs( int value, bool notify )
// mainEventLoop() or not.
void OverlayController::OnTimeoutPumpEvents()
{
if ( m_vsyncDisabled )
if ( vsyncDisabled() )
{
// check if it's time for a custom tick rate tick
if ( m_customTickRateCounter > m_customTickRateMs )
-1
View File
@@ -123,7 +123,6 @@ private:
bool m_previousShutdownSafe = true;
bool m_noSound;
bool m_crashRecoveryDisabled = false;
bool m_vsyncDisabled = false;
bool m_enableDebug = false;
bool m_disableVersionCheck = false;
bool m_newVersionDetected = false;
+1
View File
@@ -25,6 +25,7 @@ enum class BoolSetting
APPLICATION_disableVersionCheck,
APPLICATION_previousShutdownSafe,
APPLICATION_vsyncDisabled,
VIDEO_brightnessEnabled,
VIDEO_isOverlayMethodActive,
+4
View File
@@ -227,6 +227,10 @@ private:
SettingCategory::Application,
QtInfo{ "previousShutdownSafe" },
true },
BoolSettingValue{ BoolSetting::APPLICATION_vsyncDisabled,
SettingCategory::Application,
QtInfo{ "vsyncDisabled" },
false },
BoolSettingValue{ BoolSetting::VIDEO_brightnessEnabled,
SettingCategory::Video,