mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Noise: Create a deep copy of NoiseParams
This commit is contained in:
parent
88c28414f4
commit
fb2bc956b1
9 changed files with 91 additions and 91 deletions
|
@ -246,13 +246,13 @@ float MapgenV6::baseTerrainLevelFromNoise(v2s16 p) {
|
|||
if (flags & MG_FLAT)
|
||||
return water_level;
|
||||
|
||||
float terrain_base = NoisePerlin2DPosOffset(noise_terrain_base->np,
|
||||
float terrain_base = NoisePerlin2DPosOffset(&noise_terrain_base->np,
|
||||
p.X, 0.5, p.Y, 0.5, seed);
|
||||
float terrain_higher = NoisePerlin2DPosOffset(noise_terrain_higher->np,
|
||||
float terrain_higher = NoisePerlin2DPosOffset(&noise_terrain_higher->np,
|
||||
p.X, 0.5, p.Y, 0.5, seed);
|
||||
float steepness = NoisePerlin2DPosOffset(noise_steepness->np,
|
||||
float steepness = NoisePerlin2DPosOffset(&noise_steepness->np,
|
||||
p.X, 0.5, p.Y, 0.5, seed);
|
||||
float height_select = NoisePerlin2DNoTxfmPosOffset(noise_height_select->np,
|
||||
float height_select = NoisePerlin2DNoTxfmPosOffset(&noise_height_select->np,
|
||||
p.X, 0.5, p.Y, 0.5, seed);
|
||||
|
||||
return baseTerrainLevel(terrain_base, terrain_higher,
|
||||
|
@ -550,37 +550,37 @@ void MapgenV6::calculateNoise() {
|
|||
// Need to adjust for the original implementation's +.5 offset...
|
||||
if (!(flags & MG_FLAT)) {
|
||||
noise_terrain_base->perlinMap2D(
|
||||
x + 0.5 * noise_terrain_base->np->spread.X,
|
||||
z + 0.5 * noise_terrain_base->np->spread.Z);
|
||||
x + 0.5 * noise_terrain_base->np.spread.X,
|
||||
z + 0.5 * noise_terrain_base->np.spread.Z);
|
||||
noise_terrain_base->transformNoiseMap();
|
||||
|
||||
noise_terrain_higher->perlinMap2D(
|
||||
x + 0.5 * noise_terrain_higher->np->spread.X,
|
||||
z + 0.5 * noise_terrain_higher->np->spread.Z);
|
||||
x + 0.5 * noise_terrain_higher->np.spread.X,
|
||||
z + 0.5 * noise_terrain_higher->np.spread.Z);
|
||||
noise_terrain_higher->transformNoiseMap();
|
||||
|
||||
noise_steepness->perlinMap2D(
|
||||
x + 0.5 * noise_steepness->np->spread.X,
|
||||
z + 0.5 * noise_steepness->np->spread.Z);
|
||||
x + 0.5 * noise_steepness->np.spread.X,
|
||||
z + 0.5 * noise_steepness->np.spread.Z);
|
||||
noise_steepness->transformNoiseMap();
|
||||
|
||||
noise_height_select->perlinMap2D(
|
||||
x + 0.5 * noise_height_select->np->spread.X,
|
||||
z + 0.5 * noise_height_select->np->spread.Z);
|
||||
x + 0.5 * noise_height_select->np.spread.X,
|
||||
z + 0.5 * noise_height_select->np.spread.Z);
|
||||
|
||||
noise_mud->perlinMap2D(
|
||||
x + 0.5 * noise_mud->np->spread.X,
|
||||
z + 0.5 * noise_mud->np->spread.Z);
|
||||
x + 0.5 * noise_mud->np.spread.X,
|
||||
z + 0.5 * noise_mud->np.spread.Z);
|
||||
noise_mud->transformNoiseMap();
|
||||
}
|
||||
|
||||
noise_beach->perlinMap2D(
|
||||
x + 0.2 * noise_beach->np->spread.X,
|
||||
z + 0.7 * noise_beach->np->spread.Z);
|
||||
x + 0.2 * noise_beach->np.spread.X,
|
||||
z + 0.7 * noise_beach->np.spread.Z);
|
||||
|
||||
noise_biome->perlinMap2D(
|
||||
x + 0.6 * noise_biome->np->spread.X,
|
||||
z + 0.2 * noise_biome->np->spread.Z);
|
||||
x + 0.6 * noise_biome->np.spread.X,
|
||||
z + 0.2 * noise_biome->np.spread.Z);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue