summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-09-12 05:52:55 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-09-12 05:52:55 +0200
commitaae112ae02b415483ac03c59629dc9290bd833cf (patch)
treea4763c87cdb7fd00109255a618177c30d1f0fa73 /src
parent7c56df7eed83af63e018be1be5507c1ca8cf1b99 (diff)
a
Diffstat (limited to 'src')
-rw-r--r--src/camera-offset.cpp2
-rw-r--r--src/path-search.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/camera-offset.cpp b/src/camera-offset.cpp
index a5213397..25b0a3bb 100644
--- a/src/camera-offset.cpp
+++ b/src/camera-offset.cpp
@@ -16,7 +16,7 @@ with_shifted_camera_offset::with_shifted_camera_offset(tile_shader& shader, chun
auto pos = chunk_coords(c_) - first_;
constexpr auto depth_start = -1 + 1.111e-16f;
- int depth = TILE_MAX_DIM*2 * pos.sum();
+ int depth = (int)TILE_MAX_DIM*2 * pos.sum();
#if 0
printf("c=(%2hd %2hd %2hhd) pos=(%2d %2d) len=(%d %d) --> %d\n", c_.x, c_.y, c_.z, pos.x(), pos.y(), len.x(), len.y(), depth);
diff --git a/src/path-search.cpp b/src/path-search.cpp
index 1f9b5bf9..8a4c52f0 100644
--- a/src/path-search.cpp
+++ b/src/path-search.cpp
@@ -94,11 +94,10 @@ bool search::sample_rtree(world& w, global_coords coord, Vector2b offset, Vector
auto search::make_neighbor_tile_bbox(Vector2i coord, Vector2ub own_size, rotation r) -> bbox
{
- constexpr auto full_tile = Vector2ui(iTILE_SIZE2*3/4);
- constexpr auto tx = full_tile.x()*2u, ty = full_tile.y()*2u;
+ constexpr auto tx = iTILE_SIZE2.x()/2, ty = iTILE_SIZE2.y()/2;
- const auto s = Math::max(Vector2ui(own_size), full_tile);
- const auto sx = s[0], sy = s[1];
+ const auto s = Math::max(Vector2ui(own_size), Vector2ui(iTILE_SIZE2));
+ const auto sx = s.x(), sy = s.y();
Vector2i off;
Vector2ui size;