projects
/
platform
/
core
/
uifw
/
dali-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e642efc
)
Revert "[3.0] Restore the code at random.h"
14/83114/1
author
taeyoon
<taeyoon0.lee@samsung.com>
Tue, 9 Aug 2016 08:02:53 +0000
(17:02 +0900)
committer
taeyoon
<taeyoon0.lee@samsung.com>
Tue, 9 Aug 2016 08:03:11 +0000
(17:03 +0900)
This reverts commit
2a1d4cdb2dec66c1d66c75f9ac4ace6214c763f9
.
Change-Id: Ia88cfffd0b3662b283be8afcb69b037b1a80689c
dali/public-api/math/random.h
patch
|
blob
|
history
diff --git
a/dali/public-api/math/random.h
b/dali/public-api/math/random.h
index
5ba0c95
..
394b2dd
100644
(file)
--- a/
dali/public-api/math/random.h
+++ b/
dali/public-api/math/random.h
@@
-35,6
+35,11
@@
namespace Dali
namespace Random
{
+namespace
+{
+ __thread unsigned int seed;
+}
+
/**
* @brief Returns a random number between f0 and f1.
*
@@
-46,9
+51,10
@@
namespace Random
*/
inline float Range(float f0, float f1)
{
+ seed = time(NULL);
float min = std::min(f0, f1);
float max = std::max(f0, f1);
- return min + (rand
(
) & 0xfff) * (max-min) * (1.0f/4095.0f);
+ return min + (rand
_r(&seed
) & 0xfff) * (max-min) * (1.0f/4095.0f);
}
/**