mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 19:00:33 +02:00
set window position before displaying it
This commit is contained in:
@@ -546,17 +546,14 @@ int GetModifiers()
|
||||
|
||||
// Returns true if the loaded position was set
|
||||
// Returns false if something went wrong: SDL_GetWMInfo failed or the loaded position was invalid
|
||||
bool LoadWindowPosition()
|
||||
bool LoadWindowPosition(int scale)
|
||||
{
|
||||
SDL_SysWMinfo sysInfo;
|
||||
SDL_VERSION(&sysInfo.version);
|
||||
if (SDL_GetWMInfo(&sysInfo) > 0)
|
||||
{
|
||||
RECT rcWindow;
|
||||
GetWindowRect(sysInfo.window, &rcWindow);
|
||||
|
||||
int windowW = rcWindow.right - rcWindow.left - 1;
|
||||
int windowH = rcWindow.bottom - rcWindow.top - 1;
|
||||
int windowW = (XRES + BARSIZE) * scale;
|
||||
int windowH = (YRES + MENUSIZE) * scale;
|
||||
|
||||
int savedWindowX = Client::Ref().GetPrefInteger("WindowX", INT_MAX);
|
||||
int savedWindowY = Client::Ref().GetPrefInteger("WindowY", INT_MAX);
|
||||
@@ -685,12 +682,10 @@ int main(int argc, char * argv[])
|
||||
tempScale = 1;
|
||||
|
||||
int sdlStatus = SDLOpen();
|
||||
sdl_scrn = SDLSetScreen(tempScale, tempFullscreen);
|
||||
|
||||
#ifdef WIN
|
||||
// Must be after SDLSetScreen to account for scale
|
||||
LoadWindowPosition();
|
||||
LoadWindowPosition(tempScale);
|
||||
#endif
|
||||
sdl_scrn = SDLSetScreen(tempScale, tempFullscreen);
|
||||
|
||||
#ifdef OGLI
|
||||
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
Reference in New Issue
Block a user