Added 32:9 aspect ratio

This commit is contained in:
niansa 2024-03-09 19:03:08 +01:00 committed by Crimson Hawk
parent 4a66295a6d
commit cb9654651a
5 changed files with 7 additions and 1 deletions

View file

@ -149,7 +149,7 @@ ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, ScaleForce, Fs
ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum); ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum);
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch); ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, R32_9, Stretch);
ENUM(ConsoleMode, Handheld, Docked); ENUM(ConsoleMode, Handheld, Docked);

View file

@ -70,6 +70,8 @@ float EmulationAspectRatio(AspectRatio aspect, float window_aspect_ratio) {
return 9.0f / 21.0f; return 9.0f / 21.0f;
case AspectRatio::R16_10: case AspectRatio::R16_10:
return 10.0f / 16.0f; return 10.0f / 16.0f;
case AspectRatio::R32_9:
return 9.0f / 32.0f;
case AspectRatio::StretchToWindow: case AspectRatio::StretchToWindow:
return window_aspect_ratio; return window_aspect_ratio;
default: default:

View file

@ -28,6 +28,7 @@ enum class AspectRatio {
R4_3, R4_3,
R21_9, R21_9,
R16_10, R16_10,
R32_9,
StretchToWindow, StretchToWindow,
}; };

View file

@ -406,6 +406,7 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
PAIR(AspectRatio, R4_3, tr("Force 4:3")), PAIR(AspectRatio, R4_3, tr("Force 4:3")),
PAIR(AspectRatio, R21_9, tr("Force 21:9")), PAIR(AspectRatio, R21_9, tr("Force 21:9")),
PAIR(AspectRatio, R16_10, tr("Force 16:10")), PAIR(AspectRatio, R16_10, tr("Force 16:10")),
PAIR(AspectRatio, R32_9, tr("Force 32:9")),
PAIR(AspectRatio, Stretch, tr("Stretch to Window")), PAIR(AspectRatio, Stretch, tr("Stretch to Window")),
}}); }});
translations->insert({Settings::EnumMetadata<Settings::AnisotropyMode>::Index(), translations->insert({Settings::EnumMetadata<Settings::AnisotropyMode>::Index(),

View file

@ -47,6 +47,8 @@ u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
return height * 21 / 9; return height * 21 / 9;
case Settings::AspectRatio::R16_10: case Settings::AspectRatio::R16_10:
return height * 16 / 10; return height * 16 / 10;
case Settings::AspectRatio::R32_9:
return height * 32 / 9;
case Settings::AspectRatio::R16_9: case Settings::AspectRatio::R16_9:
case Settings::AspectRatio::Stretch: case Settings::AspectRatio::Stretch:
// TODO: Move this function wherever appropriate to implement Stretched aspect // TODO: Move this function wherever appropriate to implement Stretched aspect