aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-10-02 23:15:39 +0200
committerStapleButter <thetotalworm@gmail.com>2017-10-02 23:15:39 +0200
commitf8b63759f722be1f2ae0156bea6957a739c1bb6f (patch)
tree097e9159fc51b7d4cf3768bae60267f508509b75 /src/libui_sdl
parent4781bd56719ded97759cce685a2ba40770905c12 (diff)
save window size
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 4f2285a..3bd57f5 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -363,6 +363,13 @@ void OnAreaResize(uiAreaHandler* handler, uiArea* area, int width, int height)
BottomScreenRect.Y = (targetH / 2) + gap;
BottomScreenRect.Height = targetH / 2;
}
+
+ // TODO:
+ // should those be the size of the uiArea, or the size of the window client area?
+ // for now the uiArea fills the whole window anyway
+ // but... we never know, I guess
+ Config::WindowWidth = width;
+ Config::WindowHeight = height;
}
@@ -634,7 +641,12 @@ int main(int argc, char** argv)
// TODO: need submenu support in libui.
}*/
- MainWindow = uiNewWindow("melonDS " MELONDS_VERSION, 256, 384, 1);
+ int w = Config::WindowWidth;
+ int h = Config::WindowHeight;
+ if (w < 256) w = 256;
+ if (h < 384) h = 384;
+
+ MainWindow = uiNewWindow("melonDS " MELONDS_VERSION, w, h, 1);
uiWindowOnClosing(MainWindow, OnCloseWindow, NULL);
uiWindowSetDropTarget(MainWindow, 1);
@@ -685,6 +697,8 @@ int main(int argc, char** argv)
EmuRunning = 0;
SDL_WaitThread(EmuThread, NULL);
+ Config::Save();
+
if (ScreenBitmap) uiDrawFreeBitmap(ScreenBitmap);
uiUninit();