NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ef_random.h
1
#ifndef NW4R_EF_RANDOM_H
2
#define NW4R_EF_RANDOM_H
3
#include <nw4r/types_nw4r.h>
4
5
namespace
nw4r {
6
namespace
ef {
7
8
class
Random
{
9
private
:
10
ulong mSeed;
// at 0x0
11
12
public
:
13
void
Srand(ulong seed) {
14
mSeed = seed;
15
}
16
17
int
Rand() {
18
MixRandomSeed();
19
return
static_cast<
int
>
(mSeed >> 16);
20
}
21
22
f32 RandFloat() {
23
MixRandomSeed();
24
return
static_cast<
f32
>
(mSeed >> 16) / 0x10000;
25
}
26
27
private
:
28
void
MixRandomSeed() {
29
mSeed = mSeed * 0x343FD + 0x269EC3;
30
}
31
};
32
33
}
// namespace ef
34
}
// namespace nw4r
35
36
#endif
nw4r::ef::Random
Definition
ef_random.h:8
include
lib
nw4r
ef
ef_random.h
Made with ❤️ by
CLF78
and
RootCubed
. Logos by
Chasical
and
B1
. Website generated by
Doxygen
1.13.2