mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 18:34:21 +02:00
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:
@@ -445,19 +445,20 @@ int Main(int argc, char *argv[])
|
|||||||
engine.Begin();
|
engine.Begin();
|
||||||
engine.SetFastQuit(prefs.Get("FastQuit", true));
|
engine.SetFastQuit(prefs.Get("FastQuit", true));
|
||||||
engine.TouchUI = prefs.Get("TouchUI", DEFAULT_TOUCH_UI);
|
engine.TouchUI = prefs.Get("TouchUI", DEFAULT_TOUCH_UI);
|
||||||
|
engine.windowFrameOps = windowFrameOps;
|
||||||
|
|
||||||
|
SDLOpen();
|
||||||
|
|
||||||
if (Client::Ref().IsFirstRun() && FORCE_WINDOW_FRAME_OPS == forceWindowFrameOpsNone)
|
if (Client::Ref().IsFirstRun() && FORCE_WINDOW_FRAME_OPS == forceWindowFrameOpsNone)
|
||||||
{
|
{
|
||||||
auto guessed = GuessBestScale();
|
auto guessed = GuessBestScale();
|
||||||
if (windowFrameOps.scale != guessed)
|
if (engine.windowFrameOps.scale != guessed)
|
||||||
{
|
{
|
||||||
windowFrameOps.scale = guessed;
|
engine.windowFrameOps.scale = guessed;
|
||||||
prefs.Set("Scale", windowFrameOps.scale);
|
prefs.Set("Scale", windowFrameOps.scale);
|
||||||
showLargeScreenDialog = true;
|
showLargeScreenDialog = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
engine.windowFrameOps = windowFrameOps;
|
|
||||||
|
|
||||||
SDLOpen();
|
|
||||||
|
|
||||||
bool enableBluescreen = USE_BLUESCREEN && !true_arg(arguments["disable-bluescreen"]);
|
bool enableBluescreen = USE_BLUESCREEN && !true_arg(arguments["disable-bluescreen"]);
|
||||||
if (enableBluescreen)
|
if (enableBluescreen)
|
||||||
|
Reference in New Issue
Block a user