Fix bug with calculating delta in release build

This commit is contained in:
abdelrahman committed 2023-11-05 02:22:07 +00:00
1 parent 8f141e4c67
commit ab18f92fe5
1 file changed
+1 -4
+1 -4
View File
@@ -139,9 +139,6 @@ bool init_engine(const char *game_name, WindowSize window_size,
#if DEBUG_ENGINE #if DEBUG_ENGINE
GameEngine.delta = 1.0f / 60.0f; GameEngine.delta = 1.0f / 60.0f;
#endif /* DEBUG_ENGINE */
#if DEBUG_ENGINE
printf("Game initialised successfully\n"); printf("Game initialised successfully\n");
#endif /* DEBUG_ENGINE */ #endif /* DEBUG_ENGINE */
@@ -825,7 +822,7 @@ void update() {
u64 current_time = SDL_GetTicks64(); u64 current_time = SDL_GetTicks64();
#ifndef DEBUG_ENGINE #if !DEBUG_ENGINE
// Get the delta time in seconds since the SDL_GetTicks64() returns the // Get the delta time in seconds since the SDL_GetTicks64() returns the
// time in milliseconds // time in milliseconds
GameEngine.delta = (current_time - GameEngine.last_time) / 1000.0f; GameEngine.delta = (current_time - GameEngine.last_time) / 1000.0f;