From b6c2dca8499de0b91e9860565a1187b15678664d Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 11 Dec 2018 08:13:09 +0100 Subject: [PATCH] Adjust replay notification position. --- src/openrct2/paint/Painter.cpp | 20 ++++++++++++-------- src/openrct2/paint/Painter.h | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 8bbcc05e11..2827c95e39 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -61,10 +61,17 @@ void Painter::Paint(IDrawingEngine& de) auto* replayManager = GetContext()->GetReplayManager(); if (replayManager != nullptr) { + const char* text = nullptr; + if (replayManager->IsReplaying()) - PaintReplayNotice(dpi, false); + text = "Replaying..."; else if (replayManager->IsRecording()) - PaintReplayNotice(dpi, true); + text = "Recording..."; + else if (replayManager->IsNormalising()) + text = "Normalising..."; + + if (text != nullptr) + PaintReplayNotice(dpi, text); } if (gConfigGeneral.show_fps) @@ -74,10 +81,10 @@ void Painter::Paint(IDrawingEngine& de) gCurrentDrawCount++; } -void OpenRCT2::Paint::Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, bool isRecording) +void Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text) { int32_t x = _uiContext->GetWidth() / 2; - int32_t y = _uiContext->GetHeight() - 24; + int32_t y = _uiContext->GetHeight() - 44; // Format string utf8 buffer[64] = { 0 }; @@ -86,10 +93,7 @@ void OpenRCT2::Paint::Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, bool is ch = utf8_write_codepoint(ch, FORMAT_OUTLINE); ch = utf8_write_codepoint(ch, FORMAT_RED); - if (isRecording) - snprintf(ch, 64 - (ch - buffer), "Recording..."); - else - snprintf(ch, 64 - (ch - buffer), "Replaying..."); + snprintf(ch, 64 - (ch - buffer), "%s", text); int32_t stringWidth = gfx_get_string_width(buffer); x = x - stringWidth; diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index 4437a513ab..eac7b6f139 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -44,7 +44,7 @@ namespace OpenRCT2 void Paint(Drawing::IDrawingEngine& de); private: - void PaintReplayNotice(rct_drawpixelinfo* dpi, bool isRecording); + void PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text); void PaintFPS(rct_drawpixelinfo* dpi); void MeasureFPS(); };