summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/level.c7
-rw-r--r--src/map.c5
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;
diff --git a/src/map.c b/src/map.c
index 1cd24e1..0e79a81 100644
--- a/src/map.c
+++ b/src/map.c
@@ -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;