diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index ff0c04dbceb2..91d6e4e7de96 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -72,6 +72,8 @@ #include "Windows/W32Util/ShellUtil.h" #endif +extern bool g_ShaderNameListChanged; + GameSettingsScreen::GameSettingsScreen(std::string gamePath, std::string gameID, bool editThenRestore) : UIDialogScreenWithGameBackground(gamePath), gameID_(gameID), enableReports_(false), editThenRestore_(editThenRestore) { lastVertical_ = UseVerticalLayout(); @@ -1169,6 +1171,10 @@ void GameSettingsScreen::update() { RecreateViews(); lastVertical_ = vertical; } + if (g_ShaderNameListChanged) { + g_ShaderNameListChanged = false; + RecreateViews(); + } } void GameSettingsScreen::onFinish(DialogResult result) { @@ -1437,7 +1443,7 @@ UI::EventReturn GameSettingsScreen::OnPostProcShaderChange(UI::EventParams &e) { NativeMessageReceived("gpu_resized", ""); g_Config.vPostShaderNames.erase(std::remove(g_Config.vPostShaderNames.begin(), g_Config.vPostShaderNames.end(), "Off"), g_Config.vPostShaderNames.end()); g_Config.vPostShaderNames.push_back("Off"); - RecreateViews(); + g_ShaderNameListChanged = true; return UI::EVENT_DONE; } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 9e3ea05102bd..3dd207ef1f2a 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -148,6 +148,7 @@ std::string config_filename; // Really need to clean this mess of globals up... but instead I add more :P bool g_TakeScreenshot; +bool g_ShaderNameListChanged = false; static bool isOuya; static bool resized = false; static bool restarting = false; diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index 651e60bb77ef..f96b794f955a 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -44,6 +44,7 @@ #include "Core/Core.h" extern bool g_TakeScreenshot; +extern bool g_ShaderNameListChanged; namespace MainWindow { extern HINSTANCE hInst; @@ -151,7 +152,7 @@ namespace MainWindow { int item = ID_SHADERS_BASE + 1; for (size_t i = 0; i < availableShaders.size(); i++) - CheckMenuItem(menu, item++, ((g_Config.vPostShaderNames[0] == availableShaders[i]) ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(menu, item++, ((g_Config.vPostShaderNames[0] == availableShaders[i] && (g_Config.vPostShaderNames[0] == "Off" || g_Config.vPostShaderNames[1] == "Off")) ? MF_CHECKED : MF_UNCHECKED)); } bool CreateShadersSubmenu(HMENU menu) { @@ -185,7 +186,7 @@ namespace MainWindow { continue; int checkedStatus = MF_UNCHECKED; availableShaders.push_back(i->section); - if (g_Config.vPostShaderNames[0] == i->section) { + if (g_Config.vPostShaderNames[0] == i->section && (g_Config.vPostShaderNames[0] == "Off" || g_Config.vPostShaderNames[1] == "Off")) { checkedStatus = MF_CHECKED; } @@ -1056,8 +1057,11 @@ namespace MainWindow { // ID_SHADERS_BASE and an additional 1 off it. u32 index = (wParam - ID_SHADERS_BASE - 1); if (index < availableShaders.size()) { - g_Config.vPostShaderNames[0] = availableShaders[index]; - + g_Config.vPostShaderNames.clear(); + if (availableShaders[index] != "Off") + g_Config.vPostShaderNames.push_back(availableShaders[index]); + g_Config.vPostShaderNames.push_back("Off"); + g_ShaderNameListChanged = true; NativeMessageReceived("gpu_resized", ""); break; }