diff options
| author | Ferenc Arn | 2017-04-17 12:50:31 -0500 |
|---|---|---|
| committer | Ferenc Arn | 2017-04-17 14:05:02 -0500 |
| commit | ceb699f5ec50a69c8c9c37f4ed146cc0dd492f87 (patch) | |
| tree | 79cf61d09536eea6a8f023f373b297ebee5817be /core/math/math_funcs.cpp | |
| parent | 6f9ec3acfc45ae4f3649777a41bd3685a81fb114 (diff) | |
| download | godot-ceb699f5ec50a69c8c9c37f4ed146cc0dd492f87.tar.gz godot-ceb699f5ec50a69c8c9c37f4ed146cc0dd492f87.tar.zst godot-ceb699f5ec50a69c8c9c37f4ed146cc0dd492f87.zip | |
Diffstat (limited to 'core/math/math_funcs.cpp')
| -rw-r--r-- | core/math/math_funcs.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 6a46b9fbe..9f5a9c193 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -30,7 +30,7 @@ #include "math_funcs.h" #include "core/os/os.h" -pcg32_random_t Math::default_pcg = { 1, PCG_DEFAULT_INC_64 }; +pcg32_random_t Math::default_pcg = { 12047754176567800795ULL, PCG_DEFAULT_INC_64 }; #define PHI 0x9e3779b9 @@ -51,9 +51,7 @@ void Math::seed(uint64_t x) { } void Math::randomize() { - - OS::Time time = OS::get_singleton()->get_time(); - seed(OS::get_singleton()->get_ticks_usec() * (time.hour + 1) * (time.min + 1) * (time.sec + 1) * rand()); // TODO: can be simplified. + seed(OS::get_singleton()->get_ticks_usec() * default_pcg.state + PCG_DEFAULT_INC_64); } uint32_t Math::rand() { |
