FrontendCommon: Add option to inhibit screensaver

This commit is contained in:
Connor McLaughlin
2021-06-20 15:41:01 +10:00
parent 531845a0c7
commit d9412f9fcd
13 changed files with 218 additions and 6 deletions

View File

@ -61,6 +61,7 @@ public:
virtual ~HostDisplay();
ALWAYS_INLINE const WindowInfo& GetWindowInfo() const { return m_window_info; }
ALWAYS_INLINE s32 GetWindowWidth() const { return static_cast<s32>(m_window_info.surface_width); }
ALWAYS_INLINE s32 GetWindowHeight() const { return static_cast<s32>(m_window_info.surface_height); }
ALWAYS_INLINE float GetWindowScale() const { return m_window_info.surface_scale; }

View File

@ -487,6 +487,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si)
si.SetFloatValue("Main", "TurboSpeed", 0.0f);
si.SetBoolValue("Main", "SyncToHostRefreshRate", false);
si.SetBoolValue("Main", "IncreaseTimerResolution", true);
si.SetBoolValue("Main", "InhibitScreensaver", true);
si.SetBoolValue("Main", "StartPaused", false);
si.SetBoolValue("Main", "StartFullscreen", false);
si.SetBoolValue("Main", "PauseOnFocusLoss", false);

View File

@ -147,6 +147,7 @@ void Settings::Load(SettingsInterface& si)
turbo_speed = si.GetFloatValue("Main", "TurboSpeed", 0.0f);
sync_to_host_refresh_rate = si.GetBoolValue("Main", "SyncToHostRefreshRate", false);
increase_timer_resolution = si.GetBoolValue("Main", "IncreaseTimerResolution", true);
inhibit_screensaver = si.GetBoolValue("Main", "InhibitScreensaver", true);
start_paused = si.GetBoolValue("Main", "StartPaused", false);
start_fullscreen = si.GetBoolValue("Main", "StartFullscreen", false);
pause_on_focus_loss = si.GetBoolValue("Main", "PauseOnFocusLoss", false);
@ -341,6 +342,7 @@ void Settings::Save(SettingsInterface& si) const
si.SetFloatValue("Main", "TurboSpeed", turbo_speed);
si.SetBoolValue("Main", "SyncToHostRefreshRate", sync_to_host_refresh_rate);
si.SetBoolValue("Main", "IncreaseTimerResolution", increase_timer_resolution);
si.SetBoolValue("Main", "InhibitScreensaver", inhibit_screensaver);
si.SetBoolValue("Main", "StartPaused", start_paused);
si.SetBoolValue("Main", "StartFullscreen", start_fullscreen);
si.SetBoolValue("Main", "PauseOnFocusLoss", pause_on_focus_loss);

View File

@ -86,6 +86,7 @@ struct Settings
float turbo_speed = 0.0f;
bool sync_to_host_refresh_rate = true;
bool increase_timer_resolution = true;
bool inhibit_screensaver = false;
bool start_paused = false;
bool start_fullscreen = false;
bool pause_on_focus_loss = false;