diff options
| author | Mel <einebeere@gmail.com> | 2023-07-29 03:31:42 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-29 03:31:42 +0200 |
| commit | 6b69d4b5b648253f894707723af0e2eae9f71445 (patch) | |
| tree | 0cd0b6c7b18c30abbb2618f553f144d1d06dacba /src/World/Position.hpp | |
| parent | 2eef7cf49b7a15559ee7bb6719411bcf67386213 (diff) | |
| download | meowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.tar.zst meowcraft-6b69d4b5b648253f894707723af0e2eae9f71445.zip | |
Move chunk reification to worker threads and set stage for chunk-unbound lighting
Diffstat (limited to 'src/World/Position.hpp')
| -rw-r--r-- | src/World/Position.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/World/Position.hpp b/src/World/Position.hpp index 49cbbb6..b603ee4 100644 --- a/src/World/Position.hpp +++ b/src/World/Position.hpp @@ -9,9 +9,9 @@ namespace MC::World::Position { using World = Vector<3>; // Offset between block positions within single chunk. -class OffsetBlock : public Vector<3, I8> { +class BlockOffset : public Vector<3, I16> { public: - OffsetBlock(I8 x, I8 y, I8 z) : Vector(x, y, z) {} + BlockOffset(I16 x, I16 y, I16 z) : Vector(x, y, z) {} Bool fits_within_chunk() const { using namespace ChunkDimensions; return x() >= 0 && x() < Width && y() >= 0 && y() < Height && z() >= 0 && z() < Width; @@ -28,8 +28,8 @@ public: class BlockLocal : public Vector<3, U8> { public: BlockLocal(U8 x, U8 y, U8 z) : Vector(x, y, z) {} - BlockLocal(OffsetBlock offset) : BlockLocal(offset.x(), offset.y(), offset.z()) {} - OffsetBlock offset(OffsetBlock by) { + BlockLocal(BlockOffset offset) : BlockLocal(offset.x(), offset.y(), offset.z()) {} + BlockOffset offset(BlockOffset by) { return { static_cast<I8>(x() + by.x()), static_cast<I8>(y() + by.y()), @@ -38,7 +38,7 @@ public: } }; -const std::array<OffsetBlock, 6> axis_directions = {{ +const std::array<BlockOffset, 6> axis_directions = {{ {1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}, }}; |
