From b500aa707f42d5b1bac4bfc1b4bd3d94eac18b58 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 14 Jan 2019 13:06:12 -0500 Subject: skip floors that are definitely outside walls --- src/sdl/draw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sdl/draw.c') diff --git a/src/sdl/draw.c b/src/sdl/draw.c index 482bfb2..14307b5 100644 --- a/src/sdl/draw.c +++ b/src/sdl/draw.c @@ -126,8 +126,10 @@ draw_sprites_on_size( // draw floor for (size_t y = 0; y < level_size.y; y++) { for (size_t x = 0; x < level_size.x; x++) { - const sok_pos_t pos = { x, y }; - draw_cell(draw_ctx, pos, SPRITE_FLOOR); + if (x > 0 && y > 0 && x < level_size.x - 1 && y < level_size.y - 1) { + const sok_pos_t pos = { x, y }; + draw_cell(draw_ctx, pos, SPRITE_FLOOR); + } } } -- cgit v1.2.3