mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
refactor: 'lua' namespace expansion
This commit is contained in:
parent
7973a9c32b
commit
0647bc6f90
26 changed files with 613 additions and 723 deletions
|
|
@ -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}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue