From 328c0644395e7dbaac82991e819ca2a5e6073657 Mon Sep 17 00:00:00 2001 From: Nikita Krapivin Date: Sun, 14 Feb 2021 14:38:19 +0500 Subject: [PATCH] v1.4 source --- .gitignore | 1 + libLassebq/GMLua.cpp | 336 +++++++++++++++++--------------------- libLassebq/GMLua.h | 22 ++- libLassebq/libLassebq.aps | Bin 2688 -> 2780 bytes libLassebq/libLassebq.cpp | 37 +++-- libLassebq/libLassebq.rc | Bin 4626 -> 4626 bytes 6 files changed, 196 insertions(+), 200 deletions(-) diff --git a/.gitignore b/.gitignore index 5a27da7..38aa936 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /Release /libLassebq/Release .vs/ +/libLassebq/libLassebq.vcxproj.user libLassebq.VC.db \ No newline at end of file diff --git a/libLassebq/GMLua.cpp b/libLassebq/GMLua.cpp index 8519827..487a9e0 100644 --- a/libLassebq/GMLua.cpp +++ b/libLassebq/GMLua.cpp @@ -14,13 +14,14 @@ bool g_ThrowErrors = true; bool g_NoConsole = false; bool g_IgnoreArgc = false; bool g_AddScripts = false; +int alarm_varid = -1; int lua_GMLua_ignoreArgc(lua_State* _pL) { int Largc = lua_gettop(_pL); // get argument count. - if (Largc != 1) + if (Largc < 1) { - return luaL_error(_pL, __FUNCTION__ " error: Invalid argument count, expected 1, got %d.", Largc); + return luaL_error(_pL, __FUNCTION__ " error: Invalid argument count, expected at least 1, got %d.", Largc); } if (lua_isboolean(_pL, 1)) @@ -258,77 +259,6 @@ RValue LtoR(lua_State* _pL, int a) } } -int lua_GMLua_getvar(lua_State* _pL) -{ - int Largc = lua_gettop(_pL); // get argument count. - if (Largc != 2) - { - return luaL_error(_pL, __FUNCTION__ " error: invalid argument count, expected 2, got %d.", Largc); - } - - CInstanceBase* inst = nullptr; - lua_Integer varid = -1; - if (lua_islightuserdata(_pL, 1)) - { - inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `inst`, expected lightuserdata."); - } - - if (lua_isinteger(_pL, 2)) - { - varid = lua_tointeger(_pL, 2); - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected integer."); - } - - const RValue& ref(inst->GetYYVarRef(static_cast(varid))); - return RValueToLua(_pL, ref); -} - -int lua_GMLua_setvar(lua_State* _pL) -{ - int Largc = lua_gettop(_pL); // get argument count. - if (Largc != 3) - { - return luaL_error(_pL, __FUNCTION__ " error: invalid argument count, expected 3, got %d.", Largc); - } - - CInstanceBase* inst = nullptr; - lua_Integer varid = -1; - if (lua_islightuserdata(_pL, 1)) - { - inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `inst`, expected lightuserdata."); - } - - if (lua_isinteger(_pL, 2)) - { - varid = lua_tointeger(_pL, 2); - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected integer."); - } - - RValue varval = LtoR(_pL, 3); // converts a Lua variable on the stack to an RValue. - if (varval.kind == VALUE_UNSET) - { - return luaL_error(_pL, __FUNCTION__ " error: passed value is of type UNSET, expected anything else."); - } - - RValue& ref(inst->GetYYVarRef(static_cast(varid))); - ref = varval; - return 0; -} - bool internal_getvarb(CInstanceBase* obj, int varind, int arrind, RValue& ret) { if (varind < 10000) @@ -360,80 +290,79 @@ bool internal_setvarb(CInstanceBase* obj, int varind, int arrind, RValue& val, l } } -int lua_GMLua_getvarb(lua_State* _pL) +// inst,varTable,[arrayIndex] +int lua_GMLua_getvar(lua_State* _pL) { int Largc = lua_gettop(_pL); // get argument count. if (Largc < 2) { - return luaL_error(_pL, __FUNCTION__ " error: expected at least 2 arguments, got %d.", Largc); + return luaL_error(_pL, __FUNCTION__ " error: invalid argument count, expected at least 2, got %d.", Largc); } CInstanceBase* inst = nullptr; - lua_Integer varid = -1; - int iVarind = -1; - bool direct = false; - lua_Integer arrIndex = ARRAY_INDEX_NO_INDEX; - if (lua_islightuserdata(_pL, 1)) + int varId = -1; + bool isBuiltin = false; + int arrIndex = ARRAY_INDEX_NO_INDEX; + + if (lua_isuserdata(_pL, 1)) { - inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); + CInstance** luaInst = reinterpret_cast(luaL_checkudata(_pL, 1, "__libLassebq_GMLInstance_metatable")); + if (luaInst == nullptr) + { + return luaL_error(_pL, __FUNCTION__ " error: argument `inst` is not a valid GMLInstance."); + } + + //inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); + inst = *luaInst; } else { return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `inst`, expected lightuserdata."); } - if (lua_isinteger(_pL, 2)) + if (lua_isuserdata(_pL, 2)) { - varid = lua_tointeger(_pL, 2); + LasseVar* v = reinterpret_cast(luaL_checkudata(_pL, 2, "__libLassebq_GMLVar_metatable")); + if (v == nullptr) + { + return luaL_error(_pL, __FUNCTION__ " error: argument `varid` is not a valid GMLVar."); + } + + varId = v->index; + isBuiltin = v->isbuiltin; } else { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected integer."); + return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected lightuserdata."); } - if (Largc > 2) + if (isBuiltin) { - if (lua_isboolean(_pL, 3)) + if (Largc > 2) { - direct = lua_toboolean(_pL, 3) == 1 ? true : false; - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `direct`, expected boolean."); - } - - if (Largc > 3) - { - if (lua_isinteger(_pL, 4)) + if (lua_isinteger(_pL, 3)) { - arrIndex = lua_tointeger(_pL, 4); + arrIndex = static_cast(lua_tointeger(_pL, 3)); } else { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `arrayIndex`, expected integer."); + return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `arrIndex`, expected integer."); } } - } - if (direct) - { - iVarind = static_cast(varid); + RValue ret; + internal_getvarb(inst, varId, arrIndex, ret); + return RValueToLua(_pL, ret); } else { - iVarind = g_Variables[varid]->val; + const RValue& ref(inst->GetYYVarRef(varId)); + return RValueToLua(_pL, ref); } - - RValue ret; - - int iarrInd = static_cast(arrIndex); - internal_getvarb(inst, iVarind, iarrInd, ret); - - return RValueToLua(_pL, ret); } -// inst,varid,value,[direct],[arrayindex] -int lua_GMLua_setvarb(lua_State* _pL) +// inst,varTable,value,[arrayindex] +int lua_GMLua_setvar(lua_State* _pL) { int Largc = lua_gettop(_pL); // get argument count. if (Largc < 3) @@ -441,80 +370,78 @@ int lua_GMLua_setvarb(lua_State* _pL) return luaL_error(_pL, __FUNCTION__ " error: invalid argument count, expected at least 3, got %d.", Largc); } - YYObjectBase* inst = nullptr; - lua_Integer varid = -1; - int iVarind = -1; - lua_Integer arrIndex = ARRAY_INDEX_NO_INDEX; - bool direct = false; - if (lua_islightuserdata(_pL, 1)) - { - inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); - } - else + CInstanceBase* inst = nullptr; + int varId = -1; + int arrIndex = ARRAY_INDEX_NO_INDEX; + bool isBuiltin = false; + + if (lua_isuserdata(_pL, 1)) { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `inst`, expected lightuserdata."); + CInstance** luaInst = reinterpret_cast(luaL_checkudata(_pL, 1, "__libLassebq_GMLInstance_metatable")); + if (luaInst == nullptr) + { + return luaL_error(_pL, __FUNCTION__ " error: argument `inst` is not a valid GMLInstance."); + } + + //inst = reinterpret_cast(const_cast(lua_topointer(_pL, 1))); + inst = *luaInst; } - if (lua_isinteger(_pL, 2)) + if (lua_isuserdata(_pL, 2)) { - varid = lua_tointeger(_pL, 2); + LasseVar* v = reinterpret_cast(luaL_checkudata(_pL, 2, "__libLassebq_GMLVar_metatable")); + if (v == nullptr) + { + return luaL_error(_pL, __FUNCTION__ " error: argument `varid` is not a valid GMLVar."); + } + + varId = v->index; + isBuiltin = v->isbuiltin; } else { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected integer."); + return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `varid`, expected lightuserdata."); } - RValue val = LtoR(_pL, 3); - if (val.kind == VALUE_UNSET) + RValue varval(LtoR(_pL, 3)); // converts a Lua variable on the stack to an RValue. + if (varval.kind == VALUE_UNSET) { return luaL_error(_pL, __FUNCTION__ " error: passed value is of type UNSET, expected anything else."); } - if (Largc > 3) + if (isBuiltin) { - if (lua_isboolean(_pL, 4)) - { - direct = lua_toboolean(_pL, 4) == 1 ? true : false; - } - else - { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `direct`, expected boolean."); - } - - if (Largc > 4) + if (Largc > 3) { - if (lua_isinteger(_pL, 5)) + if (lua_isinteger(_pL, 4)) { - arrIndex = lua_tointeger(_pL, 5); + arrIndex = static_cast(lua_tointeger(_pL, 4)); } else { - return luaL_error(_pL, __FUNCTION__ " error: invalid type for argument `arrayIndex`, expected integer."); + return luaL_error(_pL, __FUNCTION__ " error: invalid argument type for argument `arrIndex`, expected integer."); } } - } - if (direct) - { - iVarind = static_cast(varid); + internal_setvarb(inst, varId, arrIndex, varval, _pL); + return 0; } else { - iVarind = g_Variables[varid]->val; + RValue& ref(inst->GetYYVarRef(static_cast(varId))); + ref = varval; } - int iArrind = static_cast(arrIndex); - internal_setvarb(inst, iVarind, iArrind, val, _pL); - return 0; } +const lua_Integer GM_global = -5l; const lua_Integer GM_noone = -4l; const lua_Integer GM_all = -3l; const lua_Integer GM_other = -2l; const lua_Integer GM_self = -1l; -int lua_GMLua_instToPtr(lua_State* _pL) +int lua_GMLua_inst(lua_State* _pL) { int Largc = lua_gettop(_pL); // get argument count. if (Largc != 1) @@ -529,8 +456,9 @@ int lua_GMLua_instToPtr(lua_State* _pL) { case GM_noone: return luaL_error(_pL, __FUNCTION__ " error: instance id cannot be `noone`."); case GM_all: return luaL_error(_pL, __FUNCTION__ " error: instance id cannot be `all`."); - case GM_self: lua_pushlightuserdata(_pL, g_Self); return 1; - case GM_other: lua_pushlightuserdata(_pL, g_Other); return 1; + case GM_self: return luaL_error(_pL, __FUNCTION__ " error: instance id cannot be `self`, use _pSelf."); + case GM_other: return luaL_error(_pL, __FUNCTION__ " error: instance id cannot be `other`, use _pOther."); + case GM_global: return luaL_error(_pL, __FUNCTION__ " error: instance id cannot be `global`, use _pGlobal."); default: break; } @@ -546,7 +474,10 @@ int lua_GMLua_instToPtr(lua_State* _pL) if (inst->i_id == id) { - lua_pushlightuserdata(_pL, inst); + CInstance** luaSelf = reinterpret_cast(lua_newuserdata(lS, sizeof(CInstance**))); + *luaSelf = inst; + luaL_getmetatable(lS, "__libLassebq_GMLInstance_metatable"); + lua_setmetatable(lS, -2); return 1; } @@ -575,32 +506,30 @@ int lua_GMLua_script_cclosure(lua_State* _pL) { void RegisterFunctions(lua_State* _pL) { + char funcName[128]{ '\0' }; for (int i = 0; i < *g_RFunctionTableLen; i++) { const RFunction& rf = (*g_RFunctionTable)[i]; - std::string rfname(rf.f_name, 64); + memset(funcName, 0, sizeof(funcName)); + strcpy_s(funcName, sizeof(funcName), "GML_"); + if (strncat_s(funcName, sizeof(funcName), rf.f_name, sizeof(rf.f_name)) == EINVAL) + abort(); // skip invalid or weird functions such as @@NewGMLArray@@ or $PRINT. - if (rfname.rfind('@') != std::string::npos - || rfname.rfind(' ') != std::string::npos - || rfname.rfind('$') != std::string::npos) continue; - - // do the magic. - std::string lN("GML_"); // append "GML_" prefix to the function name. - lN += rfname; + if (strchr(funcName, '@') != nullptr + || strchr(funcName, ' ') != nullptr + || strchr(funcName, '$') != nullptr) continue; lua_pushinteger(_pL, i); lua_pushinteger(_pL, rf.f_argnumb); lua_pushcclosure(_pL, lua_GMLua_cclosure, 2); - lua_setglobal(_pL, lN.c_str()); + lua_setglobal(_pL, funcName); } // Custom variable management functions. lua_register(_pL, "GMLua_getvar", lua_GMLua_getvar); lua_register(_pL, "GMLua_setvar", lua_GMLua_setvar); - lua_register(_pL, "GMLua_getvarb", lua_GMLua_getvarb); - lua_register(_pL, "GMLua_setvarb", lua_GMLua_setvarb); - lua_register(_pL, "GMLua_instToPtr", lua_GMLua_instToPtr); + lua_register(_pL, "GMLua_inst", lua_GMLua_inst); lua_register(_pL, "GMLua_ignoreArgc", lua_GMLua_ignoreArgc); } @@ -686,7 +615,7 @@ bool LuaChkArgs(const int gmargc, int luaargc, lua_State* _pL) if (gmargc != luaargc) { - luaL_error(_pL, __FUNCTION__ " error: invalid argument count, expected %d, got %d.", gmargc, luaargc); + luaL_error(_pL, __FUNCTION__ " error: invalid argument count for a GM call, expected %d, got %d.", gmargc, luaargc); return false; } else @@ -738,34 +667,78 @@ int DoLuaScriptCall(lua_State* _pL, const int entryId) void RegisterVarids(lua_State* _pL) { char buf[256]{ '\0' }; + + // make us a type of sorts, which will be assigned to every GMLVar object. + luaL_newmetatable(_pL, "__libLassebq_GMLVar_metatable"); + lua_pop(_pL, 1); + + // cool and good methods. + luaL_newmetatable(_pL, "__libLassebq_GMLInstance_metatable"); + luaL_dostring(_pL, "return (function(t,k) return GMLua_getvar(t, GMLua_vars[k]) end)"); + lua_setfield(_pL, -2, "__index"); + luaL_dostring(_pL, "return (function(t,k,v) GMLua_setvar(t, GMLua_vars[k], v) end)"); + lua_setfield(_pL, -2, "__newindex"); + lua_pop(_pL, 1); + + // lookup table + lua_newtable(_pL); + lua_setglobal(_pL, "GMLua_vars"); + + // custom vars for (int i = 0; true; i++) { - YYVAR* v = g_Variables[i]; - if (v == nullptr) break; + if (g_Variables[i] == nullptr) break; memset(buf, 0, sizeof(buf)); if (strcat_s(buf, sizeof(buf), "GMLVar_") == EINVAL) abort(); - if (strcat_s(buf, sizeof(buf), v->pName) == EINVAL) abort(); - lua_pushinteger(_pL, i); + if (strcat_s(buf, sizeof(buf), g_Variables[i]->pName) == EINVAL) abort(); + + LasseVar* v = reinterpret_cast(lua_newuserdata(_pL, sizeof(v))); + v->index = i; + v->isbuiltin = false; + + luaL_getmetatable(_pL, "__libLassebq_GMLVar_metatable"); + lua_setmetatable(_pL, -2); lua_setglobal(_pL, buf); - } - lua_pushlightuserdata(_pL, *g_pGlobal); - lua_setglobal(_pL, "_pGlobal"); -} + lua_getglobal(_pL, "GMLua_vars"); + lua_getglobal(_pL, buf); + lua_setfield(_pL, -2, g_Variables[i]->pName); + lua_pop(_pL, 1); + } -void RegisterBuiltinVarids(lua_State * _pL) -{ - char buf[256]{ '\0' }; + // builtin vars. for (int i = 0; i < 500; i++) { if (g_BuiltinVars[i].f_name == nullptr || g_BuiltinVars[i].f_getroutine == nullptr) break; - memset(buf, 0, sizeof(buf)); - if (strcat_s(buf, sizeof(buf), "GMLBVar_") == EINVAL) abort(); + if (strcat_s(buf, sizeof(buf), "GMLVar_") == EINVAL) abort(); if (strcat_s(buf, sizeof(buf), g_BuiltinVars[i].f_name) == EINVAL) abort(); - lua_pushinteger(_pL, i); + + if (strcmp(g_BuiltinVars[i].f_name, "alarm") == 0) + alarm_varid = i; + + LasseVar* v = reinterpret_cast(lua_newuserdata(_pL, sizeof(v))); + v->index = i; + v->isbuiltin = true; + + luaL_getmetatable(_pL, "__libLassebq_GMLVar_metatable"); + lua_setmetatable(_pL, -2); lua_setglobal(_pL, buf); + + lua_getglobal(_pL, "GMLua_vars"); + lua_getglobal(_pL, buf); + lua_setfield(_pL, -2, g_BuiltinVars[i].f_name); + lua_pop(_pL, 1); } + + CInstance** luaGlobal = reinterpret_cast(lua_newuserdata(lS, sizeof(CInstance**))); + + // this is wrong, will likely break stuff, but who cares. + *luaGlobal = reinterpret_cast(*g_pGlobal); + + luaL_getmetatable(lS, "__libLassebq_GMLInstance_metatable"); + lua_setmetatable(lS, -2); + lua_setglobal(_pL, "_pGlobal"); } void InitLua(void) @@ -776,6 +749,5 @@ void InitLua(void) RegisterAssets(lS); RegisterFunctions(lS); RegisterVarids(lS); - RegisterBuiltinVarids(lS); RegisterScripts(lS); } \ No newline at end of file diff --git a/libLassebq/GMLua.h b/libLassebq/GMLua.h index 4c42f34..1a0a246 100644 --- a/libLassebq/GMLua.h +++ b/libLassebq/GMLua.h @@ -10,25 +10,35 @@ extern std::vector Lscripts; extern lua_State* lS; +void InitLua(void); void InitGMLuaScripts(void); void InitGMLuaConfig(void); +struct LasseVar { + int index; + bool isbuiltin; +}; + +// Lua->RV->Lua stuff +RValue LtoR(lua_State* _pL, int a); void LuaToRValue(lua_State* _pL, int a, RValueList& args); int RValueToLua(lua_State* _pL, const RValue& result); + +// Lua->GML call stuff bool LuaChkArgs(const int gmargc, int luaargc, lua_State* _pL); int DoLuaGMLCall(lua_State* _pL, const int functionId, const int gmArgc); int DoLuaScriptCall(lua_State* _pL, const int entryId); -RValue LtoR(lua_State* _pL, int a); + +// registrars void RegisterRConstants(lua_State* _pL); void RegisterAssets(lua_State* _pL); void RegisterVarids(lua_State* _pL); -void RegisterBuiltinVarids(lua_State* _pL); -void InitLua(void); + int lua_GMLua_getvar(lua_State* _pL); int lua_GMLua_setvar(lua_State* _pL); -int lua_GMLua_getvarb(lua_State* _pL); -int lua_GMLua_setvarb(lua_State* _pL); -int lua_GMLua_instToPtr(lua_State* _pL); +int lua_GMLua_inst(lua_State* _pL); + +// config variables. extern bool g_ThrowErrors; extern bool g_NoConsole; extern bool g_AddCollisionEvents; diff --git a/libLassebq/libLassebq.aps b/libLassebq/libLassebq.aps index 4282ebdae6544100b76ae9fa644d54f0dd9c829b..a5ca693837b52a27341f434e5965e698f1e32ff6 100644 GIT binary patch delta 153 zcmZn=y(2oog-L~TqnjTi{ESnKaRQhn#U;jg2govJXJBJs`2SyE@_iOj0B$=dSO5S3 delta 157 zcmca3+8{c?h4};r!(=`tr;VN5jEruRr!uB)4r7|n%qTGV8>u zG}>Is9uK4@U**^hR6LPWol#}-PEKV;hsk$2m6=vBPkzQMH(7y;h3N~+pF diff --git a/libLassebq/libLassebq.cpp b/libLassebq/libLassebq.cpp index aa3e8c8..72d3c8c 100644 --- a/libLassebq/libLassebq.cpp +++ b/libLassebq/libLassebq.cpp @@ -99,8 +99,16 @@ void lassebq_doLua(CInstance* _pSelf, CInstance* _pOther, const char* _pLFName) if (lua_isfunction(lS, -1)) // if the function exists... { // push pSelf/pOther as arguments to the function call... - lua_pushlightuserdata(lS, _pSelf); - lua_pushlightuserdata(lS, _pOther); + // TODO: wrappers? + CInstance** luaSelf = reinterpret_cast(lua_newuserdata(lS, sizeof(CInstance**))); + *luaSelf = _pSelf; + luaL_getmetatable(lS, "__libLassebq_GMLInstance_metatable"); + lua_setmetatable(lS, -2); + CInstance** luaOther = reinterpret_cast(lua_newuserdata(lS, sizeof(CInstance**))); + *luaOther = _pOther; + luaL_getmetatable(lS, "__libLassebq_GMLInstance_metatable"); + lua_setmetatable(lS, -2); + int lArgc = 2; int rnum = 0; @@ -365,6 +373,8 @@ void lassebq_make_obj_liblassebq() // WHICH MEANS, WE CAN DO THIS: lassebq_callr("room_instance_add", { 0.0, 0.0, 0.0, obj_index }); // room_instance_add our object at position 0;0 + // first room only. + std::cout << "libLassebq object instance id " << Result.asInt32() << std::endl; // do not modify or remove these two lines. #if defined(KZ_105_GOG) || defined(KZ_105_STEAM) @@ -457,6 +467,10 @@ void lassebq_initYYC() g_pGlobal = reinterpret_cast(exeAsUint + Global_YYObject_Addr); +#ifndef DITTO_WIN_STEAM /* the heck ditto does? o_O */ + lassebq_make_obj_liblassebq(); +#endif + //WaitForDebugger(); // I'd print authors and copyright before doing any lua stuff std::cout << std::endl; @@ -468,9 +482,6 @@ void lassebq_initYYC() std::cout << "Initializing GMLua..." << std::endl; InitGMLuaScripts(); InitLua(); -#ifndef DITTO_WIN_STEAM /* the heck ditto does? o_O */ - lassebq_make_obj_liblassebq(); -#endif lassebq_patchObject(); // very cursed. @@ -481,16 +492,17 @@ void lassebq_initYYC() std::cout << std::endl; // oh, at long last, switch to our game window instead of the console window :/ - lassebq_callr("window_handle"); - HWND hGMWindow = reinterpret_cast(Result.asPointer()); - SetActiveWindow(hGMWindow); - SetForegroundWindow(hGMWindow); + if (!g_NoConsole) + { + lassebq_callr("window_handle"); + HWND hGMWindow = reinterpret_cast(Result.asPointer()); + SetActiveWindow(hGMWindow); + SetForegroundWindow(hGMWindow); + } } funcR lassebq_init() { - // do the job. - lassebq_initYYC(); return 1.0; } @@ -503,5 +515,6 @@ funcR lassebq_shutdown() funcV RegisterCallbacks(char* p1, char* p2, char* p3, char* p4) { - // does nothing. i'll leave it here just in case. + // do the job. + lassebq_initYYC(); } \ No newline at end of file diff --git a/libLassebq/libLassebq.rc b/libLassebq/libLassebq.rc index 53d139159fb51fb0c55e5cf746a4b1884b800f92..17f8b3033ec9b888c35c85a49af74d7bf6f645d4 100644 GIT binary patch delta 46 zcmbQFGD&4a6$hiqMw88JIb@lE)M;*YCZO19Zu!Y7d_t4Y@o{a|<9osk077>S Aq5uE@ delta 46 zcmbQFGD&4a6$hj7M&r$EIb@lE)M;*YCZO19Zu!Y7d_t4Y@o{a|<9osk073>0 Ao&W#<