diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -51,6 +51,7 @@ void init_ncurses(void) { cbreak(); /* Process input one char at a time */ curs_set(0); /* Hide the cursor */ noecho(); /* Don't echo characters */ + keypad(stdscr, TRUE); initialize_colors(); } @@ -157,6 +158,7 @@ int main(int argc, char **argv) { case 'i': if(is_maze) { switch (c) { + /* TODO: handle if it's zero */ case 'y': mwidth -= 1; break; case 'o': mwidth += 1; break; case 'u': mheight += 1; break; @@ -190,6 +192,16 @@ int main(int argc, char **argv) { path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); } break; + case 'e': + is_maze = 0; + visited_free(visited, height); + path_free(path, height); + + map_editor(&map, &width, &height, &start_pos, &end_pos); + + visited = visited_new(width, height); + path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); + break; case 'q': map_free(map, height); path_free(path, height); endwin(); return 0; } } |
