From 0745aeb35bee22f52b812869cf77995ff1ba373b Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 27 Sep 2022 00:10:42 -0500 Subject: implement scene loading --- src/import/import_scene.test.c | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src/import/import_scene.test.c') diff --git a/src/import/import_scene.test.c b/src/import/import_scene.test.c index 72718eb..3530f0b 100644 --- a/src/import/import_scene.test.c +++ b/src/import/import_scene.test.c @@ -5,9 +5,66 @@ #include "import.test.h" +void mock_push_mesh(lua_State *L, struct aiMesh *mesh) +{ + lua_pushlightuserdata(L, mesh); +} + +void mock_push_node(lua_State *L, struct aiNode *node) +{ + lua_pushlightuserdata(L, node); +} + +#define TEST_IMPORT_SCENE + +#define push_mesh mock_push_mesh +#define push_node mock_push_node #include "import.c" +#undef push_mesh +#undef push_node void test_push_scene() { + lua_State *L = luaL_newstate(); + + struct aiScene scene; + const int num_meshes = 8; + struct aiMesh m[num_meshes]; + struct aiMesh *meshes[num_meshes]; + for (int i=0; i