summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_noise.h
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2017-06-03 14:55:10 -0400
committerShadowNinja <shadowninja@minetest.net>2017-06-03 14:55:10 -0400
commitcaecdb681c428c1aab9c0f7eec2570c0460f995c (patch)
treee5115982ea59bbf2343ba9b35bc4a0cfbb56f407 /src/script/lua_api/l_noise.h
parent81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (diff)
parent80dc961d24e1964e25d57039ddb2ba639f9f4d22 (diff)
downloadminetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.tar.gz
minetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.tar.bz2
minetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.zip
Merge 0.4.16 into stable-0.4
Diffstat (limited to 'src/script/lua_api/l_noise.h')
-rw-r--r--src/script/lua_api/l_noise.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/script/lua_api/l_noise.h b/src/script/lua_api/l_noise.h
index 40bfd1315..f252b5ba2 100644
--- a/src/script/lua_api/l_noise.h
+++ b/src/script/lua_api/l_noise.h
@@ -20,18 +20,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef L_NOISE_H_
#define L_NOISE_H_
-#include "lua_api/l_base.h"
#include "irr_v3d.h"
+#include "lua_api/l_base.h"
#include "noise.h"
/*
LuaPerlinNoise
*/
-class LuaPerlinNoise : public ModApiBase {
+class LuaPerlinNoise : public ModApiBase
+{
private:
NoiseParams np;
static const char className[];
- static const luaL_reg methods[];
+ static const luaL_Reg methods[];
// Exported functions
@@ -57,12 +58,13 @@ public:
/*
LuaPerlinNoiseMap
*/
-class LuaPerlinNoiseMap : public ModApiBase {
+class LuaPerlinNoiseMap : public ModApiBase
+{
NoiseParams np;
Noise *noise;
bool m_is3d;
static const char className[];
- static const luaL_reg methods[];
+ static const luaL_Reg methods[];
// Exported functions
@@ -95,12 +97,13 @@ public:
/*
LuaPseudoRandom
*/
-class LuaPseudoRandom : public ModApiBase {
+class LuaPseudoRandom : public ModApiBase
+{
private:
PseudoRandom m_pseudo;
static const char className[];
- static const luaL_reg methods[];
+ static const luaL_Reg methods[];
// Exported functions
@@ -111,8 +114,7 @@ private:
static int l_next(lua_State *L);
public:
- LuaPseudoRandom(s32 seed) :
- m_pseudo(seed) {}
+ LuaPseudoRandom(s32 seed) : m_pseudo(seed) {}
// LuaPseudoRandom(seed)
// Creates an LuaPseudoRandom and leaves it on top of stack
@@ -126,12 +128,13 @@ public:
/*
LuaPcgRandom
*/
-class LuaPcgRandom : public ModApiBase {
+class LuaPcgRandom : public ModApiBase
+{
private:
PcgRandom m_rnd;
static const char className[];
- static const luaL_reg methods[];
+ static const luaL_Reg methods[];
// Exported functions
@@ -146,10 +149,8 @@ private:
static int l_rand_normal_dist(lua_State *L);
public:
- LuaPcgRandom(u64 seed) :
- m_rnd(seed) {}
- LuaPcgRandom(u64 seed, u64 seq) :
- m_rnd(seed, seq) {}
+ LuaPcgRandom(u64 seed) : m_rnd(seed) {}
+ LuaPcgRandom(u64 seed, u64 seq) : m_rnd(seed, seq) {}
// LuaPcgRandom(seed)
// Creates an LuaPcgRandom and leaves it on top of stack
@@ -160,15 +161,15 @@ public:
static void Register(lua_State *L);
};
-
/*
LuaSecureRandom
*/
-class LuaSecureRandom : public ModApiBase {
+class LuaSecureRandom : public ModApiBase
+{
private:
static const size_t RAND_BUF_SIZE = 2048;
static const char className[];
- static const luaL_reg methods[];
+ static const luaL_Reg methods[];
u32 m_rand_idx;
char m_rand_buf[RAND_BUF_SIZE];