Limiting frame tiome to 100ms so lag don't brake physics.

This commit is contained in:
Ulysse Cura 2026-08-08 12:15:37 +02:00
parent 24d2ac6564
commit 06e7426701
1 changed files with 1 additions and 0 deletions

View File

@ -10,6 +10,7 @@ static inline void update_time(void)
static uint64_t last_clock_state = 0;
uint64_t start_clock = SDL_GetTicksNS();
game.delta_time_ms = SDL_NS_TO_MS((float)(start_clock - last_clock_state));
if(game.delta_time_ms > 100.0f) game.delta_time_ms = 100.0f;
last_clock_state = start_clock;
}