System: Add option to automatically resize window
This commit is contained in:
@ -4431,6 +4431,10 @@ void FullscreenUI::DrawDisplaySettingsPage()
|
||||
FSUI_CSTR("Stretches the display to match the aspect ratio by multiplying vertically instead of horizontally."),
|
||||
"Display", "StretchVertically", false);
|
||||
|
||||
DrawToggleSetting(bsi, FSUI_CSTR("Automatically Resize Window"),
|
||||
FSUI_CSTR("Automatically resizes the window to match the internal resolution."), "Display",
|
||||
"AutoResizeWindow", false);
|
||||
|
||||
DrawToggleSetting(
|
||||
bsi, FSUI_CSTR("Disable Mailbox Presentation"),
|
||||
FSUI_CSTR("Forces the use of FIFO over Mailbox presentation, i.e. double buffering instead of triple buffering. "
|
||||
@ -7229,8 +7233,10 @@ TRANSLATE_NOOP("FullscreenUI", "Automatic based on window size");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping completed for {}.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping failed for {}.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatic mapping failed, no devices are available.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically Resize Window");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically applies patches to disc images when they are present, currently only PPF is supported.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically loads and applies cheats on game start. Cheats can break games and saves.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically resizes the window to match the internal resolution.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically saves the emulator state when powering down or exiting. You can then resume directly from where you left off next time.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically switches to fullscreen mode when the program is started.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Avoids calls to C++ code, significantly speeding up the recompiler.");
|
||||
|
||||
@ -1985,6 +1985,13 @@ void GPU::SetDisplayTexture(GPUTexture* texture, GPUTexture* depth_buffer, s32 v
|
||||
s32 view_height)
|
||||
{
|
||||
DebugAssert(texture);
|
||||
|
||||
if (g_settings.display_auto_resize_window &&
|
||||
(view_width != m_display_texture_view_width || view_height != m_display_texture_view_height))
|
||||
{
|
||||
System::RequestDisplaySize();
|
||||
}
|
||||
|
||||
m_display_texture = texture;
|
||||
m_display_depth_buffer = depth_buffer;
|
||||
m_display_texture_view_x = view_x;
|
||||
|
||||
@ -317,6 +317,7 @@ void Settings::Load(SettingsInterface& si, SettingsInterface& controller_si)
|
||||
display_show_inputs = si.GetBoolValue("Display", "ShowInputs", false);
|
||||
display_show_enhancements = si.GetBoolValue("Display", "ShowEnhancements", false);
|
||||
display_stretch_vertically = si.GetBoolValue("Display", "StretchVertically", false);
|
||||
display_auto_resize_window = si.GetBoolValue("Display", "AutoResizeWindow", false);
|
||||
display_osd_scale = si.GetFloatValue("Display", "OSDScale", DEFAULT_OSD_SCALE);
|
||||
|
||||
save_state_compression = ParseSaveStateCompressionModeName(
|
||||
@ -591,6 +592,7 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
|
||||
}
|
||||
|
||||
si.SetBoolValue("Display", "StretchVertically", display_stretch_vertically);
|
||||
si.SetBoolValue("Display", "AutoResizeWindow", display_auto_resize_window);
|
||||
|
||||
si.SetIntValue("CDROM", "ReadaheadSectors", cdrom_readahead_sectors);
|
||||
si.SetStringValue("CDROM", "MechaconVersion", GetCDROMMechVersionName(cdrom_mechacon_version));
|
||||
|
||||
@ -172,6 +172,7 @@ struct Settings
|
||||
bool display_show_inputs : 1 = false;
|
||||
bool display_show_enhancements : 1 = false;
|
||||
bool display_stretch_vertically : 1 = false;
|
||||
bool display_auto_resize_window : 1 = false;
|
||||
float display_pre_frame_sleep_buffer = DEFAULT_DISPLAY_PRE_FRAME_SLEEP_BUFFER;
|
||||
float display_osd_scale = 100.0f;
|
||||
float gpu_pgxp_tolerance = -1.0f;
|
||||
|
||||
Reference in New Issue
Block a user