refactor: 'lua' namespace expansion

This commit is contained in:
MihailRis
2024-06-11 03:37:35 +03:00
parent 7973a9c32b
commit 0647bc6f90
26 changed files with 613 additions and 723 deletions
+5 -8
View File
@@ -1,21 +1,18 @@
#include "api_lua.hpp"
#include "lua_commons.hpp"
#include "../scripting.hpp"
#include "../../../engine.hpp"
#include "../../../window/Window.hpp"
static int l_time_uptime(lua_State* L) {
lua_pushnumber(L, Window::time());
return 1;
return lua::pushnumber(L, Window::time());
}
static int l_time_delta(lua_State* L) {
lua_pushnumber(L, scripting::engine->getDelta());
return 1;
return lua::pushnumber(L, scripting::engine->getDelta());
}
const luaL_Reg timelib [] = {
{"uptime", lua_wrap_errors<l_time_uptime>},
{"delta", lua_wrap_errors<l_time_delta>},
{"uptime", lua::wrap<l_time_uptime>},
{"delta", lua::wrap<l_time_delta>},
{NULL, NULL}
};