diff options
Diffstat (limited to 'NorthstarDLL/squirrel.h')
-rw-r--r-- | NorthstarDLL/squirrel.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/NorthstarDLL/squirrel.h b/NorthstarDLL/squirrel.h index 4f644703..de99b9d0 100644 --- a/NorthstarDLL/squirrel.h +++ b/NorthstarDLL/squirrel.h @@ -121,6 +121,8 @@ typedef SQRESULT (*sq_getType)(HSquirrelVM* sqvm, SQInteger iStackpos); typedef SQRESULT (*sq_getassetType)(HSquirrelVM* sqvm, SQInteger iStackpos, const char** pResult); typedef SQRESULT (*sq_getuserdataType)(HSquirrelVM* sqvm, SQInteger iStackpos, void** pData, uint64_t* pTypeId); typedef SQFloat* (*sq_getvectorType)(HSquirrelVM* sqvm, SQInteger iStackpos); +typedef SQBool (*sq_getthisentityType)(HSquirrelVM*, void** ppEntity); +typedef void* (*sq_getentityType)(HSquirrelVM*, SQInteger iStackPos); // sq stack userpointer funcs typedef void* (*sq_createuserdataType)(HSquirrelVM* sqvm, SQInteger iSize); @@ -168,6 +170,8 @@ template <ScriptContext context> class SquirrelManager sq_getassetType __sq_getasset; sq_getuserdataType __sq_getuserdata; sq_getvectorType __sq_getvector; + sq_getthisentityType __sq_getthisentity; + sq_getentityType __sq_getentity; sq_createuserdataType __sq_createuserdata; sq_setuserdatatypeidType __sq_setuserdatatypeid; @@ -312,6 +316,16 @@ template <ScriptContext context> class SquirrelManager { return __sq_setuserdatatypeid(sqvm, stackpos, typeId); } + + template <typename T> inline SQBool getthisentity(HSquirrelVM* sqvm, T* ppEntity) + { + return __sq_getentity(sqvm, (void**)ppEntity); + } + + template <typename T> inline T* getentity(HSquirrelVM* sqvm, SQInteger iStackPos) + { + return (T*)__sq_getentity(sqvm, iStackPos); + } #pragma endregion }; |