summaryrefslogtreecommitdiffstats
path: root/core/math/math_funcs.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-16 20:06:54 +0100
committerGitHub <noreply@github.com>2017-01-16 20:06:54 +0100
commitbf05dab74f5c0fc19663dce05b462be2aba581a5 (patch)
tree837c11d04a76437e69d43744487cedf1bb5ec1f0 /core/math/math_funcs.h
parent0a9aee6b1d20f29e0e7a3bc8990f807144b62f74 (diff)
parent4c9004671af455a03acb4e2750b12d62b2b3c917 (diff)
downloadredot-engine-bf05dab74f5c0fc19663dce05b462be2aba581a5.tar.gz
Merge pull request #7532 from tagcup/pcg_prng
Replace the existing PRNG (Xorshift31) with (minimal) PCG-32.
Diffstat (limited to 'core/math/math_funcs.h')
-rw-r--r--core/math/math_funcs.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index 8ce59224ff..e81646b1ca 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -31,6 +31,7 @@
#include "typedefs.h"
#include "math_defs.h"
+#include "pcg.h"
#ifndef NO_MATH_H
#include <math.h>
@@ -41,8 +42,8 @@
class Math {
+ static pcg32_random_t default_pcg;
- static uint32_t default_seed;
public:
Math() {} // useless to instance
@@ -150,12 +151,12 @@ public:
}
- static uint32_t rand_from_seed(uint32_t *seed);
+ static uint32_t rand_from_seed(uint64_t *seed);
static double ease(double p_x, double p_c);
static int step_decimals(double p_step);
static double stepify(double p_value,double p_step);
- static void seed(uint32_t x=0);
+ static void seed(uint64_t x=0);
static void randomize();
static uint32_t larger_prime(uint32_t p_val);
static double dectime(double p_value,double p_amount, double p_step);