From a4d5ad98353de8ff0894fbc2057a9f5e00b1fad7 Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Wed, 29 Nov 2023 09:40:48 -0600 Subject: [PATCH] Borrow CReadFile for tests The method to load a mesh from a file was removed. This is not a good fix, but it will keep the tests working until a file loader can be properly exposed to the tests. --- source/Irrlicht/tests/CMakeLists.txt | 7 +++++++ source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/tests/CMakeLists.txt b/source/Irrlicht/tests/CMakeLists.txt index 4017cde7d..811b0c122 100644 --- a/source/Irrlicht/tests/CMakeLists.txt +++ b/source/Irrlicht/tests/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(tests testCGLTFMeshFileLoader.cpp + "${PROJECT_SOURCE_DIR}/source/Irrlicht/CReadFile.cpp" ) set_target_properties(tests PROPERTIES @@ -13,6 +14,12 @@ target_compile_options(tests "$<$:-Wall>" ) +target_include_directories(tests + PRIVATE + # For CReadFile + "${PROJECT_SOURCE_DIR}/source/Irrlicht" +) + target_link_libraries(tests PRIVATE Catch2::Catch diff --git a/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp b/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp index d960e8609..86d7ff09d 100644 --- a/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp +++ b/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp @@ -1,3 +1,5 @@ +#include "CReadFile.h" + #define CATCH_CONFIG_MAIN #include #include @@ -21,7 +23,8 @@ class ScopedMesh , m_mesh { nullptr } { auto* smgr = m_device->getSceneManager(); - m_mesh = smgr->getMesh(filepath, ""); + irr::io::CReadFile f = irr::io::CReadFile(filepath); + m_mesh = smgr->getMesh(&f); } ~ScopedMesh() @@ -270,4 +273,4 @@ TEST_CASE("snow man") { CHECK(vertices[20].TCoords == irr::core::vector2df{0.208333, 0.416667}); CHECK(vertices[22].TCoords == irr::core::vector2df{0.375, 0.416667}); } -} \ No newline at end of file +}