OpenClonk
Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
Functions
a
c
d
e
g
i
l
m
o
r
t
u
v
Variables
Typedefs
Enumerations
Enumerator
_
b
c
f
g
i
l
m
n
o
p
r
s
t
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
n
o
p
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
m
n
p
q
r
s
t
w
x
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Properties
Related Functions
:
c
d
e
f
i
l
o
p
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
u
v
w
x
z
Variables
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
z
Typedefs
b
c
d
g
l
m
o
p
r
s
t
u
w
Enumerations
_
c
l
m
s
t
v
Enumerator
a
c
d
e
g
k
m
n
p
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
C4Random.h
Go to the documentation of this file.
1
/*
2
* OpenClonk, http://www.openclonk.org
3
*
4
* Copyright (c) 1998-2000, Matthes Bender
5
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6
* Copyright (c) 2013-2016, The OpenClonk Team and contributors
7
*
8
* Distributed under the terms of the ISC license; see accompanying file
9
* "COPYING" for details.
10
*
11
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
12
* See accompanying file "TRADEMARK" for details.
13
*
14
* To redistribute this file separately, substitute the full license texts
15
* for the above references.
16
*/
17
18
/* Network-safe random number generator */
19
20
#ifndef INC_C4Random
21
#define INC_C4Random
22
23
#include <cinttypes>
24
25
extern
int
RandomCount
;
26
27
// Seeds both the synchronized and the unsynchronized RNGs.
28
void
FixedRandom
(uint64_t dwSeed);
29
// Synchronized RNG.
30
uint32_t
Random
(uint32_t iRange);
31
// Unsynchronized RNG.
32
uint32_t
UnsyncedRandom
();
33
uint32_t
UnsyncedRandom
(uint32_t range);
34
// Generates a single random value from a seed.
35
uint32_t
SeededRandom
(uint64_t iSeed, uint32_t iRange);
36
37
// Internal
38
void
RecordRandom
(uint32_t range, uint32_t val);
39
40
#endif
// INC_C4Random
Random
uint32_t Random(uint32_t iRange)
Definition:
C4Random.cpp:50
RecordRandom
void RecordRandom(uint32_t range, uint32_t val)
Definition:
C4RandomRecord.cpp:22
SeededRandom
uint32_t SeededRandom(uint64_t iSeed, uint32_t iRange)
Definition:
C4Random.cpp:69
RandomCount
int RandomCount
Definition:
C4Random.cpp:27
UnsyncedRandom
uint32_t UnsyncedRandom()
Definition:
C4Random.cpp:58
FixedRandom
void FixedRandom(uint64_t dwSeed)
Definition:
C4Random.cpp:37
openclonk
src
lib
C4Random.h
Generated on Wed Jul 16 2025 04:33:17 for OpenClonk by
1.9.1