diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-26 18:05:08 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-26 20:00:27 +0200 |
| commit | 70bc98f96c3e4ae7a45ff095c5f539711aaf7fb1 (patch) | |
| tree | 4c55f7784e6e5926b66d48e371d30a480121cdbc | |
| parent | ad1d6b1f66f2c9113ca54979c61141a2ae94be48 (diff) | |
terrain: fix wrong rendering
The older implementation would leave empty areas on the right side of
the screen.
| -rw-r--r-- | src/terrain/src/terrain.c | 4 |
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 |
