save window size

This commit is contained in:
StapleButter 2017-10-02 23:15:39 +02:00
parent 4781bd5671
commit f8b63759f7

View File

@ -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();