MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Random_SeedFromCurrentTime

Function Random_SeedFromCurrentTime

src/ExtMath.c:123–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121#define RND_MASK ((1ULL << 48) - 1)
122
123void Random_SeedFromCurrentTime(RNGState* rnd) {
124 cc_uint64 now = Stopwatch_Measure();
125 Random_Seed(rnd, (int)now);
126}
127
128void Random_Seed(RNGState* seed, int seedInit) {
129 *seed = (seedInit ^ RND_VALUE) & RND_MASK;

Callers 9

OnInitFunction · 0.85
LavaAnimation_TickFunction · 0.85
WaterAnimation_TickFunction · 0.85
ClassicGenScreen_GenFunction · 0.85
GenerateNewUuidFunction · 0.85
Music_RunLoopFunction · 0.85
Physics_OnNewMapLoadedFunction · 0.85

Calls 2

Random_SeedFunction · 0.85
Stopwatch_MeasureFunction · 0.70

Tested by

no test coverage detected