summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/global-coords.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/global-coords.hpp b/src/global-coords.hpp
index 5453662e..94b0d48e 100644
--- a/src/global-coords.hpp
+++ b/src/global-coords.hpp
@@ -10,8 +10,14 @@ struct chunk_coords final {
std::int16_t x = 0, y = 0;
constexpr bool operator==(const chunk_coords& other) const noexcept = default;
+ constexpr Vector2i operator-(chunk_coords other) const noexcept;
};
+constexpr Vector2i chunk_coords::operator-(chunk_coords other) const noexcept
+{
+ return { Int{x} - other.x, Int{y} - other.y };
+}
+
struct global_coords final {
static constexpr std::uint32_t _0u = 1 << 15;
static constexpr auto _0s = std::int32_t(_0u);