diff options
Diffstat (limited to 'src/libui_sdl')
-rw-r--r-- | src/libui_sdl/DlgVideoSettings.cpp | 8 | ||||
-rw-r--r-- | src/libui_sdl/main.cpp | 27 |
2 files changed, 24 insertions, 11 deletions
diff --git a/src/libui_sdl/DlgVideoSettings.cpp b/src/libui_sdl/DlgVideoSettings.cpp index b6544ed..4d5de71 100644 --- a/src/libui_sdl/DlgVideoSettings.cpp +++ b/src/libui_sdl/DlgVideoSettings.cpp @@ -46,7 +46,12 @@ int OnCloseWindow(uiWindow* window, void* blarg) return 1; } -// +void OnResolutionChanged(uiRadioButtons* rb, void* blarg) +{ + int id = uiRadioButtonsSelected(rb); + + printf("res=%d\n", id); +} void OnCancel(uiButton* btn, void* blarg) { @@ -144,6 +149,7 @@ void Open() uiBoxAppend(in_ctrl, uiControl(lbl), 0); uiRadioButtons* rbResolution = uiNewRadioButtons(); + uiRadioButtonsOnSelected(rbResolution, OnResolutionChanged, NULL); uiRadioButtonsAppend(rbResolution, "1x"); uiRadioButtonsAppend(rbResolution, "2x"); uiRadioButtonsAppend(rbResolution, "4x"); diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 2853a90..b79853e 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -834,7 +834,6 @@ void SetupScreenRects(int width, int height) screenW *= ScreenScale; screenH *= ScreenScale; - gap *= ScreenScale; uiRect *topscreen, *bottomscreen; if (ScreenRotation == 1 || ScreenRotation == 2) @@ -1029,9 +1028,6 @@ void SetMinSize(int w, int h) int cw, ch; uiWindowContentSize(MainWindow, &cw, &ch); - w *= ScreenScale; - h *= ScreenScale; - uiControlSetMinSize(uiControl(MainDrawArea), w, h); if ((cw < w) || (ch < h)) { @@ -1534,26 +1530,31 @@ void EnsureProperMinSize() { bool isHori = (ScreenRotation == 1 || ScreenRotation == 3); + int w0 = 256 * ScreenScale; + int h0 = 192 * ScreenScale; + int w1 = 256 * ScreenScale; + int h1 = 192 * ScreenScale; + if (ScreenLayout == 0) // natural { if (isHori) - SetMinSize(384+ScreenGap, 256); + SetMinSize(h0+ScreenGap+h1, std::max(w0,w1)); else - SetMinSize(256, 384+ScreenGap); + SetMinSize(std::max(w0,w1), h0+ScreenGap+h1); } else if (ScreenLayout == 1) // vertical { if (isHori) - SetMinSize(192, 512+ScreenGap); + SetMinSize(std::max(h0,h1), w0+ScreenGap+w1); else - SetMinSize(256, 384+ScreenGap); + SetMinSize(std::max(w0,w1), h0+ScreenGap+h1); } else // horizontal { if (isHori) - SetMinSize(384+ScreenGap, 256); + SetMinSize(h0+ScreenGap+h1, std::max(w0,w1)); else - SetMinSize(512+ScreenGap, 192); + SetMinSize(w0+ScreenGap+w1, std::max(h0,h1)); } } @@ -1565,6 +1566,8 @@ void OnSetScreenSize(uiMenuItem* item, uiWindow* window, void* param) int w = 256*factor * ScreenScale; int h = 192*factor * ScreenScale; + // FIXME + if (ScreenLayout == 0) // natural { if (isHori) @@ -1696,6 +1699,10 @@ void ApplyNewSettings(int type) Platform::LAN_DeInit(); Platform::LAN_Init(); } + else if (type == 2) // upscaling/video settings + { + // + } EmuRunning = prevstatus; } |