mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59: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:
parent
f151cff34d
commit
3d674a6550
1 changed files with 4 additions and 4 deletions
|
@ -303,7 +303,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
volatile Uint32 time = 0;
|
||||
volatile Uint32 time_ = 0;
|
||||
volatile Uint32 timePrev = 0;
|
||||
volatile Uint32 accumulator = 0;
|
||||
volatile Uint32 f_time = 0;
|
||||
|
@ -334,8 +334,8 @@ int main(int argc, char *argv[])
|
|||
f_accumulator = fmodf(f_accumulator, 34);
|
||||
}
|
||||
|
||||
timePrev = time;
|
||||
time = SDL_GetTicks();
|
||||
timePrev = time_;
|
||||
time_ = SDL_GetTicks();
|
||||
|
||||
game.infocus = key.isActive;
|
||||
|
||||
|
@ -343,7 +343,7 @@ int main(int argc, char *argv[])
|
|||
NETWORK_update();
|
||||
|
||||
//timestep limit to 30
|
||||
const float rawdeltatime = static_cast<float>(time - timePrev);
|
||||
const float rawdeltatime = static_cast<float>(time_ - timePrev);
|
||||
accumulator += rawdeltatime;
|
||||
|
||||
Uint32 timesteplimit;
|
||||
|
|
Loading…
Reference in a new issue