mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Remove SDL_GetTicks64()
ifdefs
We can now use the function that doesn't wrap after ~49 days since SDL 2.0.18 released.
This commit is contained in:
parent
470a4358ef
commit
aa343bc334
3 changed files with 0 additions and 22 deletions
|
@ -355,10 +355,8 @@ void Screen::toggleLinearFilter(void)
|
||||||
|
|
||||||
void Screen::toggleVSync(void)
|
void Screen::toggleVSync(void)
|
||||||
{
|
{
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 17)
|
|
||||||
vsync = !vsync;
|
vsync = !vsync;
|
||||||
SDL_RenderSetVSync(m_renderer, (int) vsync);
|
SDL_RenderSetVSync(m_renderer, (int) vsync);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Launching in forced fullscreen then exiting and relaunching in normal
|
/* FIXME: Launching in forced fullscreen then exiting and relaunching in normal
|
||||||
|
|
|
@ -3087,12 +3087,8 @@ void scriptclass::hardreset(void)
|
||||||
{
|
{
|
||||||
const bool version2_2 = GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2);
|
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... */
|
/* The RNG is 32-bit. We don't _really_ need 64-bit... */
|
||||||
xoshiro_seed((Uint32) SDL_GetTicks64());
|
xoshiro_seed((Uint32) SDL_GetTicks64());
|
||||||
#else
|
|
||||||
xoshiro_seed(SDL_GetTicks());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Game:
|
//Game:
|
||||||
game.hascontrol = true;
|
game.hascontrol = true;
|
||||||
|
|
|
@ -357,11 +357,7 @@ static void cleanup(void);
|
||||||
static void emscriptenloop(void)
|
static void emscriptenloop(void)
|
||||||
{
|
{
|
||||||
timePrev = time_;
|
timePrev = time_;
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 17)
|
|
||||||
time_ = SDL_GetTicks64();
|
time_ = SDL_GetTicks64();
|
||||||
#else
|
|
||||||
time_ = SDL_GetTicks();
|
|
||||||
#endif
|
|
||||||
deltaloop();
|
deltaloop();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -674,32 +670,20 @@ int main(int argc, char *argv[])
|
||||||
#else
|
#else
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 17)
|
|
||||||
f_time = SDL_GetTicks64();
|
f_time = SDL_GetTicks64();
|
||||||
#else
|
|
||||||
f_time = SDL_GetTicks();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const Uint64 f_timetaken = f_time - f_timePrev;
|
const Uint64 f_timetaken = f_time - f_timePrev;
|
||||||
if (!game.over30mode && f_timetaken < 34)
|
if (!game.over30mode && f_timetaken < 34)
|
||||||
{
|
{
|
||||||
const volatile Uint64 f_delay = 34 - f_timetaken;
|
const volatile Uint64 f_delay = 34 - f_timetaken;
|
||||||
SDL_Delay((Uint32) f_delay);
|
SDL_Delay((Uint32) f_delay);
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 17)
|
|
||||||
f_time = SDL_GetTicks64();
|
f_time = SDL_GetTicks64();
|
||||||
#else
|
|
||||||
f_time = SDL_GetTicks();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f_timePrev = f_time;
|
f_timePrev = f_time;
|
||||||
|
|
||||||
timePrev = time_;
|
timePrev = time_;
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 17)
|
|
||||||
time_ = SDL_GetTicks64();
|
time_ = SDL_GetTicks64();
|
||||||
#else
|
|
||||||
time_ = SDL_GetTicks();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
deltaloop();
|
deltaloop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue