From fe2baedc760c2f29e2c720f6b1132a2de33c5430 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 8 Jul 2023 03:25:44 +0200 Subject: Use own size types --- src/World/ChunkIndex.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/World/ChunkIndex.hpp') diff --git a/src/World/ChunkIndex.hpp b/src/World/ChunkIndex.hpp index ef61f24..7d6fdbf 100644 --- a/src/World/ChunkIndex.hpp +++ b/src/World/ChunkIndex.hpp @@ -1,30 +1,30 @@ #pragma once -#include +#include "../Common/Sizes.hpp" namespace MC::World { struct ChunkIndex { ChunkIndex() : x(0), y(0) {} - ChunkIndex(int32_t x, int32_t y) : x(x), y(y) {} + ChunkIndex(I32 x, I32 y) : x(x), y(y) {} Vector<3> middle() const { return {(x + 0.5f) * Chunk::Width, Chunk::Height / 2.0f, (y + 0.5f) * Chunk::Width}; } - int32_t x, y; + I32 x, y; }; } template<> struct std::equal_to { - bool operator()(const MC::World::ChunkIndex& i1, const MC::World::ChunkIndex& i2) const noexcept { + Bool operator()(const MC::World::ChunkIndex& i1, const MC::World::ChunkIndex& i2) const noexcept { return i1.x == i2.x && i1.y == i2.y; } }; template<> struct std::hash { - size_t operator()(const MC::World::ChunkIndex& i) const noexcept { - return (int64_t)i.x << 32 | i.y; + USize operator()(const MC::World::ChunkIndex& i) const noexcept { + return (I64)i.x << 32 | i.y; } }; \ No newline at end of file -- cgit 1.4.1