summaryrefslogtreecommitdiffhomepage
path: root/src/global-coords.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-11 14:31:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-11 14:31:36 +0200
commit1dc1da05808f92ba7d26d539818e9aaf98725be5 (patch)
tree29cdefb7dd9774821b19019c69a843a1168f3d3a /src/global-coords.cpp
parenta77135dcc85bfa28a783fadc0c682d30f9c2b02e (diff)
src: add more chunk_coords operators
Diffstat (limited to 'src/global-coords.cpp')
-rw-r--r--src/global-coords.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/global-coords.cpp b/src/global-coords.cpp
index de7c9ee2..6ffc06e1 100644
--- a/src/global-coords.cpp
+++ b/src/global-coords.cpp
@@ -18,4 +18,10 @@ static_assert(global_coords{(1u + (1<<15)) << 4 | 3, (2u + (1<<15)) << 4 | 4, nu
static_assert(global_coords{-123, 456, 1}.z() == 1);
static_assert(global_coords{-123, 511, 5}.chunk() == chunk_coords{-8, 31});
+static_assert(chunk_coords_{(short)100, (short)200, (char)300} + Vector3i(1, 2, 3) == chunk_coords_{(short)101, (short)202, (char)303});
+static_assert(chunk_coords_{(short)101, (short)202, (char)303} - Vector3i(1, 2, 3) == chunk_coords_{(short)100, (short)200, (char)300});
+
+static_assert(chunk_coords_{(short)100, (short)200, (char)300} + Vector2i(1, 2) == chunk_coords_{(short)101, (short)202, (char)300});
+static_assert(chunk_coords_{(short)101, (short)202, (char)300} - Vector2i(1, 2) == chunk_coords_{(short)100, (short)200, (char)300});
+
} // namespace floormat