summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-09-14 19:32:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-09-14 19:32:58 +0200
commit2d422fc0e46ff8719c6b965ff94e08e010784c7e (patch)
tree062ce0ea758b58625207ba97d838801e68f28fd4
parent6f699727d7948e56613a1a8e85d520bc49081b7f (diff)
src/path-search: move into switch
-rw-r--r--src/path-search.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/path-search.cpp b/src/path-search.cpp
index ed93221e..652978d8 100644
--- a/src/path-search.cpp
+++ b/src/path-search.cpp
@@ -98,25 +98,25 @@ auto path_search::make_neighbor_tile_bbox(Vector2i coord, Vector2ub own_size, ro
switch (r_)
{
case (uint8_t)rotation::N: {
- const auto empty_space_NS = (iTILE_SIZE2.x() - sz.x()) / 2;
+ const auto empty_space_NS = iTILE_SIZE2.x() - sz.x() >> 1;
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;
+ const auto empty_space_NS = iTILE_SIZE2.x() - sz.x() >> 1;
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;
+ const auto empty_space_WE = iTILE_SIZE2.y() - sz.y() >> 1;
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;
+ const auto empty_space_WE = iTILE_SIZE2.y() - sz.y() >> 1;
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};