Added generation seed support

This commit is contained in:
MihailRis
2022-07-01 02:31:30 +03:00
committed by GitHub
parent 37dd882fdb
commit 1038a79b78
11 changed files with 25 additions and 17 deletions
+3 -2
View File
@@ -85,9 +85,10 @@ int generate_tree(fnl_state *noise, PseudoRandom* random, const float* heights,
return 0;
}
void WorldGenerator::generate(voxel* voxels, int cx, int cy, int cz){
void WorldGenerator::generate(voxel* voxels, int cx, int cy, int cz, int seed){
fnl_state noise = fnlCreateState();
noise.noise_type = FNL_NOISE_OPENSIMPLEX2;
noise.seed = seed * 60617077 % 25896307;
PseudoRandom random;
@@ -144,4 +145,4 @@ void WorldGenerator::generate(voxel* voxels, int cx, int cy, int cz){
}
}
}
}
}