improve pushEngine

This commit is contained in:
Syping 2018-08-22 21:42:39 +02:00
parent fbcdbbc524
commit 6cd4614371
3 changed files with 11 additions and 8 deletions

11
.gitignore vendored
View file

@ -1,6 +1,3 @@
# Prerequisites
*.d
# Compiled Object files # Compiled Object files
*.slo *.slo
*.lo *.lo
@ -18,7 +15,6 @@
# Fortran module files # Fortran module files
*.mod *.mod
*.smod
# Compiled Static libraries # Compiled Static libraries
*.lai *.lai
@ -30,3 +26,10 @@
*.exe *.exe
*.out *.out
*.app *.app
# Qt project user file
*.pro.user
# Gettext translation files
*.po
*.pot

View file

@ -34,12 +34,12 @@ LuaEngineGui::LuaEngineGui(QObject *parent, bool loadBaseLibraries) : LuaEngine(
{ {
L = luaState(); L = luaState();
pushClass(L); pushClass(L);
pushEngine(); pushEngine(L);
} }
void LuaEngineGui::pushEngine() void LuaEngineGui::pushEngine(lua_State *L_p)
{ {
pushPointer("__LuaEngineGui", (void*)this); pushPointer(L_p, "__LuaEngineGui", (void*)this);
} }
void LuaEngineGui::pushClass(lua_State *L_p) void LuaEngineGui::pushClass(lua_State *L_p)

View file

@ -28,7 +28,7 @@ class LUAENGINEGUISHARED_EXPORT LuaEngineGui : public LuaEngine
Q_OBJECT Q_OBJECT
public: public:
LuaEngineGui(QObject *parent = nullptr, bool loadBaseLibraries = true); LuaEngineGui(QObject *parent = nullptr, bool loadBaseLibraries = true);
void pushEngine(); void pushEngine(lua_State *L_p);
static void pushClass(lua_State *L_p); static void pushClass(lua_State *L_p);
static void pushClass(LuaEngine *luaEngine); static void pushClass(LuaEngine *luaEngine);
static int showMessageBox(lua_State *L_p); static int showMessageBox(lua_State *L_p);