diff --git a/assets/texture/block/leaf/back.png b/assets/texture/block/leaf/back.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/back.png and b/assets/texture/block/leaf/back.png differ diff --git a/assets/texture/block/leaf/base.png b/assets/texture/block/leaf/base.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/base.png and b/assets/texture/block/leaf/base.png differ diff --git a/assets/texture/block/leaf/front.png b/assets/texture/block/leaf/front.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/front.png and b/assets/texture/block/leaf/front.png differ diff --git a/assets/texture/block/leaf/left.png b/assets/texture/block/leaf/left.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/left.png and b/assets/texture/block/leaf/left.png differ diff --git a/assets/texture/block/leaf/right.png b/assets/texture/block/leaf/right.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/right.png and b/assets/texture/block/leaf/right.png differ diff --git a/assets/texture/block/leaf/top.png b/assets/texture/block/leaf/top.png index 16d8426..84bbfaa 100644 Binary files a/assets/texture/block/leaf/top.png and b/assets/texture/block/leaf/top.png differ diff --git a/assets/texture/block/log/back.png b/assets/texture/block/log/back.png index d05532c..5356a05 100644 Binary files a/assets/texture/block/log/back.png and b/assets/texture/block/log/back.png differ diff --git a/assets/texture/block/log/base.png b/assets/texture/block/log/base.png index d05532c..817809c 100644 Binary files a/assets/texture/block/log/base.png and b/assets/texture/block/log/base.png differ diff --git a/assets/texture/block/log/front.png b/assets/texture/block/log/front.png index d05532c..5356a05 100644 Binary files a/assets/texture/block/log/front.png and b/assets/texture/block/log/front.png differ diff --git a/assets/texture/block/log/left.png b/assets/texture/block/log/left.png index d05532c..5356a05 100644 Binary files a/assets/texture/block/log/left.png and b/assets/texture/block/log/left.png differ diff --git a/assets/texture/block/log/right.png b/assets/texture/block/log/right.png index d05532c..5356a05 100644 Binary files a/assets/texture/block/log/right.png and b/assets/texture/block/log/right.png differ diff --git a/assets/texture/block/log/top.png b/assets/texture/block/log/top.png index d05532c..817809c 100644 Binary files a/assets/texture/block/log/top.png and b/assets/texture/block/log/top.png differ diff --git a/include/Cubed/gameplay/block.hpp b/include/Cubed/gameplay/block.hpp index 9178a03..4d01c35 100644 --- a/include/Cubed/gameplay/block.hpp +++ b/include/Cubed/gameplay/block.hpp @@ -1,11 +1,12 @@ #pragma once #include #include +#include #include #include - - +#include +#include struct BlockTexture { std::string name; unsigned id; @@ -38,4 +39,29 @@ struct BlockRenderData { struct LookBlock { glm::ivec3 pos; glm::ivec3 normal; +}; + +constexpr std::array BLOCK_REISTER{ + "air", + "grass_block", + "dirt", + "stone", + "sand", + "log", + "leaf" +}; + +const std::array TRANSPARENT_MAP { + true, + false, + false, + false, + false, + false, + true +}; + +inline bool is_in_transparent_map(unsigned id) { + CUBED_ASSERT_MSG(id < MAX_BLOCK_NUM, "ID is invaild"); + return TRANSPARENT_MAP[id]; }; \ No newline at end of file diff --git a/include/Cubed/gameplay/chunk.hpp b/include/Cubed/gameplay/chunk.hpp index cbe2844..2b43331 100644 --- a/include/Cubed/gameplay/chunk.hpp +++ b/include/Cubed/gameplay/chunk.hpp @@ -49,7 +49,7 @@ public: static int get_index(int x, int y, int z); static int get_index(const glm::vec3& pos); void init_chunk(); - void gen_vertex_data(); + //void gen_vertex_data(); // 0 : (1, 0) // 1 : (-1, 0) // 2 : (0, 1)