1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Skip viewport render during preloader

Reset screen to a nice background colour
This commit is contained in:
Aaron van Geffen
2024-04-24 23:15:21 +02:00
parent 9f45d40bae
commit fe7152fc72
3 changed files with 12 additions and 0 deletions

View File

@@ -46,6 +46,10 @@ static Widget _mainWidgets[] = {
void OnDraw(DrawPixelInfo& dpi) override
{
// Skip viewport render during preloader
if (GetContext()->GetActiveScene() == GetContext()->GetPreloaderScene())
return;
ViewportRender(dpi, viewport, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } });
}

View File

@@ -117,6 +117,7 @@ static Widget window_network_status_widgets[] = {
void SetWindowNetworkStatusText(const std::string& text)
{
_windowNetworkStatusText = text;
Invalidate();
}
void SetPassword(char* password)

View File

@@ -14,6 +14,8 @@
#include "../../GameState.h"
#include "../../OpenRCT2.h"
#include "../../audio/audio.h"
#include "../../drawing/IDrawingContext.h"
#include "../../drawing/IDrawingEngine.h"
#include "../../interface/Viewport.h"
#include "../../interface/Window.h"
#include "../../localisation/LocalisationService.h"
@@ -38,6 +40,11 @@ void PreloaderScene::Load()
ContextOpenWindow(WindowClass::MainWindow);
WindowResizeGui(ContextGetWidth(), ContextGetHeight());
// Reset screen
auto* engine = GetContext().GetDrawingEngine();
auto* drawingContext = engine->GetDrawingContext();
drawingContext->Clear(*engine->GetDrawingPixelInfo(), PALETTE_INDEX_10);
UpdateCaption(STR_LOADING_GENERIC);
LOG_VERBOSE("PreloaderScene::Load() finished");