summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_functions.cpp
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-01-14 23:34:51 -0600
committerFerenc Arn <tagcup@yahoo.com>2017-01-15 19:15:16 -0600
commit4c9004671af455a03acb4e2750b12d62b2b3c917 (patch)
tree92d254eaaed667d6049918e4ac2acd1104d7f89f /modules/gdscript/gd_functions.cpp
parent5dde810aa58d66677afda9cc5c89c052e91348b4 (diff)
downloadredot-engine-4c9004671af455a03acb4e2750b12d62b2b3c917.tar.gz
Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant with 32-bit output, 64-bit state).
PCG is better than many alternatives by many metrics (see www.pcg-random.org) including statistical quality with good speed.
Diffstat (limited to 'modules/gdscript/gd_functions.cpp')
-rw-r--r--modules/gdscript/gd_functions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index 1c41b2e73b..f0da1ea8cc 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -351,14 +351,14 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
case MATH_SEED: {
VALIDATE_ARG_COUNT(1);
VALIDATE_ARG_NUM(0);
- uint32_t seed=*p_args[0];
+ uint64_t seed=*p_args[0];
Math::seed(seed);
r_ret=Variant();
} break;
case MATH_RANDSEED: {
VALIDATE_ARG_COUNT(1);
VALIDATE_ARG_NUM(0);
- uint32_t seed=*p_args[0];
+ uint64_t seed=*p_args[0];
int ret = Math::rand_from_seed(&seed);
Array reta;
reta.push_back(ret);