summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/maze.c10
-rw-r--r--src/maze.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/maze.c b/src/maze.c
index dcfa150..e830e01 100644
--- a/src/maze.c
+++ b/src/maze.c
@@ -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)) {
diff --git a/src/maze.h b/src/maze.h
index 04868a0..895e94e 100644
--- a/src/maze.h
+++ b/src/maze.h
@@ -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);