From 157530b8b6e11efc5573d5a0db8987a440197aa1 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 22:28:40 +0800 Subject: *misc --- source/3rd-party/Luax/luax_state.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source/3rd-party/Luax/luax_state.cpp') diff --git a/source/3rd-party/Luax/luax_state.cpp b/source/3rd-party/Luax/luax_state.cpp index b4d989a..3eae1df 100644 --- a/source/3rd-party/Luax/luax_state.cpp +++ b/source/3rd-party/Luax/luax_state.cpp @@ -1,8 +1,8 @@ -//#include "luax_class.h" #include "luax_enum.h" #include "luax_state.h" #include "luax_vm.h" #include "luax_class.hpp" +#include "luax_internal.h" namespace Luax { @@ -28,6 +28,16 @@ namespace Luax luaL_openlibs(mState); } + global_State* LuaxState::GetGlobalState() + { + return G(mState); + } + + LuaxVM* LuaxState::GetVM() + { + return LuaxVM::TryGetVM(G(mState)); + } + void LuaxState::PushGlobalNamespace() { int top = GetTop(); @@ -642,8 +652,8 @@ namespace Luax return value; } - void LuaxState::PushPtrUserdata(void* ptr) { - + void LuaxState::PushPtrUserdata(void* ptr) + { void** handle = (void**)lua_newuserdata(this->mState, sizeof(void*)); assert(handle); (*handle) = ptr; -- cgit v1.1-26-g67d0