mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use constexpr where applicable in Viewport.cpp
This commit is contained in:
parent
04ba3f92d7
commit
5bf882587a
|
@ -239,7 +239,12 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords)
|
||||||
auto max = GetMapSizeMinus2();
|
auto max = GetMapSizeMinus2();
|
||||||
if (pos.x > max && pos.y > max)
|
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.x += corr[rotation].x * height;
|
||||||
pos.y += corr[rotation].y * height;
|
pos.y += corr[rotation].y * height;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue