diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 3f7814a..83343ae 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -2922,19 +2922,17 @@ void Video::ComputeViewportDimensions() case EAspectRatio::Custom: { - uint32_t horzAspect = Config::AspectWidth; - uint32_t vertAspect = Config::AspectHeight; - float customAspectRatio = float(horzAspect) / float(vertAspect); + float customAspectRatio = Config::CustomAspectRatio; if (aspectRatio > customAspectRatio) { - s_viewportWidth = height * horzAspect / vertAspect; + s_viewportWidth = height * customAspectRatio; s_viewportHeight = height; } else { s_viewportWidth = width; - s_viewportHeight = width * vertAspect / horzAspect; + s_viewportHeight = width * (1. / customAspectRatio); } break; @@ -7370,8 +7368,6 @@ void VideoConfigValueChangedCallback(IConfigDef* config) // Config options that require internal resolution resize g_needsResize |= config == &Config::AspectRatio || - config == &Config::AspectWidth || - config == &Config::AspectHeight || config == &Config::ResolutionScale || config == &Config::AntiAliasing || config == &Config::ShadowResolution; diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index 3a5d2bc..07b7493 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -547,7 +547,7 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) { EAspectRatio::Wide, { "16:9", "16:9: locks the game to a widescreen aspect ratio." } }, { EAspectRatio::Narrow, { "4:3", "4:3: locks the game to a narrow aspect ratio." } }, { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: locks the game to a narrow aspect ratio and retains parity with the game's original implementation." } }, - { EAspectRatio::Custom, { "Custom", "Custom: The aspect ratio is set to the values in 'Aspect Width' and 'Aspect Height'." } } + { EAspectRatio::Custom, { "Custom", "Custom:\nThe aspect ratio is set by using the CustomAspectRatio value in the config.toml file." } } } }, { @@ -566,7 +566,7 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) { EAspectRatio::Wide, { "16:9", "16:9: Stellt das Spiel in einem Breitbildschirm-Format dar." } }, { EAspectRatio::Narrow, { "4:3", "4:3: Stellt das Spiel in einem Mittel-Format dar." } }, { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: Stellt das Spiel in einem Mittel-Format dar, was der ursprünglichen Implementation originalgetreut bleibt." } }, - { EAspectRatio::Custom, { "Benutzerdefiniert", "Benutzerdefiniert:\nDas Seitenverhältnis entspricht den Werten in 'Seitenverhältnis-\nBreite' und 'Seitenverhältnis-\nHöhe'." } } + { EAspectRatio::Custom, { "Benutzerdefiniert", "Benutzerdefiniert:\nDas Seitenverhältnis entspricht dem Wert CustomAspectRatio in der Datei config.toml." } } } }, { @@ -598,18 +598,6 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) } }; -CONFIG_DEFINE_LOCALE(AspectWidth) -{ - { ELanguage::English, { "Aspect Width", "Adjust aspect width for custom aspect ratios." } }, - { ELanguage::German, { "Seitenverhältnis-Breite", "Passe die Breite für benutzerdefinierte Seitenverhältnisse an." } } -}; - -CONFIG_DEFINE_LOCALE(AspectHeight) -{ - { ELanguage::English, { "Aspect Height", "Adjust aspect height for custom aspect ratios." } }, - { ELanguage::German, { "Seitenverhältnis-Höhe", "Passe die Höhe für benutzerdefinierte Seitenverhältnisse an." } } -}; - // Japanese Notes: This localization should include furigana. CONFIG_DEFINE_LOCALE(ResolutionScale) { diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index 35ea89b..a9955d2 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -1266,8 +1266,6 @@ static void DrawConfigOptions() DrawConfigOption(rowCount++, yOffset, &Config::Monitor, canChangeMonitor, monitorReason, 0, 0, displayCount - 1, false); DrawConfigOption(rowCount++, yOffset, &Config::AspectRatio, true); - DrawConfigOption(rowCount++, yOffset, &Config::AspectWidth, true, nullptr, 1, 50, 100); - DrawConfigOption(rowCount++, yOffset, &Config::AspectHeight, true, nullptr, 1, 50, 100); DrawConfigOption(rowCount++, yOffset, &Config::ResolutionScale, true, nullptr, 0.25f, 1.0f, 2.0f); DrawConfigOption(rowCount++, yOffset, &Config::Fullscreen, true); DrawConfigOption(rowCount++, yOffset, &Config::VSync, true); diff --git a/UnleashedRecomp/user/config_def.h b/UnleashedRecomp/user/config_def.h index 7982cd3..eb3e644 100644 --- a/UnleashedRecomp/user/config_def.h +++ b/UnleashedRecomp/user/config_def.h @@ -56,8 +56,7 @@ CONFIG_DEFINE("Video", int32_t, WindowHeight, 720); CONFIG_DEFINE_ENUM("Video", EWindowState, WindowState, EWindowState::Normal); CONFIG_DEFINE_LOCALISED("Video", int32_t, Monitor, 0); CONFIG_DEFINE_ENUM_LOCALISED("Video", EAspectRatio, AspectRatio, EAspectRatio::Auto); -CONFIG_DEFINE_LOCALISED("Video", int32_t, AspectWidth, 16); -CONFIG_DEFINE_LOCALISED("Video", int32_t, AspectHeight, 9); +CONFIG_DEFINE("Video", float, CustomAspectRatio, (16.0f / 9.0f)); CONFIG_DEFINE_LOCALISED("Video", float, ResolutionScale, 1.0f); CONFIG_DEFINE_LOCALISED("Video", bool, Fullscreen, true); CONFIG_DEFINE_LOCALISED("Video", bool, VSync, true);