fix: prevent GenerationConfig from being copied in TerrainGenerator
Signed-off-by: szdytom <szdytom@qq.com>
This commit is contained in:
parent
b6b585b700
commit
95422cff7a
@ -70,7 +70,7 @@ struct GenerationConfig {
|
|||||||
// Terrain generator class that manages the generation process
|
// Terrain generator class that manages the generation process
|
||||||
class TerrainGenerator {
|
class TerrainGenerator {
|
||||||
private:
|
private:
|
||||||
GenerationConfig config_;
|
const GenerationConfig &config_;
|
||||||
Xoroshiro128PP master_rng_;
|
Xoroshiro128PP master_rng_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace istd {
|
namespace istd {
|
||||||
TerrainGenerator::TerrainGenerator(const GenerationConfig &config)
|
TerrainGenerator::TerrainGenerator(const GenerationConfig &config)
|
||||||
: config_(config), master_rng_(config.seed) {}
|
: config_(config) {}
|
||||||
|
|
||||||
void TerrainGenerator::operator()(TileMap &tilemap) {
|
void TerrainGenerator::operator()(TileMap &tilemap) {
|
||||||
|
master_rng_ = Xoroshiro128PP(config_.seed);
|
||||||
biome_pass(tilemap);
|
biome_pass(tilemap);
|
||||||
base_tile_type_pass(tilemap);
|
base_tile_type_pass(tilemap);
|
||||||
smoothen_mountains_pass(tilemap);
|
smoothen_mountains_pass(tilemap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user