From 2fd3d5202051e03303ac2b8e76976a7c4c8477f3 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 7 Dec 2014 21:57:12 -0500 Subject: 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 --- src/script/lua_api/l_mapgen.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/script/lua_api/l_mapgen.cpp') 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); -- cgit v1.2.3