|
resonance 1.0.1
|
Go to the source code of this file.
Functions | |
| void | SeedR250 (int nSeed) |
| Fill the state table from a linear congruential sequence and reset both indices. | |
| int | NextR250 () |
| Draw the next value. | |
| int | RandomInt (int nLow, int nHigh) |
| Draw an integer in a half-open range. | |
| float | RandomFloat () |
| Draw a float in [0, 1). | |
Variables | |
| constexpr int | kR250TableSize = 256 |
| Words in the R250 generator's state table. | |
| int | g_aR250Table [kR250TableSize] |
| State table of the R250 generator. | |
| int | g_nR250Index |
| Index of the word NextR250() replaces next. | |
| int | g_nR250LagIndex |
| Index of the word NextR250() combines with the replaced one. | |
| void SeedR250 | ( | int | nSeed | ) |
Fill the state table from a linear congruential sequence and reset both indices.
Each word is the high half of one step of the sequence plus the next step masked to 0x7fff0000.
MetRenderer's constructor and the routine at 0x0030e2c8 are the recovered callers.
| nSeed | The starting value of the sequence. |
| int NextR250 | ( | ) |
Draw the next value.
Both indices wrap to zero on reaching 249, so the draws cycle through the first 249 words of the table.
| int RandomInt | ( | int | nLow, |
| int | nHigh ) |
Draw an integer in a half-open range.
| nLow | The smallest value. |
| nHigh | The value the range stops below. |
| float RandomFloat | ( | ) |
Draw a float in [0, 1).
|
constexpr |
Words in the R250 generator's state table.
SeedR250() fills all of them.
|
extern |
State table of the R250 generator.
SeedR250() fills every word, and NextR250() replaces one word per draw with the exclusive or of two others.
|
extern |
Index of the word NextR250() replaces next.
Zero at startup and after SeedR250().
|
extern |
Index of the word NextR250() combines with the replaced one.
103 at startup and after SeedR250().