diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-11 02:53:10 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-11 02:53:10 -0500 |
commit | fb80a7c111c138d335f4c7e68fc098f8aa8483d3 (patch) | |
tree | 16006b2845b33e84293209047f375de927cac90f /src/mapgen_v6.cpp | |
parent | c07f15e910ccce52b62b45af1b1a9210c2130817 (diff) | |
download | minetest-fb80a7c111c138d335f4c7e68fc098f8aa8483d3.tar.gz minetest-fb80a7c111c138d335f4c7e68fc098f8aa8483d3.tar.bz2 minetest-fb80a7c111c138d335f4c7e68fc098f8aa8483d3.zip |
Clean up Noise macros
Diffstat (limited to 'src/mapgen_v6.cpp')
-rw-r--r-- | src/mapgen_v6.cpp | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index 004aef8c7..148b4497c 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -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 = NoisePerlin2D_PO(&noise_terrain_base->np, p.X, 0.5, p.Y, 0.5, seed); - float terrain_higher = NoisePerlin2DPosOffset(&noise_terrain_higher->np, + float terrain_higher = NoisePerlin2D_PO(&noise_terrain_higher->np, p.X, 0.5, p.Y, 0.5, seed); - float steepness = NoisePerlin2DPosOffset(&noise_steepness->np, + float steepness = NoisePerlin2D_PO(&noise_steepness->np, p.X, 0.5, p.Y, 0.5, seed); - float height_select = NoisePerlin2DNoTxfmPosOffset(&noise_height_select->np, + float height_select = NoisePerlin2D_PO(&noise_height_select->np, p.X, 0.5, p.Y, 0.5, seed); return baseTerrainLevel(terrain_base, terrain_higher, @@ -547,36 +547,16 @@ void MapgenV6::calculateNoise() { int x = node_min.X; int z = node_min.Z; - // 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); - - noise_terrain_higher->perlinMap2D( - x + 0.5 * noise_terrain_higher->np.spread.X, - z + 0.5 * noise_terrain_higher->np.spread.Z); - - noise_steepness->perlinMap2D( - x + 0.5 * noise_steepness->np.spread.X, - z + 0.5 * noise_steepness->np.spread.Z); - - noise_height_select->perlinMap2D( - 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); + noise_terrain_base->perlinMap2D_PO(x, 0.5, z, 0.5); + noise_terrain_higher->perlinMap2D_PO(x, 0.5, z, 0.5); + noise_steepness->perlinMap2D_PO(x, 0.5, z, 0.5); + noise_height_select->perlinMap2D_PO(x, 0.5, z, 0.5); + noise_mud->perlinMap2D_PO(x, 0.5, z, 0.5); } - noise_beach->perlinMap2D( - 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); + noise_beach->perlinMap2D_PO(x, 0.2, z, 0.7); + noise_biome->perlinMap2D_PO(x, 0.6, z, 0.2); } |