diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-01-08 10:16:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:16:18 +0100 |
commit | 9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch) | |
tree | 3f287d339e15c4902ee415556475fd9b2918d33c /src/statusbar_gui.cpp | |
parent | c1fddb9a6ae5c3af6865461a7295788a341011a2 (diff) | |
download | openttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz |
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/statusbar_gui.cpp')
-rw-r--r-- | src/statusbar_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index f97d0d431..52b972086 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -120,7 +120,7 @@ struct StatusBarWindow : Window { case WID_S_RIGHT: { int64 max_money = UINT32_MAX; - for (const Company *c : Company::Iterate()) max_money = max<int64>(c->money, max_money); + for (const Company *c : Company::Iterate()) max_money = std::max<int64>(c->money, max_money); SetDParam(0, 100LL * max_money); d = GetStringBoundingBox(STR_COMPANY_MONEY); break; @@ -137,7 +137,7 @@ struct StatusBarWindow : Window { void DrawWidget(const Rect &r, int widget) const override { - int text_offset = max(0, ((int)(r.bottom - r.top + 1) - FONT_HEIGHT_NORMAL) / 2); // Offset for rendering the text vertically centered + int text_offset = std::max(0, ((int)(r.bottom - r.top + 1) - FONT_HEIGHT_NORMAL) / 2); // Offset for rendering the text vertically centered int text_top = r.top + text_offset; switch (widget) { case WID_S_LEFT: @@ -185,7 +185,7 @@ struct StatusBarWindow : Window { if (!this->reminder_timeout.HasElapsed()) { Dimension icon_size = GetSpriteSize(SPR_UNREAD_NEWS); - DrawSprite(SPR_UNREAD_NEWS, PAL_NONE, r.right - WD_FRAMERECT_RIGHT - icon_size.width, r.top + max(0, ((int)(r.bottom - r.top + 1) - (int)icon_size.height) / 2)); + DrawSprite(SPR_UNREAD_NEWS, PAL_NONE, r.right - WD_FRAMERECT_RIGHT - icon_size.width, r.top + std::max(0, ((int)(r.bottom - r.top + 1) - (int)icon_size.height) / 2)); } break; } |