don't use clamped float random_seed internally

This commit is contained in:
veclavtalica 2025-01-10 02:52:04 +03:00
parent 83e2dc5468
commit 313108092b

View File

@ -585,8 +585,8 @@ static bool initialize(void) {
/* SDL_GetPerformanceCounter returns some platform-dependent number. */ /* SDL_GetPerformanceCounter returns some platform-dependent number. */
/* it should vary between game instances. i checked! random enough for me. */ /* it should vary between game instances. i checked! random enough for me. */
ctx.game.random_seed = (float)(SDL_GetPerformanceCounter() % 16777216); ctx.game.random_seed = (float)(SDL_GetPerformanceCounter() % 16777216);
srand((unsigned int)ctx.game.random_seed); srand((unsigned int)(SDL_GetPerformanceCounter()));
stbds_rand_seed((size_t)ctx.game.random_seed); stbds_rand_seed((size_t)(SDL_GetPerformanceCounter()));
/* main loop machinery */ /* main loop machinery */
toml_datum_t datum_ticks_per_second = toml_int_in(engine, "ticks_per_second"); toml_datum_t datum_ticks_per_second = toml_int_in(engine, "ticks_per_second");