From f8b63759f722be1f2ae0156bea6957a739c1bb6f Mon Sep 17 00:00:00 2001 From: StapleButter Date: Mon, 2 Oct 2017 23:15:39 +0200 Subject: save window size --- src/libui_sdl/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/libui_sdl') 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(); -- cgit v1.2.3