mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
BEAWARE all game functionality is disabled with this commit for a while
* rework client modules * hide main window when loading * remake top menu functions * rework modules autoload * improve path resolving for otml and lua * move core_widgets to core_lib * fix tooltip issues * split some styles * add bit32 lua library * fix assert issues * fix compilation on linux 32 systems * rework gcc compile options * renable and fix some warnings * remove unused constants * speedup sprite cache * move UIGame to lua (not funcional yet) * fix a lot of issues in x11 window * fix crash handler * add some warnings do uiwidget and much more...
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <framework/core/resourcemanager.h>
|
||||
#include <lua.hpp>
|
||||
|
||||
#include <framework/thirdparty/lbitlib-5.2.0-backport4.h>
|
||||
|
||||
LuaInterface g_lua;
|
||||
|
||||
LuaInterface::LuaInterface()
|
||||
@@ -590,6 +592,9 @@ void LuaInterface::createLuaState()
|
||||
|
||||
// load lua standard libraries
|
||||
luaL_openlibs(L);
|
||||
|
||||
// load bit32 lib for bitwise operations
|
||||
luaopen_bit32(L);
|
||||
|
||||
// creates weak table
|
||||
newTable();
|
||||
@@ -812,7 +817,9 @@ void LuaInterface::getEnv(int index)
|
||||
void LuaInterface::setEnv(int index)
|
||||
{
|
||||
assert(hasIndex(index));
|
||||
assert(lua_setfenv(L, index) == 1);
|
||||
int ret;
|
||||
ret = lua_setfenv(L, index);
|
||||
assert(ret == 1);
|
||||
}
|
||||
|
||||
void LuaInterface::getTable(int index)
|
||||
|
@@ -191,7 +191,8 @@ bool luavalue_cast(int index, std::function<void(Args...)>& func) {
|
||||
try {
|
||||
if(g_lua.isFunction()) {
|
||||
g_lua.polymorphicPush(args...);
|
||||
assert(g_lua.safeCall(sizeof...(Args)) == 0);
|
||||
int rets = g_lua.safeCall(sizeof...(Args));
|
||||
g_lua.pop(rets);
|
||||
} else {
|
||||
throw LuaException("attempt to call an expired lua function from C++,"
|
||||
"did you forget to hold a reference for that function?", 0);
|
||||
|
Reference in New Issue
Block a user