summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mapgen.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/script/lua_api/l_mapgen.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/script/lua_api/l_mapgen.cpp')
-rw-r--r--src/script/lua_api/l_mapgen.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 5f9266c2b..78cf389e0 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -274,7 +274,10 @@ int ModApiMapgen::l_set_noiseparam_defaults(lua_State *L)
lua_pushnil(L);
while (lua_next(L, 1)) {
- if (read_noiseparams_nc(L, -1, &np)) {
+ if (read_noiseparams(L, -1, &np)) {
+ /// TODO(hmmmm): Update this for newer noiseparam formats
+ /// Right now this is safe because serializeStructToString() won't
+ /// touch memory outside of what the format string specifies
if (!serializeStructToString(&val, NOISEPARAMS_FMT_STR, &np))
continue;
if (!lua_isstring(L, -2))
@@ -406,7 +409,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L)
//// Get NoiseParams to define how decoration is placed
lua_getfield(L, index, "noise_params");
- deco->np = read_noiseparams(L, -1);
+ deco->np = get_noiseparams(L, -1);
lua_pop(L, 1);
//// Get biomes associated with this decoration (if any)
@@ -556,7 +559,7 @@ int ModApiMapgen::l_register_ore(lua_State *L)
getflagsfield(L, index, "flags", flagdesc_ore, &ore->flags, NULL);
lua_getfield(L, index, "noise_params");
- ore->np = read_noiseparams(L, -1);
+ ore->np = get_noiseparams(L, -1);
lua_pop(L, 1);
u32 id = oremgr->add(ore);