mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user