aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/squirrel.h
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.h')
-rw-r--r--NorthstarDedicatedTest/squirrel.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/squirrel.h b/NorthstarDedicatedTest/squirrel.h
index d6dfcc57..cbdf0c8c 100644
--- a/NorthstarDedicatedTest/squirrel.h
+++ b/NorthstarDedicatedTest/squirrel.h
@@ -18,6 +18,20 @@ const SQRESULT SQRESULT_NOTNULL = 1;
typedef SQInteger (*SQFunction)(void* sqvm);
+enum SQReturnTypeEnum
+{
+ SqReturnFloat = 0x1,
+ SqReturnVector = 0x3,
+ SqReturnInteger = 0x5,
+ SqReturnBoolean = 0x6,
+ SqReturnEntity = 0xD,
+ SqReturnString = 0x21,
+ SqReturnDefault = 0x20,
+ SqReturnArrays = 0x25,
+ SqReturnAsset = 0x28,
+ SqReturnTable = 0x26,
+};
+
struct CompileBufferState
{
const SQChar* buffer;
@@ -43,7 +57,7 @@ struct SQFuncRegistration
__int32 devLevel;
const char* shortNameMaybe;
__int32 unknown2;
- __int32 returnTypeEnum;
+ SQReturnTypeEnum returnTypeEnum;
__int32* externalBufferPointer;
__int64 externalBufferSize;
__int64 unknown3;
@@ -53,10 +67,12 @@ struct SQFuncRegistration
SQFuncRegistration()
{
memset(this, 0, sizeof(SQFuncRegistration));
- this->returnTypeEnum = 32;
+ this->returnTypeEnum = SqReturnDefault;
}
};
+SQReturnTypeEnum GetReturnTypeEnumFromString(const char* returnTypeString);
+
// core sqvm funcs
typedef SQRESULT (*sq_compilebufferType)(void* sqvm, CompileBufferState* compileBuffer, const char* file, int a1, ScriptContext a2);
extern sq_compilebufferType ClientSq_compilebuffer;
@@ -105,6 +121,10 @@ typedef SQInteger (*sq_pusherrorType)(void* sqvm, const SQChar* error);
extern sq_pusherrorType ClientSq_pusherror;
extern sq_pusherrorType ServerSq_pusherror;
+typedef SQRESULT (*sq_pushAssetType)(void* sqvm, const SQChar* assetName, SQInteger nameLength);
+extern sq_pushAssetType ServerSq_pushAsset;
+extern sq_pushAssetType ClientSq_pushAsset;
+
// sq stack get funcs
typedef const SQChar* (*sq_getstringType)(void* sqvm, SQInteger stackpos);
extern sq_getstringType ClientSq_getstring;
@@ -277,6 +297,7 @@ template <ScriptContext context> class SquirrelManager
reg->returnTypeString = new char[returnType.size() + 1];
strcpy((char*)reg->returnTypeString, returnType.c_str());
+ reg->returnTypeEnum = GetReturnTypeEnumFromString(returnType.c_str());
reg->argTypes = new char[argTypes.size() + 1];
strcpy((char*)reg->argTypes, argTypes.c_str());