diff options
Diffstat (limited to 'src/common/settings.cpp')
| -rw-r--r-- | src/common/settings.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 15fd2e222..4ecaf550b 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <version> | 4 | #include <version> |
| 5 | #include "common/settings_enums.h" | ||
| 5 | #if __cpp_lib_chrono >= 201907L | 6 | #if __cpp_lib_chrono >= 201907L |
| 6 | #include <chrono> | 7 | #include <chrono> |
| 7 | #include <exception> | 8 | #include <exception> |
| @@ -145,6 +146,10 @@ bool IsFastmemEnabled() { | |||
| 145 | return true; | 146 | return true; |
| 146 | } | 147 | } |
| 147 | 148 | ||
| 149 | bool IsDockedMode() { | ||
| 150 | return values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked; | ||
| 151 | } | ||
| 152 | |||
| 148 | float Volume() { | 153 | float Volume() { |
| 149 | if (values.audio_muted) { | 154 | if (values.audio_muted) { |
| 150 | return 0.0f; | 155 | return 0.0f; |
| @@ -154,6 +159,8 @@ float Volume() { | |||
| 154 | 159 | ||
| 155 | const char* TranslateCategory(Category category) { | 160 | const char* TranslateCategory(Category category) { |
| 156 | switch (category) { | 161 | switch (category) { |
| 162 | case Category::Android: | ||
| 163 | return "Android"; | ||
| 157 | case Category::Audio: | 164 | case Category::Audio: |
| 158 | return "Audio"; | 165 | return "Audio"; |
| 159 | case Category::Core: | 166 | case Category::Core: |
| @@ -207,9 +214,7 @@ const char* TranslateCategory(Category category) { | |||
| 207 | return "Miscellaneous"; | 214 | return "Miscellaneous"; |
| 208 | } | 215 | } |
| 209 | 216 | ||
| 210 | void UpdateRescalingInfo() { | 217 | void TranslateResolutionInfo(ResolutionSetup setup, ResolutionScalingInfo& info) { |
| 211 | const auto setup = values.resolution_setup.GetValue(); | ||
| 212 | auto& info = values.resolution_info; | ||
| 213 | info.downscale = false; | 218 | info.downscale = false; |
| 214 | switch (setup) { | 219 | switch (setup) { |
| 215 | case ResolutionSetup::Res1_2X: | 220 | case ResolutionSetup::Res1_2X: |
| @@ -269,6 +274,12 @@ void UpdateRescalingInfo() { | |||
| 269 | info.active = info.up_scale != 1 || info.down_shift != 0; | 274 | info.active = info.up_scale != 1 || info.down_shift != 0; |
| 270 | } | 275 | } |
| 271 | 276 | ||
| 277 | void UpdateRescalingInfo() { | ||
| 278 | const auto setup = values.resolution_setup.GetValue(); | ||
| 279 | auto& info = values.resolution_info; | ||
| 280 | TranslateResolutionInfo(setup, info); | ||
| 281 | } | ||
| 282 | |||
| 272 | void RestoreGlobalState(bool is_powered_on) { | 283 | void RestoreGlobalState(bool is_powered_on) { |
| 273 | // If a game is running, DO NOT restore the global settings state | 284 | // If a game is running, DO NOT restore the global settings state |
| 274 | if (is_powered_on) { | 285 | if (is_powered_on) { |