From 904316de604dcba269f5c0e254f272570d2c049d Mon Sep 17 00:00:00 2001 From: StapleButter Date: Tue, 12 Dec 2017 02:32:11 +0100 Subject: [PATCH] fix ScreenGap loading, fixes #218 --- src/libui_sdl/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index eb6a1082..61742b57 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1184,16 +1184,20 @@ int main(int argc, char** argv) #define SANITIZE(var, min, max) if ((var < min) || (var > max)) var = 0; SANITIZE(ScreenRotation, 0, 3); - SANITIZE(ScreenGap, 0, 5); SANITIZE(ScreenLayout, 0, 2); SANITIZE(ScreenSizing, 0, 3); #undef SANITIZE uiMenuItemSetChecked(MenuItem_ScreenRot[ScreenRotation], 1); - uiMenuItemSetChecked(MenuItem_ScreenGap[ScreenGap], 1); uiMenuItemSetChecked(MenuItem_ScreenLayout[ScreenLayout], 1); uiMenuItemSetChecked(MenuItem_ScreenSizing[ScreenSizing], 1); + for (int i = 0; i < 6; i++) + { + if (ScreenGap == kScreenGap[i]) + uiMenuItemSetChecked(MenuItem_ScreenGap[i], 1); + } + OnSetScreenRotation(MenuItem_ScreenRot[ScreenRotation], MainWindow, (void*)&kScreenRot[ScreenRotation]); EmuRunning = 2;