Sdk/Binding: Bind Rect
As requested Former-commit-id: 97fcb06de0505341f39418147c57d240e4210159
This commit is contained in:
@@ -102,6 +102,36 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Rectd* rect, TypeTag<Rectd>)
|
||||
{
|
||||
instance.CheckType(index, LuaType_Table);
|
||||
|
||||
rect->x = instance.CheckField<double>("x", index);
|
||||
rect->y = instance.CheckField<double>("y", index);
|
||||
rect->width = instance.CheckField<double>("width", index);
|
||||
rect->height = instance.CheckField<double>("height", index);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Rectf* rect, TypeTag<Rectf>)
|
||||
{
|
||||
Rectd rectDouble;
|
||||
unsigned int ret = LuaImplQueryArg(instance, index, &rectDouble, TypeTag<Rectd>());
|
||||
|
||||
rect->Set(rectDouble);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Rectui* rect, TypeTag<Rectui>)
|
||||
{
|
||||
Rectd rectDouble;
|
||||
unsigned int ret = LuaImplQueryArg(instance, index, &rectDouble, TypeTag<Rectd>());
|
||||
|
||||
rect->Set(rectDouble);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Quaterniond* quat, TypeTag<Quaterniond>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
@@ -341,6 +371,24 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Rectd&& val, TypeTag<Rectf>)
|
||||
{
|
||||
instance.PushInstance<Rectd>("Rect", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Rectf&& val, TypeTag<Rectf>)
|
||||
{
|
||||
instance.PushInstance<Rectd>("Rect", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Rectui&& val, TypeTag<Rectui>)
|
||||
{
|
||||
instance.PushInstance<Rectd>("Rect", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Vector2d&& val, TypeTag<Vector2d>)
|
||||
{
|
||||
instance.PushInstance<Vector2d>("Vector2", val);
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Ndk
|
||||
// Math
|
||||
Nz::LuaClass<Nz::EulerAnglesd> eulerAnglesClass;
|
||||
Nz::LuaClass<Nz::Quaterniond> quaternionClass;
|
||||
Nz::LuaClass<Nz::Rectd> rectClass;
|
||||
Nz::LuaClass<Nz::Vector2d> vector2dClass;
|
||||
Nz::LuaClass<Nz::Vector3d> vector3dClass;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user