From 3d674a6550d144c3e90312aeb82fd6893c16145f Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 14 Jun 2020 11:43:28 -0700 Subject: [PATCH] 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. --- desktop_version/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 4529fb48..9f10d6ea 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -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(time - timePrev); + const float rawdeltatime = static_cast(time_ - timePrev); accumulator += rawdeltatime; Uint32 timesteplimit;