summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-05 15:37:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-05 15:37:13 +0000
commitacca54f3a12225454633dca2d56506c0dcebb653 (patch)
tree9b1367a07582cd8d6dffae58478d5ee832170b4e /game
parentFix and split linesCross (diff)
downloadilt-acca54f3a12225454633dca2d56506c0dcebb653.tar.bz2
ilt-acca54f3a12225454633dca2d56506c0dcebb653.tar.xz
ilt-acca54f3a12225454633dca2d56506c0dcebb653.zip
Fix calculating extents
Diffstat (limited to 'game')
-rw-r--r--game/geoData.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index 78f753f..781b41e 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -25,8 +25,8 @@ GeoData::loadFromAsciiGrid(const std::filesystem::path & input)
vertices.reserve(ncols * nrows);
GeoData mesh;
mesh.lowerExtent = {xllcorner, yllcorner, std::numeric_limits<float>::max()};
- mesh.upperExtent
- = {xllcorner + (cellsize * ncols), yllcorner + (cellsize * nrows), std::numeric_limits<float>::min()};
+ mesh.upperExtent = {xllcorner + (cellsize * (ncols - 1)), yllcorner + (cellsize * (nrows - 1)),
+ std::numeric_limits<float>::min()};
for (size_t row = 0; row < nrows; ++row) {
for (size_t col = 0; col < ncols; ++col) {
float height = 0;