diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-14 12:46:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-14 12:46:07 +0200 |
commit | 6f699727d7948e56613a1a8e85d520bc49081b7f (patch) | |
tree | 93d83ce2f8de4451b77d0615bf779bc596c1dd45 /src | |
parent | e900975255452b70f7474b78050b9c6342912cfe (diff) |
a
Diffstat (limited to 'src')
-rw-r--r-- | src/path-search.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/path-search.cpp b/src/path-search.cpp index e4d8c1cf..ed93221e 100644 --- a/src/path-search.cpp +++ b/src/path-search.cpp @@ -92,30 +92,31 @@ auto path_search::make_neighbor_tile_bbox(Vector2i coord, Vector2ub own_size, ro constexpr auto half_tile = iTILE_SIZE2/2; constexpr int offset_W = iTILE_SIZE2.x(), offset_N = iTILE_SIZE2.y(); - auto empty_space_NS = (iTILE_SIZE2.x() - sz.x()) / 2; - auto empty_space_WE = (iTILE_SIZE2.y() - sz.y()) / 2; - const auto r_ = (uint8_t)r; CORRADE_ASSUME(r_ <= (uint8_t)rotation_COUNT); switch (r_) { case (uint8_t)rotation::N: { + const auto empty_space_NS = (iTILE_SIZE2.x() - sz.x()) / 2; auto min_N = Vector2i(-half_tile.x() + empty_space_NS, -offset_N ); auto max_N = Vector2i(min_N.x() + sz.x(), 0 ); return {min_N, max_N}; } case (uint8_t)rotation::S: { + const auto empty_space_NS = (iTILE_SIZE2.x() - sz.x()) / 2; auto min_S = Vector2i(-half_tile.x() + empty_space_NS, 0 ); auto max_S = Vector2i(min_S.x() + sz.x(), offset_N ); return {min_S, max_S}; } case (uint8_t)rotation::W: { + const auto empty_space_WE = (iTILE_SIZE2.y() - sz.y()) / 2; auto min_W = Vector2i(-offset_W, -half_tile.y() + empty_space_WE ); auto max_W = Vector2i(0, min_W.y() + sz.y() ); return {min_W, max_W}; } case (uint8_t)rotation::E: { + const auto empty_space_WE = (iTILE_SIZE2.y() - sz.y()) / 2; auto min_E = Vector2i(0, -half_tile.y() + empty_space_WE ); auto max_E = Vector2i(offset_W, min_E.y() + sz.y() ); return {min_E, max_E}; |