From 5bf882587a4f2d43b814c811abe94e93ed1e251a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:48:16 +0300 Subject: [PATCH] Use constexpr where applicable in Viewport.cpp --- src/openrct2/interface/Viewport.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 4f68f8ba27..dc0724ae3a 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -239,7 +239,12 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords) auto max = GetMapSizeMinus2(); if (pos.x > max && pos.y > max) { - const CoordsXY corr[] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }; + static constexpr CoordsXY corr[] = { + { -1, -1 }, + { 1, -1 }, + { 1, 1 }, + { -1, 1 }, + }; pos.x += corr[rotation].x * height; pos.y += corr[rotation].y * height; }