From 23b0bc4d1ddc9fad3c32e8257497ddd13ac6a155 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 31 Oct 2022 06:24:34 +0100 Subject: Proto biomes and new blocks --- src/World/Chunk.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/World/Chunk.hpp') diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp index 7415d7c..cb4f7e1 100644 --- a/src/World/Chunk.hpp +++ b/src/World/Chunk.hpp @@ -7,15 +7,15 @@ #include "BlockSide.hpp" #include "../GFX/Binder.hpp" -#define CHUNK_WIDTH 16 -#define CHUNK_HEIGHT 64 - namespace MC::World { class Chunk { public: + static constexpr const uint32_t Width = 16; + static constexpr const uint32_t Height = 64; + Chunk(int64_t x, int64_t y) - : m_blocks{}, m_position{(float)x * CHUNK_WIDTH, 0.0f, (float)y * CHUNK_WIDTH} {}; + : m_blocks{}, m_position{(float)x * Chunk::Width, 0.0f, (float)y * Chunk::Width} {}; void set(uint32_t x, uint32_t y, uint32_t z, BlockType type); @@ -32,7 +32,7 @@ private: }; Vector<3> m_position; - BlockData m_blocks[CHUNK_WIDTH][CHUNK_HEIGHT][CHUNK_WIDTH]; + BlockData m_blocks[Chunk::Width][Chunk::Height][Chunk::Width]; }; } -- cgit 1.4.1