aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/main.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-05-12 16:47:34 +0200
committerArisotura <thetotalworm@gmail.com>2019-05-12 16:47:34 +0200
commitf5ba35ca9f42974f250c0241ccf18a3f36da79c4 (patch)
tree1e5ea5c102bd7bb6cc9aa2eb95be3231cc1c5807 /src/libui_sdl/main.cpp
parent0a464c504de43bbcd4a0bedf982e8f0e16cf0f32 (diff)
don't scale the screen gap
Diffstat (limited to 'src/libui_sdl/main.cpp')
-rw-r--r--src/libui_sdl/main.cpp27
1 files changed, 17 insertions, 10 deletions
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;
}