1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-12 10:32:26 +01:00

Adjust replay notification position.

This commit is contained in:
Matt
2018-12-11 08:13:09 +01:00
parent f6dbf5f1a2
commit b6c2dca849
2 changed files with 13 additions and 9 deletions

View File

@@ -61,10 +61,17 @@ void Painter::Paint(IDrawingEngine& de)
auto* replayManager = GetContext()->GetReplayManager(); auto* replayManager = GetContext()->GetReplayManager();
if (replayManager != nullptr) if (replayManager != nullptr)
{ {
const char* text = nullptr;
if (replayManager->IsReplaying()) if (replayManager->IsReplaying())
PaintReplayNotice(dpi, false); text = "Replaying...";
else if (replayManager->IsRecording()) 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) if (gConfigGeneral.show_fps)
@@ -74,10 +81,10 @@ void Painter::Paint(IDrawingEngine& de)
gCurrentDrawCount++; 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 x = _uiContext->GetWidth() / 2;
int32_t y = _uiContext->GetHeight() - 24; int32_t y = _uiContext->GetHeight() - 44;
// Format string // Format string
utf8 buffer[64] = { 0 }; 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_OUTLINE);
ch = utf8_write_codepoint(ch, FORMAT_RED); ch = utf8_write_codepoint(ch, FORMAT_RED);
if (isRecording) snprintf(ch, 64 - (ch - buffer), "%s", text);
snprintf(ch, 64 - (ch - buffer), "Recording...");
else
snprintf(ch, 64 - (ch - buffer), "Replaying...");
int32_t stringWidth = gfx_get_string_width(buffer); int32_t stringWidth = gfx_get_string_width(buffer);
x = x - stringWidth; x = x - stringWidth;

View File

@@ -44,7 +44,7 @@ namespace OpenRCT2
void Paint(Drawing::IDrawingEngine& de); void Paint(Drawing::IDrawingEngine& de);
private: private:
void PaintReplayNotice(rct_drawpixelinfo* dpi, bool isRecording); void PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text);
void PaintFPS(rct_drawpixelinfo* dpi); void PaintFPS(rct_drawpixelinfo* dpi);
void MeasureFPS(); void MeasureFPS();
}; };