From 70bc98f96c3e4ae7a45ff095c5f539711aaf7fb1 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 26 Jun 2022 18:05:08 +0200 Subject: terrain: fix wrong rendering The older implementation would leave empty areas on the right side of the screen. --- src/terrain/src/terrain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/terrain/src/terrain.c b/src/terrain/src/terrain.c index 8f1924c..5ee4daa 100644 --- a/src/terrain/src/terrain.c +++ b/src/terrain/src/terrain.c @@ -88,10 +88,10 @@ int terrain_render(const struct terrain_map *const map, int nx = map->nx, ny = map->ny; - if (abs(remx) >= TERRAIN_SZ / 2) + if (abs(remx)) nx++; - if (abs(remy) >= TERRAIN_SZ / 2) + if (abs(remy)) ny++; struct m -- cgit v1.2.3