Settings: Simplify resolution scale enumeration

This commit is contained in:
Connor McLaughlin
2020-02-28 16:59:55 +10:00
parent f21cb25426
commit 07ba2ecd3d
6 changed files with 18 additions and 13 deletions

View File

@ -898,19 +898,18 @@ void HostInterface::ToggleSoftwareRendering()
void HostInterface::ModifyResolutionScale(s32 increment)
{
const u32 new_resolution_scale =
std::clamp<u32>(static_cast<u32>(static_cast<s32>(m_settings.gpu_resolution_scale) + increment), 1,
m_settings.max_gpu_resolution_scale);
const u32 new_resolution_scale = std::clamp<u32>(
static_cast<u32>(static_cast<s32>(m_settings.gpu_resolution_scale) + increment), 1, GPU::MAX_RESOLUTION_SCALE);
if (new_resolution_scale == m_settings.gpu_resolution_scale)
return;
m_settings.gpu_resolution_scale = new_resolution_scale;
if (m_system)
m_system->GetGPU()->UpdateSettings();
AddFormattedOSDMessage(2.0f, "Resolution scale set to %ux (%ux%u)", m_settings.gpu_resolution_scale,
GPU::VRAM_WIDTH * m_settings.gpu_resolution_scale,
GPU::VRAM_HEIGHT * m_settings.gpu_resolution_scale);
if (m_system)
m_system->GetGPU()->UpdateSettings();
}
void HostInterface::RecreateSystem()