From eccbbdbe5942e372b6ffc89ec2a78ed30a1496f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 24 Aug 2021 15:07:25 -0700 Subject: [PATCH] Use inline for direction functions in Location.hpp --- src/openrct2/world/Location.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 120cb502d7..c9f90a921b 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -496,12 +496,12 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the direction that points the other way, * on the same axis. */ -[[maybe_unused]] static constexpr Direction direction_reverse(Direction dir) +inline constexpr Direction direction_reverse(Direction dir) { return dir ^ 2; } -[[maybe_unused]] static constexpr bool direction_valid(Direction dir) +inline constexpr bool direction_valid(Direction dir) { return dir < NumOrthogonalDirections; } @@ -510,7 +510,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the next cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -[[maybe_unused]] static constexpr Direction direction_next(Direction dir) +inline constexpr Direction direction_next(Direction dir) { return (dir + 1) & 0x03; } @@ -519,7 +519,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the previous cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -[[maybe_unused]] static constexpr Direction direction_prev(Direction dir) +inline constexpr Direction direction_prev(Direction dir) { return (dir - 1) & 0x03; } @@ -527,7 +527,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; /** * Given two positions, return the cardinal direction which is closest to the direction from 'from' to 'to'. */ -[[maybe_unused]] static constexpr Direction DirectionFromTo(const CoordsXY& from, const CoordsXY& to) +inline constexpr Direction DirectionFromTo(const CoordsXY& from, const CoordsXY& to) { int16_t x_diff = to.x - from.x; int16_t y_diff = to.y - from.y;