diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-12 16:46:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-12 16:51:43 +0300 |
commit | b236400ff5b6b18f0b81fb326b95719be7ebe379 (patch) | |
tree | 40f26df0afe11f2193ae686422089b0e82e3e915 /source/blender/blenlib/intern/rand.c | |
parent | 6231a077ac96b546d41404ef423fc23e1fa01803 (diff) |
Math: Remove unused functions which are not safe for threading
All areas are toy use "local" number generator, in order to keep
behavior predictable and threadable. This is what BLI_rng_() API
is for.
There are still lots of usages of BLI_frand(), which are to be
ported to BLI_rng_get_float(). but that is somewhat involved.
For the time being, remove unsafe API, so new areas have zero
chance using it.
Diffstat (limited to 'source/blender/blenlib/intern/rand.c')
-rw-r--r-- | source/blender/blenlib/intern/rand.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index 8d6f55c9ae5..557f0d79270 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -279,30 +279,12 @@ static void ensure_rng_thread_safe(void) // BLI_assert(BLI_thread_is_main()); } -void BLI_srandom(unsigned int seed) -{ - ensure_rng_thread_safe(); - BLI_rng_srandom(&theBLI_rng, seed); -} - -int BLI_rand(void) -{ - ensure_rng_thread_safe(); - return BLI_rng_get_int(&theBLI_rng); -} - float BLI_frand(void) { ensure_rng_thread_safe(); return BLI_rng_get_float(&theBLI_rng); } -void BLI_frand_unit_v3(float v[3]) -{ - ensure_rng_thread_safe(); - BLI_rng_get_float_unit_v3(&theBLI_rng, v); -} - float BLI_hash_frand(unsigned int seed) { RNG rng; |