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:
@@ -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 } });
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ static Widget window_network_status_widgets[] = {
|
||||
void SetWindowNetworkStatusText(const std::string& text)
|
||||
{
|
||||
_windowNetworkStatusText = text;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
void SetPassword(char* password)
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user