Switch over to using SDL_GetTicks64()

SDL_GetTicks64() is a function that got added in SDL 2.0.18, which is
just an SDL_GetTicks() without a value that wraps every ~49 days,
instead wrapping after the sun explodes and kills us all. Oh sorry,
didn't mean to get existential.

For now, put this behind an SDL_VERSION_ATLEAST guard, which will be
removed when SDL 2.0.18 officially releases and we can update to it.
This commit is contained in:
Misa
2021-10-25 18:16:47 -07:00
committed by Misa Elizabeth Kai
parent 75e031cef0
commit 0c1f756af8
2 changed files with 28 additions and 7 deletions

View File

@@ -3087,7 +3087,12 @@ void scriptclass::hardreset(void)
{
const bool version2_2 = GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2);
#if SDL_VERSION_ATLEAST(2, 0, 17)
/* The RNG is 32-bit. We don't _really_ need 64-bit... */
xoshiro_seed((Uint32) SDL_GetTicks64());
#else
xoshiro_seed(SDL_GetTicks());
#endif
//Game:
game.hascontrol = true;