From 6b69d4b5b648253f894707723af0e2eae9f71445 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 29 Jul 2023 03:31:42 +0200 Subject: Move chunk reification to worker threads and set stage for chunk-unbound lighting --- src/World/Position.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/World/Position.hpp') 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(x() + by.x()), static_cast(y() + by.y()), @@ -38,7 +38,7 @@ public: } }; -const std::array axis_directions = {{ +const std::array axis_directions = {{ {1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}, }}; -- cgit 1.4.1