mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 14:02:59 +01:00
Keep progress bar window centred after resize (#22354)
This commit is contained in:
@@ -1427,6 +1427,14 @@ void WindowResizeGui(int32_t width, int32_t height)
|
||||
optionsWindow->windowPos.y = (ContextGetHeight() - optionsWindow->height) / 2;
|
||||
}
|
||||
|
||||
// Keep progress bar window centred after a resize
|
||||
WindowBase* ProgressWindow = WindowFindByClass(WindowClass::ProgressWindow);
|
||||
if (ProgressWindow != nullptr)
|
||||
{
|
||||
ProgressWindow->windowPos.x = (ContextGetWidth() - ProgressWindow->width) / 2;
|
||||
ProgressWindow->windowPos.y = (ContextGetHeight() - ProgressWindow->height) / 2;
|
||||
}
|
||||
|
||||
GfxInvalidateScreen();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,6 @@ void PreloaderScene::Load()
|
||||
WindowSetFlagForAllViewports(VIEWPORT_FLAG_RENDERING_INHIBITED, true);
|
||||
WindowResizeGui(ContextGetWidth(), ContextGetHeight());
|
||||
|
||||
// Reset screen
|
||||
auto* engine = GetContext().GetDrawingEngine();
|
||||
auto* drawingContext = engine->GetDrawingContext();
|
||||
drawingContext->Clear(*engine->GetDrawingPixelInfo(), PALETTE_INDEX_10);
|
||||
|
||||
LOG_VERBOSE("PreloaderScene::Load() finished");
|
||||
}
|
||||
|
||||
@@ -59,6 +54,11 @@ void PreloaderScene::Tick()
|
||||
ContextHandleInput();
|
||||
WindowInvalidateAll();
|
||||
|
||||
// Reset screen
|
||||
auto* engine = GetContext().GetDrawingEngine();
|
||||
auto* drawingContext = engine->GetDrawingContext();
|
||||
drawingContext->Clear(*engine->GetDrawingPixelInfo(), PALETTE_INDEX_10);
|
||||
|
||||
gInUpdateCode = false;
|
||||
|
||||
if (_jobs.CountPending() == 0 && _jobs.CountProcessing() == 0)
|
||||
|
||||
Reference in New Issue
Block a user