aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel.h
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-10-09 02:24:29 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-10-09 02:24:29 +0100
commitb281d36088d1d92acb3db1677881bf984a7d0901 (patch)
tree0966354ee0f7fda77d924c6daabb5c21e8e7964d /NorthstarDLL/squirrel.h
parent708bfedf71413bb2061a76c3ee4de5cbc8c56513 (diff)
downloadNorthstarLauncher-b281d36088d1d92acb3db1677881bf984a7d0901.tar.gz
NorthstarLauncher-b281d36088d1d92acb3db1677881bf984a7d0901.zip
add more entity functions
Diffstat (limited to 'NorthstarDLL/squirrel.h')
-rw-r--r--NorthstarDLL/squirrel.h14
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
};