X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fchunk.hpp;h=d8408ec9062e34bbb4f5344c4cb9df79eef0dd5b;hb=32a2a1231de8438f8408007c41247361b1c52417;hp=7e720bd84c5b49945f7dc7a45e6b2f0f1af9d699;hpb=3072e2cd49ad1614100d1a1c73afe6a4888fb875;p=blank.git diff --git a/src/chunk.hpp b/src/chunk.hpp index 7e720bd..d8408ec 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -76,6 +76,10 @@ public: (idx / Width()) % Height() == Height() - 1; // high Y plane } + bool IsSurface(int index) const { return IsSurface(ToPos(index)); } + bool IsSurface(const Block::Pos &pos) const { return IsSurface(Pos(pos)); } + bool IsSurface(const Pos &pos) const; + void SetNeighbor(Chunk &); bool HasNeighbor(Block::Face f) const { return neighbor[f]; } Chunk &GetNeighbor(Block::Face f) { return *neighbor[f]; } @@ -157,6 +161,7 @@ public: ChunkLoader(const BlockTypeRegistry &, const Generator &); void Generate(const Chunk::Pos &from, const Chunk::Pos &to); + void GenerateSurrounding(const Chunk::Pos &); std::list &Loaded() { return loaded; }