aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel.h
diff options
context:
space:
mode:
authorMaya <malte.hoermeyer@web.de>2022-11-13 04:01:14 +0100
committerGitHub <noreply@github.com>2022-11-13 03:01:14 +0000
commit23fda0b842560d2f3cf64ecf9a57d5ad2861e488 (patch)
tree9527c91bd744fb0562963e43e212c1bc5536847d /NorthstarDLL/squirrel.h
parentd237401bb97c1fa2d6ee87220d49e4b3343e7201 (diff)
downloadNorthstarLauncher-23fda0b842560d2f3cf64ecf9a57d5ad2861e488.tar.gz
NorthstarLauncher-23fda0b842560d2f3cf64ecf9a57d5ad2861e488.zip
Squirrel functions auto bind (#299)
* Add defines to auto add squirrel funcs it brokey * Make it Work changed all squirrel function definitions to this system * Add defines to auto add squirrel funcs it brokey Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com> * Make it Work changed all squirrel function definitions to this system Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com> * Formatting * Good old Formatting commit * HelloGecko * Formatting Finalv2ForRealThisTime * idk anymore * i hate formatting * Rename some * Rename macro * Change function names to more human-readable * Revert to using old ScriptContext definition * Formatting Co-authored-by: RoyalBlue1 <realEmail@veryRealURL.com> Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com> Co-authored-by: Emma Miler <emma.pi@protonmail.com> Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/squirrel.h')
-rw-r--r--NorthstarDLL/squirrel.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/NorthstarDLL/squirrel.h b/NorthstarDLL/squirrel.h
index a157b1af..6142b157 100644
--- a/NorthstarDLL/squirrel.h
+++ b/NorthstarDLL/squirrel.h
@@ -1,6 +1,7 @@
#pragma once
#include "squirreldatatypes.h"
+#include "squirrelautobind.h"
#include "vector.h"
// stolen from ttf2sdk: sqvm types
@@ -82,6 +83,26 @@ enum class ScriptContext : int
UI,
};
+static constexpr int operator&(ScriptContext first, ScriptContext second)
+{
+ return first == second;
+}
+
+static constexpr int operator&(int first, ScriptContext second)
+{
+ return first & (1 << static_cast<int>(second));
+}
+
+static constexpr int operator|(ScriptContext first, ScriptContext second)
+{
+ return (1 << static_cast<int>(first)) + (1 << static_cast<int>(second));
+}
+
+static constexpr int operator|(int first, ScriptContext second)
+{
+ return first + (1 << static_cast<int>(second));
+}
+
const char* GetContextName(ScriptContext context);
const char* GetContextName_Short(ScriptContext context);
eSQReturnType SQReturnTypeFromString(const char* pReturnType);