From aa343bc3344ceacd330bbade467c4ca4bfbf1da8 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 11 Nov 2021 23:54:32 -0800 Subject: [PATCH] Remove `SDL_GetTicks64()` ifdefs We can now use the function that doesn't wrap after ~49 days since SDL 2.0.18 released. --- desktop_version/src/Screen.cpp | 2 -- desktop_version/src/Script.cpp | 4 ---- desktop_version/src/main.cpp | 16 ---------------- 3 files changed, 22 deletions(-) diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index ecb2073e..fb2093ce 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -355,10 +355,8 @@ void Screen::toggleLinearFilter(void) void Screen::toggleVSync(void) { -#if SDL_VERSION_ATLEAST(2, 0, 17) vsync = !vsync; SDL_RenderSetVSync(m_renderer, (int) vsync); -#endif } /* FIXME: Launching in forced fullscreen then exiting and relaunching in normal diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index e1c6ae79..e8cc2dca 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3087,12 +3087,8 @@ 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; diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 72c26e43..4591717b 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -357,11 +357,7 @@ static void cleanup(void); static void emscriptenloop(void) { timePrev = time_; -#if SDL_VERSION_ATLEAST(2, 0, 17) time_ = SDL_GetTicks64(); -#else - time_ = SDL_GetTicks(); -#endif deltaloop(); } #endif @@ -674,32 +670,20 @@ int main(int argc, char *argv[]) #else while (true) { -#if SDL_VERSION_ATLEAST(2, 0, 17) f_time = SDL_GetTicks64(); -#else - f_time = SDL_GetTicks(); -#endif const Uint64 f_timetaken = f_time - f_timePrev; if (!game.over30mode && f_timetaken < 34) { const volatile Uint64 f_delay = 34 - f_timetaken; SDL_Delay((Uint32) f_delay); -#if SDL_VERSION_ATLEAST(2, 0, 17) f_time = SDL_GetTicks64(); -#else - f_time = SDL_GetTicks(); -#endif } f_timePrev = f_time; timePrev = time_; -#if SDL_VERSION_ATLEAST(2, 0, 17) time_ = SDL_GetTicks64(); -#else - time_ = SDL_GetTicks(); -#endif deltaloop(); }