From 737ce277a6e49d88a04be1e384eef09d486f513b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 6 Apr 2024 00:47:37 +0100 Subject: Split water from terrain Shares the geo data instance, and still has the same implementation at this stage. --- test/test-render.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/test-render.cpp b/test/test-render.cpp index 6c20a23..79424f5 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -26,11 +27,10 @@ class TestScene : public SceneProvider { AssetFactory::loadXML(RESDIR "/brush47.xml")->assets.at("brush-47")); std::shared_ptr train1, train2; RailLinks rail; + std::shared_ptr gd = std::make_shared(GeoData::createFlat({0, 0}, {1000000, 1000000}, 1)); - Terrain terrain {[]() { - auto gd = std::make_shared(GeoData::createFlat({0, 0}, {1000000, 1000000}, 1)); - return gd; - }()}; + Terrain terrain {gd}; + Water water {gd}; public: TestScene() @@ -51,6 +51,7 @@ public: content(const SceneShader & shader) const override { terrain.render(shader); + water.render(shader); brush47rvc->render(shader); rail.render(shader); } @@ -132,12 +133,16 @@ BOOST_AUTO_TEST_CASE(terrain) ss.camera.setView({310000000, 490000000, 600000}, glm::normalize(glm::vec3 {1, 1, -0.5F})); class TestTerrain : public SceneProvider { - Terrain terrain {std::make_shared(GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc"))}; + std::shared_ptr gd + = std::make_shared(GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc")); + Terrain terrain {gd}; + Water water {gd}; void content(const SceneShader & shader) const override { terrain.render(shader); + water.render(shader); } void -- cgit v1.2.3