Fix large screen prompt not showing on first run

desktopWidth/desktopHeight were initialized only at the end of SDLOpen, after we checked if larger scales were supported. Need to initialize the window first, then recreate the window after if the scale can be larger. The window won't be centered, but otherwise it works.
This commit is contained in:
jacob1 2024-03-17 18:15:54 -04:00
parent 5160f4ad33
commit eef8943a3c
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995

View File

@ -445,19 +445,20 @@ int Main(int argc, char *argv[])
engine.Begin();
engine.SetFastQuit(prefs.Get("FastQuit", true));
engine.TouchUI = prefs.Get("TouchUI", DEFAULT_TOUCH_UI);
engine.windowFrameOps = windowFrameOps;
SDLOpen();
if (Client::Ref().IsFirstRun() && FORCE_WINDOW_FRAME_OPS == forceWindowFrameOpsNone)
{
auto guessed = GuessBestScale();
if (windowFrameOps.scale != guessed)
if (engine.windowFrameOps.scale != guessed)
{
windowFrameOps.scale = guessed;
engine.windowFrameOps.scale = guessed;
prefs.Set("Scale", windowFrameOps.scale);
showLargeScreenDialog = true;
}
}
engine.windowFrameOps = windowFrameOps;
SDLOpen();
bool enableBluescreen = USE_BLUESCREEN && !true_arg(arguments["disable-bluescreen"]);
if (enableBluescreen)