mirror of
https://github.com/thepigeongenerator/tetris_clone
synced 2026-02-08 07:33:34 +01:00
add path initialization to main
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "game/game.h"
|
#include "game/game.h"
|
||||||
|
#include "game/paths.h"
|
||||||
#include "window/renderer.h"
|
#include "window/renderer.h"
|
||||||
|
|
||||||
// initialized in init(), reading beforehand is undefined behaviour
|
// initialized in init(), reading beforehand is undefined behaviour
|
||||||
@@ -20,6 +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());
|
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
|
// initialize other game components
|
||||||
|
paths_init();
|
||||||
game_init(&gdat);
|
game_init(&gdat);
|
||||||
render_init(&rdat, &gdat);
|
render_init(&rdat, &gdat);
|
||||||
}
|
}
|
||||||
@@ -56,6 +58,7 @@ int main(int argc, char** argv) {
|
|||||||
debug("done! starting to free resources...");
|
debug("done! starting to free resources...");
|
||||||
game_free(&gdat);
|
game_free(&gdat);
|
||||||
render_free(&rdat);
|
render_free(&rdat);
|
||||||
|
paths_free();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user