|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/cLib/c_random.hpp>
Random number generation helper class.
Definition at line 7 of file c_random.hpp.
Public Member Functions | |
| cM_rand_c (u32 seed) | |
| Initializes the class with the given seed. | |
| u32 | ranqd1 (u32 max) |
| Generates an integer between 0 and the given max. | |
| float | ranqd2 () |
| Generates a floating point number between 0 and 1. | |
| float | ranqd3 () |
| Generates a floating point number between -0.5 and 0.5. | |
Public Attributes | |
| u32 | mSeed |
| The current seed. | |
Private Member Functions | |
| u32 | ranqdStep () |
Implementation of the ranqd1 algorithm. | |
Static Private Attributes | |
| static u32 | mConst1 = 0x19660D |
Constant a from the ranqd1 algorithm. | |
| static u32 | mConst2 = 0x3C6EF35F |
Constant c from the ranqd1 algorithm. | |
|
inline |
Initializes the class with the given seed.
Definition at line 11 of file c_random.hpp.
| u32 cM_rand_c::ranqd1 | ( | u32 | max | ) |
Generates an integer between 0 and the given max.
Definition at line 28 of file c_random.cpp.
| float cM_rand_c::ranqd2 | ( | ) |
Generates a floating point number between 0 and 1.
Definition at line 33 of file c_random.cpp.
| float cM_rand_c::ranqd3 | ( | ) |
Generates a floating point number between -0.5 and 0.5.
Definition at line 39 of file c_random.cpp.
|
inlineprivate |
Implementation of the ranqd1 algorithm.
Definition at line 9 of file c_random.cpp.
| u32 cM_rand_c::mSeed |
The current seed.
Definition at line 17 of file c_random.hpp.
|
staticprivate |
Constant a from the ranqd1 algorithm.
Definition at line 25 of file c_random.hpp.
|
staticprivate |
Constant c from the ranqd1 algorithm.
Definition at line 26 of file c_random.hpp.