summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar lat9nq2023-08-15 22:41:50 -0400
committerGravatar lat9nq2023-08-15 22:41:50 -0400
commit3e28e85468cafb928cda5dc9210eba95af26e212 (patch)
tree50d3cb165db3d6c89cfaa6562236b114e32f2144 /src
parentMerge pull request #11271 from t895/settings-tweaks (diff)
downloadyuzu-3e28e85468cafb928cda5dc9210eba95af26e212.tar.gz
yuzu-3e28e85468cafb928cda5dc9210eba95af26e212.tar.xz
yuzu-3e28e85468cafb928cda5dc9210eba95af26e212.zip
settings: Add AspectRatio enum, split res scale function
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.cpp10
-rw-r--r--src/common/settings.h1
-rw-r--r--src/common/settings_enums.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 15fd2e222..16a58a750 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -207,9 +207,7 @@ const char* TranslateCategory(Category category) {
207 return "Miscellaneous"; 207 return "Miscellaneous";
208} 208}
209 209
210void UpdateRescalingInfo() { 210void TranslateResolutionInfo(ResolutionSetup setup, ResolutionScalingInfo& info) {
211 const auto setup = values.resolution_setup.GetValue();
212 auto& info = values.resolution_info;
213 info.downscale = false; 211 info.downscale = false;
214 switch (setup) { 212 switch (setup) {
215 case ResolutionSetup::Res1_2X: 213 case ResolutionSetup::Res1_2X:
@@ -269,6 +267,12 @@ void UpdateRescalingInfo() {
269 info.active = info.up_scale != 1 || info.down_shift != 0; 267 info.active = info.up_scale != 1 || info.down_shift != 0;
270} 268}
271 269
270void UpdateRescalingInfo() {
271 const auto setup = values.resolution_setup.GetValue();
272 auto& info = values.resolution_info;
273 TranslateResolutionInfo(setup, info);
274}
275
272void RestoreGlobalState(bool is_powered_on) { 276void RestoreGlobalState(bool is_powered_on) {
273 // If a game is running, DO NOT restore the global settings state 277 // If a game is running, DO NOT restore the global settings state
274 if (is_powered_on) { 278 if (is_powered_on) {
diff --git a/src/common/settings.h b/src/common/settings.h
index b0bc6519a..4407c1e6d 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -525,6 +525,7 @@ std::string GetTimeZoneString(TimeZone time_zone);
525 525
526void LogSettings(); 526void LogSettings();
527 527
528void TranslateResolutionInfo(ResolutionSetup setup, ResolutionScalingInfo& info);
528void UpdateRescalingInfo(); 529void UpdateRescalingInfo();
529 530
530// Restore the global state of all applicable settings in the Values struct 531// Restore the global state of all applicable settings in the Values struct
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h
index e7cb59ea5..4edfd2bfb 100644
--- a/src/common/settings_enums.h
+++ b/src/common/settings_enums.h
@@ -146,6 +146,8 @@ ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum);
146 146
147ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch); 147ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
148 148
149ENUM(ScreenshotAspectRatio, Auto, R16_9, R4_3, R21_9, R16_10);
150
149template <typename Type> 151template <typename Type>
150inline std::string CanonicalizeEnum(Type id) { 152inline std::string CanonicalizeEnum(Type id) {
151 const auto group = EnumMetadata<Type>::Canonicalizations(); 153 const auto group = EnumMetadata<Type>::Canonicalizations();