diff options
| author | Mel <einebeere@gmail.com> | 2023-07-08 03:25:44 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-08 03:25:44 +0200 |
| commit | fe2baedc760c2f29e2c720f6b1132a2de33c5430 (patch) | |
| tree | dfbe1c72a17805a3cab6e0d47433e9021890c9ca /src/World/ChunkIndex.hpp | |
| parent | 41fbca10f6c6cdd9c1623f1347e7ecb40f5e7f59 (diff) | |
| download | meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.tar.zst meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.zip | |
Use own size types
Diffstat (limited to 'src/World/ChunkIndex.hpp')
| -rw-r--r-- | src/World/ChunkIndex.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
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 <cstdint> +#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<MC::World::ChunkIndex> { - 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<MC::World::ChunkIndex> { - 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 |
