summaryrefslogtreecommitdiff
path: root/test/test-render.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-06 00:47:37 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-06 00:47:37 +0100
commit737ce277a6e49d88a04be1e384eef09d486f513b (patch)
tree2eeb29d316567b1157d7a32753658df5c5f36741 /test/test-render.cpp
parentMerge remote-tracking branch 'origin/deform-terrain' (diff)
downloadilt-737ce277a6e49d88a04be1e384eef09d486f513b.tar.bz2
ilt-737ce277a6e49d88a04be1e384eef09d486f513b.tar.xz
ilt-737ce277a6e49d88a04be1e384eef09d486f513b.zip
Split water from terrain
Shares the geo data instance, and still has the same implementation at this stage.
Diffstat (limited to 'test/test-render.cpp')
-rw-r--r--test/test-render.cpp15
1 files changed, 10 insertions, 5 deletions
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 <game/terrain.h>
#include <game/vehicles/railVehicle.h>
#include <game/vehicles/railVehicleClass.h>
+#include <game/water.h>
#include <gfx/gl/sceneRenderer.h>
#include <gfx/models/texture.h>
#include <lib/glArrays.h>
@@ -26,11 +27,10 @@ class TestScene : public SceneProvider {
AssetFactory::loadXML(RESDIR "/brush47.xml")->assets.at("brush-47"));
std::shared_ptr<RailVehicle> train1, train2;
RailLinks rail;
+ std::shared_ptr<GeoData> gd = std::make_shared<GeoData>(GeoData::createFlat({0, 0}, {1000000, 1000000}, 1));
- Terrain terrain {[]() {
- auto gd = std::make_shared<GeoData>(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>(GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc"))};
+ std::shared_ptr<GeoData> gd
+ = std::make_shared<GeoData>(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