summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-23 20:12:48 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-23 20:12:48 +0100
commitdbbfd39eef3b4d063ab7cdeb8d139b1bc11ba72c (patch)
tree0a880b2d14ac152014649d32088b73f17bf77297 /test
parentMerge branch 'sunpos' (diff)
parentPopulate all layers of shadow stencil with view from all around (diff)
downloadilt-dbbfd39eef3b4d063ab7cdeb8d139b1bc11ba72c.tar.bz2
ilt-dbbfd39eef3b4d063ab7cdeb8d139b1bc11ba72c.tar.xz
ilt-dbbfd39eef3b4d063ab7cdeb8d139b1bc11ba72c.zip
Psycho-rebased branch billboard-shadows on top of main
Diffstat (limited to 'test')
-rw-r--r--test/test-assetFactory.cpp3
-rw-r--r--test/test-render.cpp10
-rw-r--r--test/testRenderOutput.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 1c2c417..0b5b278 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -97,6 +97,7 @@ BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/brush47.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
BOOST_REQUIRE_GE(mf->shapes.size(), 6);
BOOST_CHECK(mf->shapes.at("plane"));
BOOST_CHECK(mf->shapes.at("cylinder"));
@@ -126,6 +127,7 @@ BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/foliage.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
auto tree_01_1 = mf->assets.at("Tree-01-1");
BOOST_REQUIRE(tree_01_1);
auto tree_01_1_f = std::dynamic_pointer_cast<Foliage>(tree_01_1);
@@ -144,6 +146,7 @@ BOOST_AUTO_TEST_CASE(lights, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/lights.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
auto rlight = mf->assets.at("r-light");
BOOST_REQUIRE(rlight);
auto oldlamp = mf->assets.at("old-lamp");
diff --git a/test/test-render.cpp b/test/test-render.cpp
index ea53708..0a92689 100644
--- a/test/test-render.cpp
+++ b/test/test-render.cpp
@@ -8,6 +8,7 @@
#include <boost/test/unit_test.hpp>
#include <assetFactory/assetFactory.h>
+#include <game/gamestate.h>
#include <game/geoData.h>
#include <game/network/rail.h>
#include <game/scenary/foliage.h>
@@ -26,10 +27,8 @@
#include <ui/window.h>
class TestScene : public SceneProvider {
- const RailVehicleClassPtr brush47rvc = std::dynamic_pointer_cast<RailVehicleClass>(
- AssetFactory::loadXML(RESDIR "/brush47.xml")->assets.at("brush-47"));
- const std::shared_ptr<Foliage> tree021f
- = std::dynamic_pointer_cast<Foliage>(AssetFactory::loadXML(RESDIR "/foliage.xml")->assets.at("Tree-02-1"));
+ RailVehicleClassPtr brush47rvc;
+ std::shared_ptr<Foliage> tree021f;
std::shared_ptr<RailVehicle> train1, train2;
std::shared_ptr<Plant> plant1;
RailLinks rail;
@@ -42,6 +41,9 @@ class TestScene : public SceneProvider {
public:
TestScene()
{
+ gameState->assets = AssetFactory::loadAll(RESDIR);
+ brush47rvc = std::dynamic_pointer_cast<RailVehicleClass>(gameState->assets.at("brush-47"));
+ tree021f = std::dynamic_pointer_cast<Foliage>(gameState->assets.at("Tree-02-1"));
train1 = std::make_shared<RailVehicle>(brush47rvc);
train1->location.setPosition({52000, 50000, 2000});
train1->bogies.front().setPosition(train1->bogies.front().position() + train1->location.position());
diff --git a/test/testRenderOutput.h b/test/testRenderOutput.h
index 056d029..79908b1 100644
--- a/test/testRenderOutput.h
+++ b/test/testRenderOutput.h
@@ -1,6 +1,7 @@
#pragma once
#include "config/types.h"
+#include "game/gamestate.h"
#include "glArrays.h"
#include <glm/vec2.hpp>
#include <special_members.h>
@@ -17,6 +18,7 @@ public:
glFrameBuffer output;
glRenderBuffer depth;
glTexture outImage;
+ GameState gameState;
};
template<TextureAbsCoord Size> class TestRenderOutputSize : public TestRenderOutput {