From 1d2e8e184862944e2381977c1de6921d05476e4f Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Wed, 4 Oct 2023 13:26:11 +0200 Subject: [PATCH] chunkmesher: compiler flag to not show borders and world limit --- src/chunkmesher.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chunkmesher.cpp b/src/chunkmesher.cpp index 42cb65f..2d200ad 100755 --- a/src/chunkmesher.cpp +++ b/src/chunkmesher.cpp @@ -12,6 +12,7 @@ #include "utils.hpp" #define CHUNK_MESH_DATA_QUANTITY 100 +#define CHUNK_MESH_WORLD_LIMIT_BORDERS 0 namespace chunkmesher{ @@ -129,9 +130,15 @@ void mesh(Chunk::Chunk* chunk) // The else case provides face culling for adjacent solid faces // Checking for NULLBLK avoids creating empty faces if nearby chunk was not // yet generated +#if CHUNK_MESH_WORLD_LIMIT_BORDERS == 1 mask[n++] = b1 == b2 ? Block::NULLBLK : backFace ? b1 == Block::NULLBLK || b1 == Block::AIR ? b2 : Block::NULLBLK : b2 == Block::NULLBLK || b2 == Block::AIR ? b1 : Block::NULLBLK; +#else + mask[n++] = b1 == b2 ? Block::NULLBLK + : backFace ? b1 == Block::AIR ? b2 : Block::NULLBLK + : b2 == Block::AIR ? b1 : Block::NULLBLK; +#endif } }