summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-08 00:59:52 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-08 00:59:52 +0100
commit34ea78ea50b015d660fbd9169f61506363959214 (patch)
tree1cb1de6865c0c35e2c35fcd6e2b5610b0eedd8ab /test
parentMerge remote-tracking branch 'origin/deform-terrain' (diff)
parentFix water texture wrapper in light of large position values (diff)
downloadilt-34ea78ea50b015d660fbd9169f61506363959214.tar.bz2
ilt-34ea78ea50b015d660fbd9169f61506363959214.tar.xz
ilt-34ea78ea50b015d660fbd9169f61506363959214.zip
Merge branch 'separate-water'
Diffstat (limited to 'test')
-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