MCPcopy Create free account
hub / github.com/ddnet/ddnet / Seed

Method Seed

src/game/prng.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void CPrng::Seed(uint64_t aSeed[2])
32{
33 m_Seeded = true;
34 str_format(m_aDescription, sizeof(m_aDescription), "%s:%08x%08x:%08x%08x", NAME,
35 (unsigned)(aSeed[0] >> 32), (unsigned)aSeed[0],
36 (unsigned)(aSeed[1] >> 32), (unsigned)aSeed[1]);
37
38 m_Increment = (aSeed[1] << 1) | 1;
39 m_State = aSeed[0] + m_Increment;
40 RandomBits();
41}
42
43unsigned int CPrng::RandomBits()
44{

Callers 3

OnInitMethod · 0.80
CScoreMethod · 0.80
TESTFunction · 0.80

Calls 1

str_formatFunction · 0.85

Tested by 1

TESTFunction · 0.64