diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -37,6 +37,8 @@ void initialize_colors(void) { init_pair(WALL_COLOR, COLOR_WHITE, COLOR_WHITE); init_pair(START_COLOR, -1, COLOR_RED); init_pair(PATH_COLOR, COLOR_RED, COLOR_RED); + init_pair(FRONTIER_COLOR, COLOR_BLUE, COLOR_BLUE); + init_pair(CURSOR_COLOR, -1, COLOR_RED); } void init_ncurses(void) { @@ -78,13 +80,14 @@ int main(int argc, char **argv) { int offset_x = 0, offset_y = 0; - draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, NULL); + draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, NULL, NULL, NULL); + //print_map_out(map, width, height); char visited[height][width]; - Path path = breadth_first_search_path_4dir(map, width, height, start_pos, end_pos, visited); + Path path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, 1); while (1) { - draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, path, visited); + draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, path, visited, NULL); char c = getch(); switch (c) { case 'h': offset_x -= 2; break; @@ -95,7 +98,7 @@ int main(int argc, char **argv) { if (is_maze) { //FIXME: free it all before generating a new one map = rbt_maze_map(mwidth, mheight, (unsigned int) time(NULL)); - path = breadth_first_search_path_4dir(map, width, height, start_pos, end_pos, visited); + path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, 1); } break; case 'q': endwin(); return 0; |
