summaryrefslogtreecommitdiff
path: root/test/test-assetFactory.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-10 18:45:13 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-10 18:45:13 +0100
commitb25bc3cc32c5a9057c66ad282fa1cdfe0ed6094a (patch)
tree469ffd495b9114ff7f7a7ccca75e4a1977c1f662 /test/test-assetFactory.cpp
parentSupport loading textures from an in memory buffer (diff)
downloadilt-b25bc3cc32c5a9057c66ad282fa1cdfe0ed6094a.tar.bz2
ilt-b25bc3cc32c5a9057c66ad282fa1cdfe0ed6094a.tar.xz
ilt-b25bc3cc32c5a9057c66ad282fa1cdfe0ed6094a.zip
First cut loading assets using assimp
This is far from perfect, specifically the created texture atlas is not compatibile with wrapping texture UVs
Diffstat (limited to 'test/test-assetFactory.cpp')
-rw-r--r--test/test-assetFactory.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 54168aa..dd458ca 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -8,6 +8,8 @@
#include "assetFactory/assetFactory.h"
#include "assetFactory/object.h"
#include "assetFactory/texturePacker.h"
+#include "game/scenary/foliage.h"
+#include "game/scenary/plant.h"
#include "game/vehicles/railVehicle.h"
#include "game/vehicles/railVehicleClass.h"
#include "gfx/gl/sceneRenderer.h"
@@ -96,6 +98,21 @@ BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5))
render();
}
+
+BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5))
+{
+ auto mf = AssetFactory::loadXML(RESDIR "/foliage.xml");
+ BOOST_REQUIRE(mf);
+ 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);
+ BOOST_REQUIRE(tree_01_1_f);
+
+ auto plant = std::make_shared<Plant>(tree_01_1_f, Location {});
+ objects.objects.push_back(plant);
+
+ render();
+}
BOOST_AUTO_TEST_SUITE_END();
template<typename T> using InOut = std::tuple<T, T>;