Fixed update time implementation.
This commit is contained in:
parent
c8c6620ba7
commit
699ac6c7cd
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
inline void update_time(void)
|
inline void update_time(void)
|
||||||
{
|
{
|
||||||
static uint32_t last_clock_state = 0;
|
static uint64_t last_clock_state = 0;
|
||||||
uint64_t start_clock = SDL_GetTicksNS();
|
uint64_t start_clock = SDL_GetTicksNS();
|
||||||
game.delta_time_ms = SDL_NS_TO_MS((float)(start_clock - last_clock_state));
|
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;
|
if(game.delta_time_ms > 100.0f) game.delta_time_ms = 100.0f;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue