diff options
-rw-r--r-- | src/maze.c | 10 | ||||
-rw-r--r-- | src/maze.h | 3 |
2 files changed, 11 insertions, 2 deletions
@@ -180,7 +180,8 @@ mf_maze_new(int s, int w, int h) } int -mf_maze_render(struct mf_maze *m, SDL_Renderer *renderer, int cw) +mf_maze_render(struct mf_maze *m, SDL_Renderer *renderer, SDL_Color *color, + int cw) { int e; int x; @@ -188,6 +189,13 @@ mf_maze_render(struct mf_maze *m, SDL_Renderer *renderer, int cw) e = 0; + if (SDL_SetRenderDrawColor(renderer, + color->r, color->g, color->b, color->a) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "Couldn't set drawing color: %s", + SDL_GetError()); + e = -1; + } for (y = 0; y < m->h; ++y) { for (x = 0; x < m->w; ++x) { if (y < m->h - 1 && mf_maze_is_wall(m, x, y, 0, 1)) { @@ -35,7 +35,8 @@ struct mf_maze * mf_maze_new(int s, int w, int h); int -mf_maze_render(struct mf_maze *m, SDL_Renderer *renderer, int cw); +mf_maze_render(struct mf_maze *m, SDL_Renderer *renderer, SDL_Color *color, + int cw); void mf_maze_destroy(struct mf_maze **m_p); |