aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel.h
diff options
context:
space:
mode:
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);