diff --git a/game/main.c b/game/main.c index 1394757..75714a3 100644 --- a/game/main.c +++ b/game/main.c @@ -345,8 +345,8 @@ static void mapdraw(const gamestate_t *state, SDL_Renderer *renderer) { const int startx = TILESIZE * floor(state->vpos.x / TILESIZE); const int starty = TILESIZE * floor(state->vpos.y / TILESIZE); - const int endx = state->vpos.x + VIEWWIDTH; - const int endy = state->vpos.y + VIEWHEIGHT; + const int endx = ceil(state->vpos.x + VIEWWIDTH); + const int endy = ceil(state->vpos.y + VIEWHEIGHT); for (int l = 0; l < MAPNLAYERS; ++l) { for (int y = starty; y < endy; y += TILESIZE) { for (int x = startx; x < endx; x += TILESIZE) {