diff options
author | Ferenc Arn <tagcup@yahoo.com> | 2017-01-14 23:34:51 -0600 |
---|---|---|
committer | Ferenc Arn <tagcup@yahoo.com> | 2017-01-15 19:15:16 -0600 |
commit | 4c9004671af455a03acb4e2750b12d62b2b3c917 (patch) | |
tree | 92d254eaaed667d6049918e4ac2acd1104d7f89f /modules/visual_script | |
parent | 5dde810aa58d66677afda9cc5c89c052e91348b4 (diff) |
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/visual_script')
-rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 27242384ac..2a14e62a52 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -802,14 +802,14 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp case VisualScriptBuiltinFunc::MATH_SEED: { VALIDATE_ARG_NUM(0); - uint32_t seed=*p_inputs[0]; + uint64_t seed=*p_inputs[0]; Math::seed(seed); } break; case VisualScriptBuiltinFunc::MATH_RANDSEED: { VALIDATE_ARG_NUM(0); - uint32_t seed=*p_inputs[0]; + uint64_t seed=*p_inputs[0]; int ret = Math::rand_from_seed(&seed); Array reta; reta.push_back(ret); |