]> git.localhorst.tv Git - blank.git/blobdiff - src/chunk.cpp
get world seed from command line arguments
[blank.git] / src / chunk.cpp
index d298fb2640cd737f586aa1ad09ec09ac0ef00b8a..51694221b8a1c4acb359feb3a7b05ca5efe5024e 100644 (file)
@@ -263,6 +263,21 @@ int Chunk::GetLight(int index) const {
 }
 
 
+bool Chunk::IsSurface(const Pos &pos) const {
+       const Block &block = BlockAt(pos);
+       if (!Type(block).visible) {
+               return false;
+       }
+       for (int face = 0; face < Block::FACE_COUNT; ++face) {
+               const Block *next = FindNext(pos, Block::Face(face));
+               if (!next || !Type(*next).visible) {
+                       return true;
+               }
+       }
+       return false;
+}
+
+
 void Chunk::Allocate() {
        blocks.resize(Size(), Block(0));
        light.resize(Size(), 0);
@@ -462,8 +477,8 @@ ChunkLoader::ChunkLoader(const BlockTypeRegistry &reg, const Generator &gen)
 , loaded()
 , to_generate()
 , to_free()
-, load_dist(4)
-, unload_dist(5) {
+, load_dist(6)
+, unload_dist(8) {
 
 }