use new time system rather than the badly written old one

This commit is contained in:
2025-03-22 23:51:51 +01:00
parent 14c62914f0
commit f72949dc38
4 changed files with 40 additions and 47 deletions

View File

@@ -6,11 +6,9 @@
#include "error.h"
#include "game/game.h"
#include "game/gametime.h"
#include "window/renderer.h"
// initialized in init(), reading beforehand is undefined behaviour
static gametime gt;
static gamedata gdat;
static renderdata rdat;
@@ -23,8 +21,7 @@ static void init(void) {
fatal(ERROR_SDL_FONT_INIT, __FILE_NAME__, __LINE__, "the TTF module of SDL could not initialize! TTF Error: %s", TTF_GetError());
// initialize other game components
gt = gametime_new();
game_init(&gdat, &gt);
game_init(&gdat);
render_init(&rdat, &gdat);
}
@@ -43,7 +40,6 @@ static void update(void) {
}
// perform updates
gametime_update(&gt);
game_update(&gdat);
render_update(&rdat);
}