World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
Классы | |
struct | AVLFG |
Определения типов | |
typedef struct AVLFG | AVLFG |
Функции | |
void | av_lfg_init (AVLFG *c, unsigned int seed) |
int | av_lfg_init_from_data (AVLFG *c, const uint8_t *data, unsigned int length) |
static unsigned int | av_lfg_get (AVLFG *c) |
static unsigned int | av_mlfg_get (AVLFG *c) |
void | av_bmg_get (AVLFG *lfg, double out[2]) |
Context structure for the Lagged Fibonacci PRNG. The exact layout, types and content of this struct may change and should not be accessed directly. Only its sizeof() is guranteed to stay the same to allow easy instanciation.
Seed the state of the ALFG using binary data.
Return value: 0 on success, negative value (AVERROR) on failure.
|
inlinestatic |
Get the next random unsigned 32-bit number using an ALFG.
Please also consider a simple LCG like state= state*1664525+1013904223, it may be good enough and faster for your specific use case.
|
inlinestatic |
Get the next random unsigned 32-bit number using a MLFG.
Please also consider av_lfg_get() above, it is faster.