lua api refactor

This commit is contained in:
MihailRis
2024-03-05 13:58:08 +03:00
parent 5309cbe67f
commit 6bf6e8e011
20 changed files with 663 additions and 710 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "api_lua.h"
#include "lua_commons.h"
#include "../scripting.h"
#include "../../../engine.h"
#include "../../../window/Window.h"
static int l_time_uptime(lua_State* L) {
lua_pushnumber(L, Window::time());
return 1;
}
static int l_time_delta(lua_State* L) {
lua_pushnumber(L, scripting::engine->getDelta());
return 1;
}
const luaL_Reg timelib [] = {
{"uptime", lua_wrap_errors<l_time_uptime>},
{"delta", lua_wrap_errors<l_time_delta>},
{NULL, NULL}
};