aboutsummaryrefslogtreecommitdiff
path: root/primedev/squirrel
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2024-08-25 19:18:42 +0200
committerGitHub <noreply@github.com>2024-08-25 19:18:42 +0200
commit5472a3630762db2d6880a4dafda9402dbbc872f8 (patch)
treea8602200e2f5052c6a7ccc9e75e03a428d2c7936 /primedev/squirrel
parentfff09b8b6805f66c87da2ac39ef5509bffb129cf (diff)
parent5aae42126a062f1d184aff1c8217ef50259ccc53 (diff)
downloadNorthstarLauncher-5472a3630762db2d6880a4dafda9402dbbc872f8.tar.gz
NorthstarLauncher-5472a3630762db2d6880a4dafda9402dbbc872f8.zip
Merge branch 'main' into feat/overhaul-mod-loading-locations
Diffstat (limited to 'primedev/squirrel')
-rw-r--r--primedev/squirrel/squirrel.h125
1 files changed, 25 insertions, 100 deletions
diff --git a/primedev/squirrel/squirrel.h b/primedev/squirrel/squirrel.h
index 547b1efc..086ab9c6 100644
--- a/primedev/squirrel/squirrel.h
+++ b/primedev/squirrel/squirrel.h
@@ -126,10 +126,7 @@ public:
#pragma endregion
#pragma region SQVM func wrappers
- inline void defconst(CSquirrelVM* sqvm, const SQChar* pName, int nValue)
- {
- __sq_defconst(sqvm, pName, nValue);
- }
+ inline void defconst(CSquirrelVM* sqvm, const SQChar* pName, int nValue) { __sq_defconst(sqvm, pName, nValue); }
inline SQRESULT
compilebuffer(CompileBufferState* bufferState, const SQChar* bufferName = "unnamedbuffer", const SQBool bShouldThrowError = false)
@@ -137,110 +134,50 @@ public:
return __sq_compilebuffer(m_pSQVM->sqvm, bufferState, bufferName, -1, bShouldThrowError);
}
- inline SQRESULT _call(HSquirrelVM* sqvm, const SQInteger args)
- {
- return __sq_call(sqvm, args + 1, false, true);
- }
+ inline SQRESULT _call(HSquirrelVM* sqvm, const SQInteger args) { return __sq_call(sqvm, args + 1, false, true); }
- inline SQInteger raiseerror(HSquirrelVM* sqvm, const SQChar* sError)
- {
- return __sq_raiseerror(sqvm, sError);
- }
+ inline SQInteger raiseerror(HSquirrelVM* sqvm, const SQChar* sError) { return __sq_raiseerror(sqvm, sError); }
inline bool compilefile(CSquirrelVM* sqvm, const char* path, const char* name, int a4)
{
return __sq_compilefile(sqvm, path, name, a4);
}
- inline void newarray(HSquirrelVM* sqvm, const SQInteger stackpos = 0)
- {
- __sq_newarray(sqvm, stackpos);
- }
+ inline void newarray(HSquirrelVM* sqvm, const SQInteger stackpos = 0) { __sq_newarray(sqvm, stackpos); }
- inline SQRESULT arrayappend(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_arrayappend(sqvm, stackpos);
- }
+ inline SQRESULT arrayappend(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_arrayappend(sqvm, stackpos); }
- inline SQRESULT newtable(HSquirrelVM* sqvm)
- {
- return __sq_newtable(sqvm);
- }
+ inline SQRESULT newtable(HSquirrelVM* sqvm) { return __sq_newtable(sqvm); }
- inline SQRESULT newslot(HSquirrelVM* sqvm, SQInteger idx, SQBool bStatic)
- {
- return __sq_newslot(sqvm, idx, bStatic);
- }
+ inline SQRESULT newslot(HSquirrelVM* sqvm, SQInteger idx, SQBool bStatic) { return __sq_newslot(sqvm, idx, bStatic); }
- inline void pushroottable(HSquirrelVM* sqvm)
- {
- __sq_pushroottable(sqvm);
- }
+ inline void pushroottable(HSquirrelVM* sqvm) { __sq_pushroottable(sqvm); }
- inline void pushstring(HSquirrelVM* sqvm, const SQChar* sVal, int length = -1)
- {
- __sq_pushstring(sqvm, sVal, length);
- }
+ inline void pushstring(HSquirrelVM* sqvm, const SQChar* sVal, int length = -1) { __sq_pushstring(sqvm, sVal, length); }
- inline void pushinteger(HSquirrelVM* sqvm, const SQInteger iVal)
- {
- __sq_pushinteger(sqvm, iVal);
- }
+ inline void pushinteger(HSquirrelVM* sqvm, const SQInteger iVal) { __sq_pushinteger(sqvm, iVal); }
- inline void pushfloat(HSquirrelVM* sqvm, const SQFloat flVal)
- {
- __sq_pushfloat(sqvm, flVal);
- }
+ inline void pushfloat(HSquirrelVM* sqvm, const SQFloat flVal) { __sq_pushfloat(sqvm, flVal); }
- inline void pushbool(HSquirrelVM* sqvm, const SQBool bVal)
- {
- __sq_pushbool(sqvm, bVal);
- }
+ inline void pushbool(HSquirrelVM* sqvm, const SQBool bVal) { __sq_pushbool(sqvm, bVal); }
- inline void pushasset(HSquirrelVM* sqvm, const SQChar* sVal, int length = -1)
- {
- __sq_pushasset(sqvm, sVal, length);
- }
+ inline void pushasset(HSquirrelVM* sqvm, const SQChar* sVal, int length = -1) { __sq_pushasset(sqvm, sVal, length); }
- inline void pushvector(HSquirrelVM* sqvm, const Vector3 pVal)
- {
- __sq_pushvector(sqvm, (float*)&pVal);
- }
+ inline void pushvector(HSquirrelVM* sqvm, const Vector3 pVal) { __sq_pushvector(sqvm, (float*)&pVal); }
- inline void pushobject(HSquirrelVM* sqvm, SQObject* obj)
- {
- __sq_pushobject(sqvm, obj);
- }
+ inline void pushobject(HSquirrelVM* sqvm, SQObject* obj) { __sq_pushobject(sqvm, obj); }
- inline const SQChar* getstring(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_getstring(sqvm, stackpos);
- }
+ inline const SQChar* getstring(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_getstring(sqvm, stackpos); }
- inline SQInteger getinteger(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_getinteger(sqvm, stackpos);
- }
+ inline SQInteger getinteger(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_getinteger(sqvm, stackpos); }
- inline SQFloat getfloat(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_getfloat(sqvm, stackpos);
- }
+ inline SQFloat getfloat(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_getfloat(sqvm, stackpos); }
- inline SQBool getbool(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_getbool(sqvm, stackpos);
- }
+ inline SQBool getbool(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_getbool(sqvm, stackpos); }
- inline SQRESULT get(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return __sq_get(sqvm, stackpos);
- }
+ inline SQRESULT get(HSquirrelVM* sqvm, const SQInteger stackpos) { return __sq_get(sqvm, stackpos); }
- inline Vector3 getvector(HSquirrelVM* sqvm, const SQInteger stackpos)
- {
- return *(Vector3*)__sq_getvector(sqvm, stackpos);
- }
+ inline Vector3 getvector(HSquirrelVM* sqvm, const SQInteger stackpos) { return *(Vector3*)__sq_getvector(sqvm, stackpos); }
inline int sq_getfunction(HSquirrelVM* sqvm, const char* name, SQObject* returnObj, const char* signature)
{
@@ -291,10 +228,7 @@ public:
return __sq_setuserdatatypeid(sqvm, stackpos, typeId);
}
- template <typename T> inline SQBool getthisentity(HSquirrelVM* sqvm, T* ppEntity)
- {
- return __sq_getthisentity(sqvm, (void**)ppEntity);
- }
+ template <typename T> inline SQBool getthisentity(HSquirrelVM* sqvm, T* ppEntity) { return __sq_getthisentity(sqvm, (void**)ppEntity); }
template <typename T> inline T* getentity(HSquirrelVM* sqvm, SQInteger iStackPos)
{
@@ -305,15 +239,9 @@ public:
return (T*)__sq_getentityfrominstance(m_pSQVM, &obj, __sq_GetEntityConstant_CBaseEntity());
}
- inline SQRESULT pushnewstructinstance(HSquirrelVM* sqvm, const int fieldCount)
- {
- return __sq_pushnewstructinstance(sqvm, fieldCount);
- }
+ inline SQRESULT pushnewstructinstance(HSquirrelVM* sqvm, const int fieldCount) { return __sq_pushnewstructinstance(sqvm, fieldCount); }
- inline SQRESULT sealstructslot(HSquirrelVM* sqvm, const int fieldIndex)
- {
- return __sq_sealstructslot(sqvm, fieldIndex);
- }
+ inline SQRESULT sealstructslot(HSquirrelVM* sqvm, const int fieldIndex) { return __sq_sealstructslot(sqvm, fieldIndex); }
#pragma endregion
};
@@ -405,10 +333,7 @@ public:
#pragma endregion
public:
- SquirrelManager()
- {
- m_pSQVM = nullptr;
- }
+ SquirrelManager() { m_pSQVM = nullptr; }
void VMCreated(CSquirrelVM* newSqvm);
void VMDestroyed();