From 9b15ce093443b7289fc4dc3667530fdc416f3514 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 26 Mar 2016 14:34:24 -0700 Subject: [PATCH] UI: Fix texture scaling level selection. It previously was not possible to select 4 on a POT-only device, since it would become 3, which would in turn become 2. Also, this allows selection on other backends, e.g. Vulkan. --- UI/GameSettingsScreen.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 3651c0bf66..56854e5b73 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -250,22 +250,18 @@ void GameSettingsScreen::CreateViews() { graphicsSettings->Add(new ItemHeader(gr->T("Texture Scaling"))); #ifndef MOBILE_DEVICE static const char *texScaleLevelsNPOT[] = {"Auto", "Off", "2x", "3x", "4x", "5x"}; - static const char *texScaleLevelsPOT[] = {"Auto", "Off", "2x", "4x"}; #else static const char *texScaleLevelsNPOT[] = {"Auto", "Off", "2x", "3x"}; - static const char *texScaleLevelsPOT[] = {"Auto", "Off", "2x"}; #endif - static const char **texScaleLevels; - static int numTexScaleLevels; - if (gl_extensions.OES_texture_npot) { - texScaleLevels = texScaleLevelsNPOT; - numTexScaleLevels = ARRAY_SIZE(texScaleLevelsNPOT); - } else { - texScaleLevels = texScaleLevelsPOT; - numTexScaleLevels = ARRAY_SIZE(texScaleLevelsPOT); - } + static const char **texScaleLevels = texScaleLevelsNPOT; + static int numTexScaleLevels = ARRAY_SIZE(texScaleLevelsNPOT); PopupMultiChoice *texScalingChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gr->T("Upscale Level"), texScaleLevels, 0, numTexScaleLevels, gr->GetName(), screenManager())); + // TODO: Better check? When it won't work, it scales down anyway. + if (!gl_extensions.OES_texture_npot && GetGPUBackend() == GPUBackend::OPENGL) { + texScalingChoice->HideChoice(3); // 3x + texScalingChoice->HideChoice(5); // 5x + } texScalingChoice->SetDisabledPtr(&g_Config.bSoftwareRendering); static const char *texScaleAlgos[] = { "xBRZ", "Hybrid", "Bicubic", "Hybrid + Bicubic", };