|
|
@@ -114,6 +114,11 @@ static void ConstructIntRectInit(int left, int top, int right, int bottom, IntRe
|
|
|
new(ptr) IntRect(left, top, right, bottom);
|
|
|
}
|
|
|
|
|
|
+static void ConstructIntRectMinMax(const IntVector2& min, const IntVector2& max, IntRect* ptr)
|
|
|
+{
|
|
|
+ new(ptr) IntRect(min, max);
|
|
|
+}
|
|
|
+
|
|
|
static void ConstructIntRectArrayInit(CScriptArray* data, IntRect* ptr)
|
|
|
{
|
|
|
new(ptr) IntRect((static_cast<int*>(data->At(0))));
|
|
|
@@ -130,6 +135,7 @@ static void RegisterIntRect(asIScriptEngine* engine)
|
|
|
engine->RegisterObjectBehaviour("IntRect", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructIntRect), asCALL_CDECL_OBJLAST);
|
|
|
engine->RegisterObjectBehaviour("IntRect", asBEHAVE_CONSTRUCT, "void f(const IntRect&in)", asFUNCTION(ConstructIntRectCopy), asCALL_CDECL_OBJLAST);
|
|
|
engine->RegisterObjectBehaviour("IntRect", asBEHAVE_CONSTRUCT, "void f(int, int, int, int)", asFUNCTION(ConstructIntRectInit), asCALL_CDECL_OBJLAST);
|
|
|
+ engine->RegisterObjectBehaviour("IntRect", asBEHAVE_CONSTRUCT, "void f(const IntVector2&in, const IntVector2&in)", asFUNCTION(ConstructIntRectMinMax), asCALL_CDECL_OBJLAST);
|
|
|
engine->RegisterObjectBehaviour("IntRect", asBEHAVE_CONSTRUCT, "void f(int[]&)", asFUNCTION(ConstructIntRectArrayInit), asCALL_CDECL_OBJLAST);
|
|
|
engine->RegisterObjectMethod("IntRect", "Intersection IsInside(const IntVector2&in) const", asMETHOD(IntRect, IsInside), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("IntRect", "int[]& get_data() const", asFUNCTION(IntRectData), asCALL_CDECL_OBJLAST);
|
|
|
@@ -138,6 +144,8 @@ static void RegisterIntRect(asIScriptEngine* engine)
|
|
|
engine->RegisterObjectMethod("IntRect", "IntVector2 get_size() const", asMETHOD(IntRect, Size), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("IntRect", "int get_width() const", asMETHOD(IntRect, Width), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("IntRect", "int get_height() const", asMETHOD(IntRect, Height), asCALL_THISCALL);
|
|
|
+ engine->RegisterObjectMethod("IntRect", "int Merge(const IntRect&in)", asMETHOD(IntRect, Merge), asCALL_THISCALL);
|
|
|
+ engine->RegisterObjectMethod("IntRect", "int Clip(const IntRect&in)", asMETHOD(IntRect, Merge), asCALL_THISCALL);
|
|
|
engine->RegisterObjectProperty("IntRect", "int left", offsetof(IntRect, left_));
|
|
|
engine->RegisterObjectProperty("IntRect", "int top", offsetof(IntRect, top_));
|
|
|
engine->RegisterObjectProperty("IntRect", "int right", offsetof(IntRect, right_));
|