aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_noise.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-04-08 15:52:22 +0200
committersfan5 <sfan5@live.de>2022-05-02 20:54:55 +0200
commit5362f472ff75ffe1885b54d09f22faa85284f817 (patch)
tree3a1c4ea116f4ad16b3a7960e428a725e8b173486 /src/script/lua_api/l_noise.h
parent41e79d902d536f31b7b5fe2fb63a7272ce38d437 (diff)
downloadminetest-5362f472ff75ffe1885b54d09f22faa85284f817.tar.gz
minetest-5362f472ff75ffe1885b54d09f22faa85284f817.tar.bz2
minetest-5362f472ff75ffe1885b54d09f22faa85284f817.zip
Remove some unused variable from Lua class wrappers
Diffstat (limited to 'src/script/lua_api/l_noise.h')
-rw-r--r--src/script/lua_api/l_noise.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/script/lua_api/l_noise.h b/src/script/lua_api/l_noise.h
index 9f50dfd3f..29ab41a31 100644
--- a/src/script/lua_api/l_noise.h
+++ b/src/script/lua_api/l_noise.h
@@ -30,6 +30,7 @@ class LuaPerlinNoise : public ModApiBase
{
private:
NoiseParams np;
+
static const char className[];
static luaL_Reg methods[];
@@ -42,7 +43,7 @@ private:
static int l_get_3d(lua_State *L);
public:
- LuaPerlinNoise(NoiseParams *params);
+ LuaPerlinNoise(const NoiseParams *params);
~LuaPerlinNoise() = default;
// LuaPerlinNoise(seed, octaves, persistence, scale)
@@ -59,9 +60,8 @@ public:
*/
class LuaPerlinNoiseMap : public ModApiBase
{
- NoiseParams np;
Noise *noise;
- bool m_is3d;
+
static const char className[];
static luaL_Reg methods[];
@@ -80,10 +80,11 @@ class LuaPerlinNoiseMap : public ModApiBase
static int l_get_map_slice(lua_State *L);
public:
- LuaPerlinNoiseMap(NoiseParams *np, s32 seed, v3s16 size);
-
+ LuaPerlinNoiseMap(const NoiseParams *np, s32 seed, v3s16 size);
~LuaPerlinNoiseMap();
+ inline bool is3D() const { return noise->sz > 1; }
+
// LuaPerlinNoiseMap(np, size)
// Creates an LuaPerlinNoiseMap and leaves it on top of stack
static int create_object(lua_State *L);