, typeNoise(seed + 1)
, stretch(64.0f)
, solid_threshold(0.8f)
+, space(0)
+, light(0)
, solids() {
}
float val = solidNoise(gen_pos);
if (val > solid_threshold) {
int type_val = int((typeNoise(gen_pos) + 1.0f) * solids.size()) % solids.size();
- chunk.BlockAt(block_pos) = Block(solids[type_val]);
+ chunk.SetBlock(block_pos, Block(solids[type_val]));
+ } else {
+ chunk.SetBlock(block_pos, Block(space));
}
}
}
}
+ unsigned int random = 263167 * pos.x + 2097593 * pos.y + 426389 * pos.z;
+ for (int index = 0; index < Chunk::Size(); ++index) {
+ if (chunk.IsSurface(index)) {
+ random = random * 666649 + 7778777;
+ if ((random % 32) == 0) {
+ chunk.SetBlock(index, Block(light));
+ }
+ }
+ }
chunk.Invalidate();
chunk.CheckUpdate();
}