mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
even more boilerplate code
This commit is contained in:
parent
7792c1a6f4
commit
5c23b4125d
11 changed files with 220 additions and 72 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "lua_util.h"
|
||||
#include "api_lua.h"
|
||||
#include "libgui.h"
|
||||
#include "libplayer.h"
|
||||
#include "libinventory.h"
|
||||
#include "../../../util/stringutil.h"
|
||||
|
||||
|
|
@ -172,6 +173,11 @@ int lua::LuaState::pushnumber(luanumber x) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int lua::LuaState::pushboolean(bool x) {
|
||||
lua_pushboolean(L, x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int lua::LuaState::pushivec3(luaint x, luaint y, luaint z) {
|
||||
lua::pushivec3(L, x, y, z);
|
||||
return 3;
|
||||
|
|
@ -233,6 +239,10 @@ lua::luanumber lua::LuaState::tonumber(int idx) {
|
|||
return lua_tonumber(L, idx);
|
||||
}
|
||||
|
||||
const char* lua::LuaState::tostring(int idx) {
|
||||
return lua_tostring(L, idx);
|
||||
}
|
||||
|
||||
void lua::LuaState::openlib(const std::string& name, const luaL_Reg* libfuncs, int nup) {
|
||||
lua_newtable(L);
|
||||
luaL_setfuncs(L, libfuncs, nup);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue