Compare commits

..

No commits in common. "d1bbf0050eb4841cb86be98a6b9c4c134847759b" and "e9ea370c5e71b7eb227e05d8a5927d9bd1455cb1" have entirely different histories.

2 changed files with 13 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0524f6ada9e11518a2fbb5db5339ad7af54cbddb
Subproject commit 2e1eaf4c1c512761c7585267175bed420154172d

View File

@ -59,8 +59,18 @@ void game_handle_event(void)
}
}
static inline void update_time(void)
{
static clock_t last_clock_state = 0;
clock_t start_clock = clock();
game.delta_time_ms = (float)(start_clock - last_clock_state) * 1000.0f / CLOCKS_PER_SEC;
last_clock_state = start_clock;
}
void game_update(void)
{
update_time();
entity_manager_update(&game.entity_manager);
}
@ -86,10 +96,11 @@ int game_render(void)
int game_exit(void)
{
entity_manager_exit(&game.entity_manager);
if(asset_manager_let_go_asset(&game.asset_manager, "player_idle_sheet")) return EXIT_FAILURE;
if(asset_manager_let_go_asset(&game.asset_manager, "player_walk_sheet")) return EXIT_FAILURE;
entity_manager_exit(&game.entity_manager);
if(asset_manager_exit(&game.asset_manager)) return EXIT_FAILURE;
display_exit();