X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fworld%2FGenerator.cpp;fp=src%2Fworld%2FGenerator.cpp;h=466139b8943a4fadc1187736e6b29509d462642b;hb=4727825186798902f68df5b99a6a32f0ef618454;hp=88ac1eb674b0c24b5449f206694d0f70043145c4;hpb=4fbf5a3c1b0e530706023f5fc4be2f68d30ea645;p=blank.git diff --git a/src/world/Generator.cpp b/src/world/Generator.cpp index 88ac1eb..466139b 100644 --- a/src/world/Generator.cpp +++ b/src/world/Generator.cpp @@ -50,13 +50,13 @@ void Generator::LoadTypes(const BlockTypeRegistry ®) { } void Generator::operator ()(Chunk &chunk) const noexcept { - Chunk::Pos pos(chunk.Position()); - glm::vec3 coords(pos * Chunk::Extent()); - for (int z = 0; z < Chunk::depth; ++z) { - for (int y = 0; y < Chunk::height; ++y) { - for (int x = 0; x < Chunk::width; ++x) { - Block::Pos block_pos(x, y, z); - chunk.SetBlock(block_pos, Generate(coords + block_pos)); + ExactLocation::Coarse pos(chunk.Position()); + ExactLocation::Fine coords(pos * ExactLocation::Extent()); + for (int z = 0; z < Chunk::side; ++z) { + for (int y = 0; y < Chunk::side; ++y) { + for (int x = 0; x < Chunk::side; ++x) { + ExactLocation::Fine block_pos(x, y, z); + chunk.SetBlock(RoughLocation::Fine(x, y, z), Generate(coords + ExactLocation::Fine(x, y, z))); } } }