summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-07 21:57:12 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-07 21:59:32 -0500
commit2fd3d5202051e03303ac2b8e76976a7c4c8477f3 (patch)
treec461272b8eef33846cf5773e38c6a8b7716e1d0d /src/settings.cpp
parent638f3a8454941d3f561b1834d47fa07a611454a3 (diff)
downloadminetest-2fd3d5202051e03303ac2b8e76976a7c4c8477f3.tar.gz
minetest-2fd3d5202051e03303ac2b8e76976a7c4c8477f3.tar.bz2
minetest-2fd3d5202051e03303ac2b8e76976a7c4c8477f3.zip
Add flags and lacunarity as new noise parameters
Add 'absolute value' option to noise map functions Extend persistence modulation to 3D noise Extend 'eased' option to noise2d_perlin* functions Some noise.cpp formatting fixups
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index fa7da806d..09b413ed0 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -350,10 +350,10 @@ bool Settings::updateConfigFile(const char *filename)
std::ifstream is(filename);
std::ostringstream os(std::ios_base::binary);
-
+
bool was_modified = updateConfigObject(is, os, "");
is.close();
-
+
if (!was_modified)
return true;
@@ -591,6 +591,11 @@ bool Settings::getNoiseParamsFromGroup(const std::string &name,
group->getS32NoEx("seed", np.seed);
group->getU16NoEx("octaves", np.octaves);
group->getFloatNoEx("persistence", np.persist);
+ group->getFloatNoEx("lacunarity", np.lacunarity);
+
+ np.flags = 0;
+ if (!group->getFlagStrNoEx("flags", np.flags, flagdesc_noiseparams))
+ np.flags = NOISE_FLAG_DEFAULTS;
return true;
}
@@ -896,6 +901,8 @@ void Settings::setNoiseParams(const std::string &name, const NoiseParams &np)
group->setS32("seed", np.seed);
group->setU16("octaves", np.octaves);
group->setFloat("persistence", np.persist);
+ group->setFloat("lacunarity", np.lacunarity);
+ group->setFlagStr("flags", np.flags, flagdesc_noiseparams, np.flags);
Settings *old_group;
{