diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index d9a9dd9d..c5686f74 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -274,6 +274,8 @@ void Game::init(void) deathcounts = 0; gameoverdelay = 0; + framecounter = 0; + seed_use_sdl_getticks = false; resetgameclock(); gamesaved = false; gamesavefailed = false; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 9d2d4c9d..672dba86 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -257,6 +257,8 @@ public: int lastsaved; int deathcounts; + int framecounter; + bool seed_use_sdl_getticks; int frames, seconds, minutes, hours; bool gamesaved; bool gamesavefailed; diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index f62dad15..6a2cfc77 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3094,8 +3094,15 @@ void scriptclass::hardreset(void) { const bool version2_2 = GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2); - /* The RNG is 32-bit. We don't _really_ need 64-bit... */ - xoshiro_seed((Uint32) SDL_GetTicks64()); + if (game.seed_use_sdl_getticks) + { + /* The RNG is 32-bit. We don't _really_ need 64-bit... */ + xoshiro_seed((Uint32) SDL_GetTicks64()); + } + else + { + xoshiro_seed(game.framecounter); + } //Game: game.hascontrol = true; diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 0ff3d587..4632a3d6 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -368,6 +368,7 @@ int main(int argc, char *argv[]) { char* baseDir = NULL; char* assetsPath = NULL; + bool seed_use_sdl_getticks = false; vlog_init(); @@ -478,6 +479,10 @@ int main(int argc, char *argv[]) { vlog_toggle_error(0); } + else if (ARG("-seed-use-sdl-getticks")) + { + seed_use_sdl_getticks = true; + } #undef ARG_INNER #undef ARG else @@ -546,6 +551,7 @@ int main(int argc, char *argv[]) graphics.init(); game.init(); + game.seed_use_sdl_getticks = seed_use_sdl_getticks; // This loads music too... if (!graphics.reloadresources()) @@ -838,6 +844,8 @@ static void focused_end(void) static enum LoopCode loop_end(void) { + ++game.framecounter; + //We did editorinput, now it's safe to turn this off key.linealreadyemptykludge = false;