From 30da5d1ba2aaf4949f40b20155a3080dcb74367c Mon Sep 17 00:00:00 2001 From: The Dax Date: Thu, 19 Sep 2013 14:32:56 -0400 Subject: [PATCH] Fix Rendering Resolution mode bug where the shortcut(currently CTRL + 1) wouldn't be synchronized with its DesktopUI(win32 menu bar) counterpart. First discussed in https://github.com/hrydgard/ppsspp/pull/3834. --- Windows/WndMainWindow.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 4b8518a12a..b22680bf48 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -231,8 +231,15 @@ namespace MainWindow ResizeDisplay(); } - void SetInternalResolution(int res) { - g_Config.iInternalResolution = res; + void SetInternalResolution(int res = -1) { + const int MAX_ZOOM = 10; + if (res >= 0 && res <= MAX_ZOOM) + g_Config.iInternalResolution = res; + else { + if (++g_Config.iInternalResolution > MAX_ZOOM) + g_Config.iInternalResolution = 0; + } + } void CorrectCursor() { @@ -1140,9 +1147,7 @@ namespace MainWindow case ID_OPTIONS_RESOLUTIONDUMMY: { - static int resolutionMultiplier = 0; - resolutionMultiplier = g_Config.iInternalResolution <= 10 ? ++resolutionMultiplier : 0; - SetInternalResolution(resolutionMultiplier); + SetInternalResolution(); ResizeDisplay(true); break; }