1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Use constexpr where applicable in Viewport.cpp

This commit is contained in:
ζeh Matt
2021-08-26 22:48:16 +03:00
parent 04ba3f92d7
commit 5bf882587a

View File

@@ -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;
}