aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 18:05:08 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 20:00:27 +0200
commitc0887a44fb3c716194ef8eacd27a9556fdfdfc00 (patch)
tree55d0b69e22c3667984b9f679e6a8ebd7f2d1252a /src
parent50b362db3998e4c17cd449dda939d416954bf1ba (diff)
downloadjancity-c0887a44fb3c716194ef8eacd27a9556fdfdfc00.tar.gz
terrain: fix wrong rendering
The older implementation would leave empty areas on the right side of the screen.
Diffstat (limited to 'src')
-rw-r--r--src/terrain/src/terrain.c4
1 files changed, 2 insertions, 2 deletions
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