From ab5f82d1cd7dbf7d2746f0d25001975eea8ce275 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Fri, 22 May 2026 22:01:28 +0800 Subject: [PATCH] feat: add biome boundary blending --- include/Cubed/gameplay/chunk_generator.hpp | 2 +- src/gameplay/chunk.cpp | 3 ++- src/gameplay/chunk_generator.cpp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Cubed/gameplay/chunk_generator.hpp b/include/Cubed/gameplay/chunk_generator.hpp index 2fd0d1a..4352497 100644 --- a/include/Cubed/gameplay/chunk_generator.hpp +++ b/include/Cubed/gameplay/chunk_generator.hpp @@ -45,6 +45,7 @@ public: Chunk& chunk(); Random& random(); const std::array& neighbor_biome() const; + void generate_cave(); private: static inline std::atomic is_init{false}; @@ -58,7 +59,6 @@ private: unsigned m_chunk_seed = 0; void make_biome_builder(); - void generate_cave(); }; } // namespace Cubed \ No newline at end of file diff --git a/src/gameplay/chunk.cpp b/src/gameplay/chunk.cpp index 8b5daf9..90e4944 100644 --- a/src/gameplay/chunk.cpp +++ b/src/gameplay/chunk.cpp @@ -292,7 +292,8 @@ void Chunk::gen_phase_six( Logger::error("ChunkGenerator is Nullptr"); return; } - // m_generator->blend_surface_blocks_borders(neighbor_block); + m_generator->blend_surface_blocks_borders(neighbor_block); + m_generator->generate_cave(); } void Chunk::gen_phase_seven() { diff --git a/src/gameplay/chunk_generator.cpp b/src/gameplay/chunk_generator.cpp index db8aad0..d4159c5 100644 --- a/src/gameplay/chunk_generator.cpp +++ b/src/gameplay/chunk_generator.cpp @@ -431,7 +431,6 @@ void ChunkGenerator::generate_terrain_blocks() { } m_chunk.blocks().assign(CHUNK_SIZE * CHUNK_SIZE * WORLD_SIZE_Y, 0); m_biome_builder->build_biome(); - generate_cave(); } void ChunkGenerator::blend_surface_blocks_borders(