mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-21 23:42:18 +00:00
Remove AspectWidth and AspectHeight, instead introduce CustomAspectRatio option
This commit is contained in:
parent
27526bb41d
commit
b168872d8a
4 changed files with 6 additions and 25 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue