diff options
| author | Stenzek <stenzek@gmail.com> | 2019-08-30 08:08:15 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-10-01 01:17:08 +1000 |
| commit | abc97bb0fa63e18971dbb4dfd7d02ae4184b9410 (patch) | |
| tree | 92447c301d359bec08bfdd0143e4d583167d3d3b /Source/Core | |
| parent | d3a9104cee5bb599e6c1c36c8c2e2cc6128ea9c9 (diff) | |
DolphinQt: Don't overwrite >8x IR scale in ini, add maximum internal res option
This adds an ini-only setting under GFX.ini -> [Settings] ->
MaxInternalResolution. Setting this will allow the user to select
resolutions beyond the default 8x max scale in graphics options.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Config/GraphicsSettings.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/Core/Config/GraphicsSettings.h | 1 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp | 33 |
3 files changed, 23 insertions, 12 deletions
diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 83baf5ae05..84b9a49244 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -61,6 +61,7 @@ const ConfigInfo<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthC const ConfigInfo<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1}; const ConfigInfo<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false}; const ConfigInfo<int> GFX_EFB_SCALE{{System::GFX, "Settings", "InternalResolution"}, 1}; +const ConfigInfo<int> GFX_MAX_EFB_SCALE{{System::GFX, "Settings", "MaxInternalResolution"}, 8}; const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, false}; const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index dc8d501fab..26f62382ca 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -54,6 +54,7 @@ extern const ConfigInfo<bool> GFX_FAST_DEPTH_CALC; extern const ConfigInfo<u32> GFX_MSAA; extern const ConfigInfo<bool> GFX_SSAA; extern const ConfigInfo<int> GFX_EFB_SCALE; +extern const ConfigInfo<int> GFX_MAX_EFB_SCALE; extern const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE; extern const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_CENTER; extern const ConfigInfo<bool> GFX_ENABLE_WIREFRAME; diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index 11d7befe58..0fcb0a6c53 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -26,6 +26,7 @@ #include "VideoCommon/PostProcessing.h" #include "VideoCommon/VideoBackendBase.h" +#include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent) @@ -48,21 +49,29 @@ void EnhancementsWidget::CreateWidgets() auto* enhancements_layout = new QGridLayout(); enhancements_box->setLayout(enhancements_layout); - m_ir_combo = new GraphicsChoice({tr("Auto (Multiple of 640x528)"), tr("Native (640x528)"), - tr("2x Native (1280x1056) for 720p"), - tr("3x Native (1920x1584) for 1080p"), - tr("4x Native (2560x2112) for 1440p"), - tr("5x Native (3200x2640)"), tr("6x Native (3840x3168) for 4K"), - tr("7x Native (4480x3696)"), tr("8x Native (5120x4224) for 5K")}, - Config::GFX_EFB_SCALE); - - if (g_Config.iEFBScale > 8) + // Only display the first 8 scales, which most users will not go beyond. + QStringList resolution_options{ + tr("Auto (Multiple of 640x528)"), tr("Native (640x528)"), + tr("2x Native (1280x1056) for 720p"), tr("3x Native (1920x1584) for 1080p"), + tr("4x Native (2560x2112) for 1440p"), tr("5x Native (3200x2640)"), + tr("6x Native (3840x3168) for 4K"), tr("7x Native (4480x3696)"), + tr("8x Native (5120x4224) for 5K")}; + const int visible_resolution_option_count = static_cast<int>(resolution_options.size()); + + // If the current scale is greater than the max scale in the ini, add sufficient options so that + // when the settings are saved we don't lose the user-modified value from the ini. + const int max_efb_scale = + std::max(Config::Get(Config::GFX_EFB_SCALE), Config::Get(Config::GFX_MAX_EFB_SCALE)); + for (int scale = static_cast<int>(resolution_options.size()); scale <= max_efb_scale; scale++) { - m_ir_combo->addItem(tr("Custom")); - m_ir_combo->setCurrentIndex(m_ir_combo->count() - 1); + resolution_options.append(tr("%1x Native (%2x%3)") + .arg(QString::number(scale), + QString::number(static_cast<int>(EFB_WIDTH) * scale), + QString::number(static_cast<int>(EFB_HEIGHT) * scale))); } - m_ir_combo->setMaxVisibleItems(m_ir_combo->count()); + m_ir_combo = new GraphicsChoice(resolution_options, Config::GFX_EFB_SCALE); + m_ir_combo->setMaxVisibleItems(visible_resolution_option_count); m_aa_combo = new QComboBox(); m_af_combo = new GraphicsChoice({tr("1x"), tr("2x"), tr("4x"), tr("8x"), tr("16x")}, |
