1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00
VVVVVV/desktop_version/src/Xoshiro.h
Misa fd4415317d Replace Gravitron RNG with seeded Xoshiro
This is to make it so RNG is deterministic when played back with the
same inputs in a libTAS movie even if screen effects or backgrounds are
disabled.

That way, Gravitron RNG is on its own system (seeded in hardreset()),
separate from the constant fRandom() calls that go to visual systems and
don't do anything of actual consequence.

The seed is based off of SDL_GetTicks(), so RTA runners don't get the
same Gravitron RNG every time. This also paves the way for a future
in-built input-based recording system, which now only has to save the
seed for a given recording in order for it to play back
deterministically.
2021-08-27 12:28:35 -07:00

21 lines
256 B
C

#ifndef XOSHIRO_H
#define XOSHIRO_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
void xoshiro_seed(uint32_t s);
uint32_t xoshiro_next(void);
float xoshiro_rand(void);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* XOSHIRO_H */