1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01:00

Rename time to time_

This is needed for the next step. I want to put all the loop stuff in
their own functions so the code isn't one huge blob, but to do that I'll
need to make 'time' a global variable, but I can't do that because
actually 'time' is already a function, apparently, and you're only
allowed to shadow variables when already inside a function.
This commit is contained in:
Misa 2020-06-14 11:43:28 -07:00 committed by Ethan Lee
parent f151cff34d
commit 3d674a6550

View file

@ -303,7 +303,7 @@ int main(int argc, char *argv[])
} }
#endif #endif
volatile Uint32 time = 0; volatile Uint32 time_ = 0;
volatile Uint32 timePrev = 0; volatile Uint32 timePrev = 0;
volatile Uint32 accumulator = 0; volatile Uint32 accumulator = 0;
volatile Uint32 f_time = 0; volatile Uint32 f_time = 0;
@ -334,8 +334,8 @@ int main(int argc, char *argv[])
f_accumulator = fmodf(f_accumulator, 34); f_accumulator = fmodf(f_accumulator, 34);
} }
timePrev = time; timePrev = time_;
time = SDL_GetTicks(); time_ = SDL_GetTicks();
game.infocus = key.isActive; game.infocus = key.isActive;
@ -343,7 +343,7 @@ int main(int argc, char *argv[])
NETWORK_update(); NETWORK_update();
//timestep limit to 30 //timestep limit to 30
const float rawdeltatime = static_cast<float>(time - timePrev); const float rawdeltatime = static_cast<float>(time_ - timePrev);
accumulator += rawdeltatime; accumulator += rawdeltatime;
Uint32 timesteplimit; Uint32 timesteplimit;