From 8827e35ada8e7f2d8e6d3bde880042354c2e82ad Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 10 Sep 2024 22:58:46 +0200 Subject: [PATCH] Standardize or something :') --- src/main.h => main.h | 0 src/main.i => main.i | 0 src/structs.h => structs.h | 0 test/graphics.c | 4 ++-- test/graphics.ext.c | 6 +++--- test/lua.c | 18 ++++++++++++++++++ src/types.h => types.h | 0 7 files changed, 23 insertions(+), 5 deletions(-) rename src/main.h => main.h (100%) rename src/main.i => main.i (100%) rename src/structs.h => structs.h (100%) create mode 100644 test/lua.c rename src/types.h => types.h (100%) diff --git a/src/main.h b/main.h similarity index 100% rename from src/main.h rename to main.h diff --git a/src/main.i b/main.i similarity index 100% rename from src/main.i rename to main.i diff --git a/src/structs.h b/structs.h similarity index 100% rename from src/structs.h rename to structs.h diff --git a/test/graphics.c b/test/graphics.c index 9bb43d8..e215174 100644 --- a/test/graphics.c +++ b/test/graphics.c @@ -1,5 +1,5 @@ -#include "../src/main.h" -#include "../../unigi.platform.sdl1/src/main.c" +#include "unigi/main.h" +#include "unigi.platform.sdl1/main.c" uint32_t seed = 1337; uint32_t example_random() { diff --git a/test/graphics.ext.c b/test/graphics.ext.c index 617adea..cbb8fb0 100644 --- a/test/graphics.ext.c +++ b/test/graphics.ext.c @@ -1,6 +1,6 @@ -#include "../src/main.h" -#include "../../unigi.platform.sdl1/src/main.c" -#include "../../unigi.ext/src/main.c" +#include "unigi/main.h" +#include "unigi.platform.sdl1/main.c" +#include "unigi.ext/main.c" uint32_t seed = 1337; uint32_t example_random() { diff --git a/test/lua.c b/test/lua.c new file mode 100644 index 0000000..96f7f91 --- /dev/null +++ b/test/lua.c @@ -0,0 +1,18 @@ +#include "unigi/main.h" +#include "unigi.platform.sdl1/main.c" +#include "unigi/main_wrap.c" + +#if LUA_VERSION_NUM < 503 +#include +#endif + + +int main(int argc, char *argv[]) { + lua_State *L = luaL_newstate(); + assert(L != NULL); + luaL_openlibs(L); + luaopen_unigi(L); // Load the wrapped module + luaL_loadfile(L, "mods/main/script/main.lua"); + lua_pcall(L, 0, 0, 0); + return 0; +} diff --git a/src/types.h b/types.h similarity index 100% rename from src/types.h rename to types.h