aboutsummaryrefslogtreecommitdiff
path: root/src/sdl
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-01-14 13:06:12 -0500
committerPaul Duncan <pabs@pablotron.org>2019-01-14 13:06:12 -0500
commitb500aa707f42d5b1bac4bfc1b4bd3d94eac18b58 (patch)
tree6aef3f25b7fa874a612c4954e67b40d5c7ce9cc8 /src/sdl
parent280b84ed9122d6b96555498d8672b5de98286c46 (diff)
downloadsok-b500aa707f42d5b1bac4bfc1b4bd3d94eac18b58.tar.bz2
sok-b500aa707f42d5b1bac4bfc1b4bd3d94eac18b58.zip
skip floors that are definitely outside walls
Diffstat (limited to 'src/sdl')
-rw-r--r--src/sdl/draw.c6
1 files changed, 4 insertions, 2 deletions
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);
+ }
}
}