diff options
| author | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
|---|---|---|
| committer | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
| commit | 74ea6dc86646cee9915292d73d8c7afef01ef3e0 (patch) | |
| tree | 9a58866f7765dad8ba56f1f40b1fa031e9d2687d /src/main.c | |
First commit. This is mostly the state of the project as I left it around the end of 2019.HEADmaster
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..20ff774 --- /dev/null +++ b/src/main.c @@ -0,0 +1,44 @@ +#include <ncurses.h> +#include <stdlib.h> +#include <locale.h> +#include <time.h> +#include "app.h" +#include "color.h" +#include "menu.h" + +void handle(struct app *app) +{ +} + +int main(int argc, char **argv) +{ + srand(time(NULL)); + //Setup ncurses + setlocale(LC_ALL, ""); + initscr(); + raw(); + keypad(stdscr, TRUE); + maze_color_init(); + //Construct app + struct app app; + app.maze = NULL; + //Load args + struct args args; + args.hide_menu = true; + load_args(argc, argv, &args); + app.args = &args; + //Load config + app.conf = load_default_conf(); + //Start main loop + handle(&app); + if (!args.hide_menu) + main_menu_loop(&app); + //Deallocate + if (app.maze != NULL) + { + free(app.maze->map); + free(app.maze); + } + //End + endwin(); +}
\ No newline at end of file |
