diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-25 15:57:17 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-25 15:57:17 (EDT) |
commit | ffc5cdc5bb5fa09f51edf34a4857cb7d8b6599e4 (patch) | |
tree | 3ce08d3c0fb4ff48c197979d33378efe23ea44dc | |
parent | 1b7f7a0fce4662ca5b62789604601b200f4a633f (diff) | |
download | dodge-balls-ffc5cdc5bb5fa09f51edf34a4857cb7d8b6599e4.zip dodge-balls-ffc5cdc5bb5fa09f51edf34a4857cb7d8b6599e4.tar.gz dodge-balls-ffc5cdc5bb5fa09f51edf34a4857cb7d8b6599e4.tar.bz2 |
map: Use map background color
-rw-r--r-- | src/level.c | 7 | ||||
-rw-r--r-- | src/map.c | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/level.c b/src/level.c index 71f2648..0973003 100644 --- a/src/level.c +++ b/src/level.c @@ -20,7 +20,6 @@ #include <SDL.h> #include <stdlib.h> #include "ball.h" -#include "defs.h" #include "level.h" #include "map.h" #include "output.h" @@ -88,12 +87,6 @@ db_level_play(SDL_Renderer *renderer, struct db_level *level) } map_texture = db_map_render(map, renderer); - if (SDL_SetRenderDrawColor(renderer, - DB_COLOR_BACK_R, DB_COLOR_BACK_G, - DB_COLOR_BACK_B, DB_COLOR_BACK_A) != 0) { - db_err("Failed to set drawing color (%s)", SDL_GetError()); - return -1; - } if (SDL_RenderClear(renderer) != 0) { db_err("Failed to clear screen (%s)", SDL_GetError()); return -1; @@ -540,6 +540,11 @@ db_map_render(struct db_map *map, SDL_Renderer *renderer) map->h * map->th); old_target = SDL_GetRenderTarget(renderer); SDL_SetRenderTarget(renderer, texture); + if (SDL_SetRenderDrawColor(renderer, + map->bg_r, map->bg_g, map->bg_b, 0xFF) != 0) { + db_err("Failed to set drawing color (%s)", SDL_GetError()); + return NULL; + } if (SDL_RenderClear(renderer) != 0) { db_err("Failed to clear texture (%s)", SDL_GetError()); return NULL; |