diff options
-rw-r--r-- | game/geoData.cpp | 2 | ||||
-rw-r--r-- | game/geoData.h | 2 | ||||
-rw-r--r-- | test/test-geoData.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp index 5771a2f..d8caff7 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -591,7 +591,7 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const auto surfaceStripWalk = [this, &getTriangle, &opts](const auto & surfaceStripWalk, const auto & face) -> void { if (!property(surface, face)) { - property(surface, face) = &opts.surface; + property(surface, face) = opts.surface; std::ranges::for_each( ff_range(face), [this, &getTriangle, &surfaceStripWalk](const auto & adjacentFaceHandle) { if (getTriangle(this->triangle<2>(adjacentFaceHandle).centroid())) { diff --git a/game/geoData.h b/game/geoData.h index 8eda99a..92b9b75 100644 --- a/game/geoData.h +++ b/game/geoData.h @@ -78,7 +78,7 @@ public: static constexpr auto DEFAULT_NEAR_NODE_TOLERANACE = 500.F; static constexpr auto DEFAULT_MAX_SLOPE = 0.5F; - const Surface & surface; + const Surface * surface = nullptr; RelativeDistance nearNodeTolerance = DEFAULT_NEAR_NODE_TOLERANACE; RelativeDistance maxSlope = DEFAULT_MAX_SLOPE; }; diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp index 9ec4656..589f675 100644 --- a/test/test-geoData.cpp +++ b/test/test-geoData.cpp @@ -211,7 +211,7 @@ BOOST_DATA_TEST_CASE(deform, loadFixtureJson<DeformTerrainData>("geoData/deform/ Surface surface; surface.colorBias = RGB {0, 0, 1}; auto gd = std::make_shared<GeoData>(GeoData::createFlat({0, 0}, {1000000, 1000000}, 100)); - BOOST_CHECK_NO_THROW(gd->setHeights(points, {.surface = surface})); + BOOST_CHECK_NO_THROW(gd->setHeights(points, {.surface = &surface})); BOOST_CHECK_NO_THROW(gd->sanityCheck()); ApplicationBase ab; @@ -265,6 +265,6 @@ BOOST_DATA_TEST_CASE( auto gd = std::make_shared<GeoData>(GeoData::createFlat({0, 0}, {1000000, 1000000}, 100)); for (const auto & strip : points) { BOOST_REQUIRE_GE(strip.size(), 3); - BOOST_CHECK_NO_THROW(gd->setHeights(strip, {.surface = surface, .nearNodeTolerance = 50})); + BOOST_CHECK_NO_THROW(gd->setHeights(strip, {.surface = &surface, .nearNodeTolerance = 50})); } } |