Color names, sort out cmake wackiness
This commit is contained in:
@@ -41,8 +41,18 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
mazegrid_t maze;
|
||||
mazeoptions_t* options = mazemaker_options_new();
|
||||
if (fg_color != NULL) mazemaker_options_set_wall_color(options, fg_color);
|
||||
if (bg_color != NULL) mazemaker_options_set_background_color(options, bg_color);
|
||||
if (fg_color != NULL) {
|
||||
if (0 > mazemaker_options_set_wall_color(options, fg_color)) {
|
||||
fprintf(stderr, "Unknown color: \"%s\"\n", fg_color);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (bg_color != NULL) {
|
||||
if (0 > mazemaker_options_set_background_color(options, bg_color)) {
|
||||
fprintf(stderr, "Unknown color: \"%s\"\n", bg_color);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
mazemaker_generate_maze(width, height, &maze);
|
||||
mazemaker_maze_to_png_opt(&maze, filename, options);
|
||||
mazemaker_free_maze(&maze);
|
||||
|
||||
Reference in New Issue
Block a user