From 7e49c6f3d1e74287ed9a992552ff291602640d6d Mon Sep 17 00:00:00 2001 From: Fierelier Date: Mon, 15 May 2023 11:08:45 +0200 Subject: [PATCH] Lua blart --- lua_translate | 4 ++-- main.c | 2 +- modules/engine/addon/lua.c | 5 +++-- modules/engine/addon/lua_manual.c | 3 +++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lua_translate b/lua_translate index a28342e..1804d6d 100755 --- a/lua_translate +++ b/lua_translate @@ -64,7 +64,7 @@ for func in functions: ofile.write('\n}\n\n') ofile.write('''\ -void engine_luaInit() { +void engine_lua_init() { engine_lua_state = luaL_newstate(); luaL_openlibs(engine_lua_state); @@ -77,7 +77,7 @@ for func in functions: ofile.write('\tlua_setglobal (engine_lua_state,"' +func+ '");\n') ofile.write('''\ - + engine_lua_init_manual(); luaL_loadfile(engine_lua_state,"assets/scripts/main.lua"); lua_call(engine_lua_state,0,0); }''') diff --git a/main.c b/main.c index 559d6c6..8edf22e 100644 --- a/main.c +++ b/main.c @@ -10,5 +10,5 @@ int main(int argc, char **argv) { printf("argv[%d]: %s\n", i, argv[i]); } - engine_luaInit(); + engine_lua_init(); } diff --git a/modules/engine/addon/lua.c b/modules/engine/addon/lua.c index 4302541..6e0dc86 100644 --- a/modules/engine/addon/lua.c +++ b/modules/engine/addon/lua.c @@ -1,6 +1,7 @@ #include #include #include +#include "lua_manual.c" lua_State * engine_lua_state; int engine_luaf_free(lua_State *L) { @@ -102,7 +103,7 @@ int engine_luaf_texture_from_file(lua_State *L) { return 0; } -void engine_luaInit() { +void engine_lua_init() { engine_lua_state = luaL_newstate(); luaL_openlibs(engine_lua_state); @@ -134,7 +135,7 @@ void engine_luaInit() { lua_setglobal (engine_lua_state,"engine_texture_render_2d"); lua_pushcfunction(engine_lua_state,engine_luaf_texture_from_file); lua_setglobal (engine_lua_state,"engine_texture_from_file"); - + engine_lua_init_manual(); luaL_loadfile(engine_lua_state,"assets/scripts/main.lua"); lua_call(engine_lua_state,0,0); } \ No newline at end of file diff --git a/modules/engine/addon/lua_manual.c b/modules/engine/addon/lua_manual.c index e69de29..292307b 100644 --- a/modules/engine/addon/lua_manual.c +++ b/modules/engine/addon/lua_manual.c @@ -0,0 +1,3 @@ +void engine_lua_init_manual() { + +}