diff --git a/PyGLM.cpp b/PyGLM.cpp index 7f78982..cd1e0f0 100644 --- a/PyGLM.cpp +++ b/PyGLM.cpp @@ -22,11 +22,37 @@ // PyGLM FUNCTIONS #include "PyGLM/functions/all.h" -//static PyObject* -//test(PyObject*, PyObject* arg) { -//} -//#define HAS_TEST -//#define TEST_FUNC_TYPE METH_O +static PyObject* +test(PyObject*, PyObject* arg) { + funcstart: + if (Is_PyGLM_Object(arg)) { + GET_PyGLM_ARG_TYPE(arg); + GET_PyGLM_ARG_TYPE_OFFSET(arg); + + ptrdiff_t offset = GET_PyGLMTypeObjectArrayOffsetOfType(argType->subtype); + + if (offset == PyGLMTypeObjectArrayOffsetVec<3, float>()) { + return pack(PyGLM_VecOrMVec_Get(3, float, arg)); + } + + return PyLong_FromSsize_t(offset); + + //switch (argTypeOffset) { + //case PyGLMTypeObjectArrayOffsetMat<2, 4, float>(): + // return PyUnicode_FromFormat("Argument is mat2x4"); + //case PyGLMTypeObjectArrayOffsetMat<4, 3, double>(): + // return PyUnicode_FromFormat("Argument is dmat4x3"); + //} + } + PyGLM_PTI_Init0(arg, PyGLM_DT_ALL | PyGLM_T_ALL | PyGLM_SHAPE_ALL); + if (PyGLM_PTI_IsNone(0)) { + Py_RETURN_FALSE; + } + arg = PTI0.asPyObject(); + goto funcstart; +} +#define HAS_TEST +#define TEST_FUNC_TYPE METH_O static PyMethodDef glmmethods[] = { // DETAIL @@ -265,6 +291,24 @@ extern "C" { #endif Py_DECREF(ctypes_module); + // add subtypes to mvec PyGLMTypeObjects + reinterpret_cast(&hdmvec2Type)->subtype = &hdvec2Type; + reinterpret_cast(&hdmvec3Type)->subtype = &hdvec3Type; + reinterpret_cast(&hdmvec4Type)->subtype = &hdvec4Type; + + reinterpret_cast(&hfmvec2Type)->subtype = &hfvec2Type; + reinterpret_cast(&hfmvec3Type)->subtype = &hfvec3Type; + reinterpret_cast(&hfmvec4Type)->subtype = &hfvec4Type; + + reinterpret_cast(&himvec2Type)->subtype = &hivec2Type; + reinterpret_cast(&himvec3Type)->subtype = &hivec3Type; + reinterpret_cast(&himvec4Type)->subtype = &hivec4Type; + + reinterpret_cast(&humvec2Type)->subtype = &huvec2Type; + reinterpret_cast(&humvec3Type)->subtype = &huvec3Type; + reinterpret_cast(&humvec4Type)->subtype = &huvec4Type; + + PyObject* module_glm; if (PyType_Ready(&hfvec1Type) < 0 || PyType_Ready(&hfvec1IterType) < 0 diff --git a/PyGLM/functions/detail/func_common.h b/PyGLM/functions/detail/func_common.h index 2069bb5..ea22c76 100644 --- a/PyGLM/functions/detail/func_common.h +++ b/PyGLM/functions/detail/func_common.h @@ -26,82 +26,24 @@ PyDoc_STRVAR(sign_docstr, ); static PyObject* sign_(PyObject*, PyObject* arg) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_SIGN_FUNC_TEMPLATE1(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::sign(PyGLM_Vec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsu, PyGLM_SIGN_FUNC_TEMPLATE1) + +#define PyGLM_SIGN_FUNC_TEMPLATE2(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::sign(PyGLM_MVec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fFi, PyGLM_SIGN_FUNC_TEMPLATE2) + } + if (PyGLM_Number_Check(arg)) { return pack(glm::sign(PyGLM_Number_FromPyObject(arg))); } - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8); - if (PyGLM_Vec_PTI_Check0(1, float, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, float, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, double, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, int16, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, int16, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, int8, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(1, int8, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, float, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, double, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int16, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, int16, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int8, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(2, int8, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, float, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, double, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int16, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, int16, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int8, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(3, int8, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, float, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, double, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int16, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, int16, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int8, arg)) { - return pack(glm::sign(PyGLM_Vec_PTI_Get0(4, int8, arg))); - } + PyGLM_TYPEERROR_O("invalid argument type for sign(): ", arg); return NULL; } @@ -199,11 +141,11 @@ template static T apply_min(std::vector& items) { T minimum = items[0]; - for (T item : items) { - if (item == minimum) { + for (size_t i = 1; i < items.size(); i++) { + if (items[i] == minimum) { continue; } - minimum = glm::min(item, minimum); + minimum = glm::min(static_cast(items[i]), minimum); } return minimum; } @@ -343,521 +285,92 @@ min_(PyObject*, PyObject* args) { return NULL; } if (arg3 == NULL) { + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg1); + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_MIN_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::min(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_MIN_FUNC_TEMPLATE); +#undef PyGLM_MIN_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_MIN_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::min(PyGLM_Vec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_MIN_FUNC_TEMPLATE); +#undef PyGLM_MIN_FUNC_TEMPLATE + +#define PyGLM_MIN_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::min(PyGLM_MVec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fFiI, PyGLM_MIN_FUNC_TEMPLATE); +#undef PyGLM_MIN_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::min(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, bool, arg1), PyGLM_Vec_PTI_Get1(1, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, bool, arg1), PyGLM_Vec_PTI_Get1(2, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, bool, arg1), PyGLM_Vec_PTI_Get1(3, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, bool, arg1), PyGLM_Vec_PTI_Get1(4, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } } else { if (arg4 == NULL) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_MIN_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::min(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_MIN_FUNC_TEMPLATE); +#undef PyGLM_MIN_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { return pack(glm::min(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && PyGLM_Vec_PTI_Check2(1, int, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2), PyGLM_Vec_PTI_Get2(1, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(1, glm::uint, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2), PyGLM_Vec_PTI_Get2(1, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2), PyGLM_Vec_PTI_Get2(1, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2), PyGLM_Vec_PTI_Get2(1, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2), PyGLM_Vec_PTI_Get2(1, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2), PyGLM_Vec_PTI_Get2(1, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2), PyGLM_Vec_PTI_Get2(1, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2), PyGLM_Vec_PTI_Get2(1, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && PyGLM_Vec_PTI_Check2(2, int, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2), PyGLM_Vec_PTI_Get2(2, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(2, glm::uint, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2), PyGLM_Vec_PTI_Get2(2, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2), PyGLM_Vec_PTI_Get2(2, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2), PyGLM_Vec_PTI_Get2(2, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2), PyGLM_Vec_PTI_Get2(2, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2), PyGLM_Vec_PTI_Get2(2, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2), PyGLM_Vec_PTI_Get2(2, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2), PyGLM_Vec_PTI_Get2(2, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && PyGLM_Vec_PTI_Check2(3, int, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2), PyGLM_Vec_PTI_Get2(3, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(3, glm::uint, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2), PyGLM_Vec_PTI_Get2(3, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2), PyGLM_Vec_PTI_Get2(3, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2), PyGLM_Vec_PTI_Get2(3, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2), PyGLM_Vec_PTI_Get2(3, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2), PyGLM_Vec_PTI_Get2(3, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2), PyGLM_Vec_PTI_Get2(3, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2), PyGLM_Vec_PTI_Get2(3, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && PyGLM_Vec_PTI_Check2(4, int, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2), PyGLM_Vec_PTI_Get2(4, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(4, glm::uint, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2), PyGLM_Vec_PTI_Get2(4, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2), PyGLM_Vec_PTI_Get2(4, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u64, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2), PyGLM_Vec_PTI_Get2(4, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2), PyGLM_Vec_PTI_Get2(4, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u16, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2), PyGLM_Vec_PTI_Get2(4, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2), PyGLM_Vec_PTI_Get2(4, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u8, arg3)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2), PyGLM_Vec_PTI_Get2(4, glm::u8, arg3))); - } } else { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3) && arg1Subtype == GET_PyGLM_ArgSubtype(arg4)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_MIN_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::min(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3), PyGLM_VecOrMVec_Get(L, T, arg4))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_MIN_FUNC_TEMPLATE); +#undef PyGLM_MIN_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg4)) { return pack(glm::min(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3), PyGLM_Number_FromPyObject(arg4))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init3(arg4, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3) && PyGLM_Vec_PTI_Check3(1, float, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3), PyGLM_Vec_PTI_Get3(1, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3) && PyGLM_Vec_PTI_Check3(1, double, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3), PyGLM_Vec_PTI_Get3(1, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && PyGLM_Vec_PTI_Check2(1, int, arg3) && PyGLM_Vec_PTI_Check3(1, int, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2), PyGLM_Vec_PTI_Get2(1, int, arg3), PyGLM_Vec_PTI_Get3(1, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(1, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(1, glm::uint, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2), PyGLM_Vec_PTI_Get2(1, glm::uint, arg3), PyGLM_Vec_PTI_Get3(1, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2), PyGLM_Vec_PTI_Get2(1, glm::i64, arg3), PyGLM_Vec_PTI_Get3(1, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2), PyGLM_Vec_PTI_Get2(1, glm::u64, arg3), PyGLM_Vec_PTI_Get3(1, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2), PyGLM_Vec_PTI_Get2(1, glm::i16, arg3), PyGLM_Vec_PTI_Get3(1, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2), PyGLM_Vec_PTI_Get2(1, glm::u16, arg3), PyGLM_Vec_PTI_Get3(1, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2), PyGLM_Vec_PTI_Get2(1, glm::i8, arg3), PyGLM_Vec_PTI_Get3(1, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2), PyGLM_Vec_PTI_Get2(1, glm::u8, arg3), PyGLM_Vec_PTI_Get3(1, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3) && PyGLM_Vec_PTI_Check3(2, float, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3), PyGLM_Vec_PTI_Get3(2, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3) && PyGLM_Vec_PTI_Check3(2, double, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3), PyGLM_Vec_PTI_Get3(2, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && PyGLM_Vec_PTI_Check2(2, int, arg3) && PyGLM_Vec_PTI_Check3(2, int, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2), PyGLM_Vec_PTI_Get2(2, int, arg3), PyGLM_Vec_PTI_Get3(2, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(2, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(2, glm::uint, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2), PyGLM_Vec_PTI_Get2(2, glm::uint, arg3), PyGLM_Vec_PTI_Get3(2, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2), PyGLM_Vec_PTI_Get2(2, glm::i64, arg3), PyGLM_Vec_PTI_Get3(2, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2), PyGLM_Vec_PTI_Get2(2, glm::u64, arg3), PyGLM_Vec_PTI_Get3(2, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2), PyGLM_Vec_PTI_Get2(2, glm::i16, arg3), PyGLM_Vec_PTI_Get3(2, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2), PyGLM_Vec_PTI_Get2(2, glm::u16, arg3), PyGLM_Vec_PTI_Get3(2, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2), PyGLM_Vec_PTI_Get2(2, glm::i8, arg3), PyGLM_Vec_PTI_Get3(2, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2), PyGLM_Vec_PTI_Get2(2, glm::u8, arg3), PyGLM_Vec_PTI_Get3(2, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3) && PyGLM_Vec_PTI_Check3(3, float, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3), PyGLM_Vec_PTI_Get3(3, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3) && PyGLM_Vec_PTI_Check3(3, double, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3), PyGLM_Vec_PTI_Get3(3, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && PyGLM_Vec_PTI_Check2(3, int, arg3) && PyGLM_Vec_PTI_Check3(3, int, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2), PyGLM_Vec_PTI_Get2(3, int, arg3), PyGLM_Vec_PTI_Get3(3, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(3, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(3, glm::uint, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2), PyGLM_Vec_PTI_Get2(3, glm::uint, arg3), PyGLM_Vec_PTI_Get3(3, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2), PyGLM_Vec_PTI_Get2(3, glm::i64, arg3), PyGLM_Vec_PTI_Get3(3, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2), PyGLM_Vec_PTI_Get2(3, glm::u64, arg3), PyGLM_Vec_PTI_Get3(3, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2), PyGLM_Vec_PTI_Get2(3, glm::i16, arg3), PyGLM_Vec_PTI_Get3(3, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2), PyGLM_Vec_PTI_Get2(3, glm::u16, arg3), PyGLM_Vec_PTI_Get3(3, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2), PyGLM_Vec_PTI_Get2(3, glm::i8, arg3), PyGLM_Vec_PTI_Get3(3, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2), PyGLM_Vec_PTI_Get2(3, glm::u8, arg3), PyGLM_Vec_PTI_Get3(3, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && PyGLM_Vec_PTI_Check2(4, int, arg3) && PyGLM_Vec_PTI_Check3(4, int, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2), PyGLM_Vec_PTI_Get2(4, int, arg3), PyGLM_Vec_PTI_Get3(4, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(4, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(4, glm::uint, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2), PyGLM_Vec_PTI_Get2(4, glm::uint, arg3), PyGLM_Vec_PTI_Get3(4, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2), PyGLM_Vec_PTI_Get2(4, glm::i64, arg3), PyGLM_Vec_PTI_Get3(4, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u64, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2), PyGLM_Vec_PTI_Get2(4, glm::u64, arg3), PyGLM_Vec_PTI_Get3(4, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2), PyGLM_Vec_PTI_Get2(4, glm::i16, arg3), PyGLM_Vec_PTI_Get3(4, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u16, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2), PyGLM_Vec_PTI_Get2(4, glm::u16, arg3), PyGLM_Vec_PTI_Get3(4, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2), PyGLM_Vec_PTI_Get2(4, glm::i8, arg3), PyGLM_Vec_PTI_Get3(4, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u8, arg4)) { - return pack(glm::min(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2), PyGLM_Vec_PTI_Get2(4, glm::u8, arg3), PyGLM_Vec_PTI_Get3(4, glm::u8, arg4))); - } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for min()"); @@ -1030,521 +543,92 @@ max_(PyObject*, PyObject* args) { return NULL; } if (arg3 == NULL) { + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg1); + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_MAX_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::max(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_MAX_FUNC_TEMPLATE); +#undef PyGLM_MAX_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_MAX_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::max(PyGLM_Vec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_MAX_FUNC_TEMPLATE); +#undef PyGLM_MAX_FUNC_TEMPLATE + +#define PyGLM_MAX_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::max(PyGLM_MVec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fFiI, PyGLM_MAX_FUNC_TEMPLATE); +#undef PyGLM_MAX_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::max(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, bool, arg1), PyGLM_Vec_PTI_Get1(1, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2))); + } + else { + if (arg4 == NULL) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_MAX_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::max(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_MAX_FUNC_TEMPLATE); +#undef PyGLM_MAX_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { + return pack(glm::max(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); + } } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, bool, arg1), PyGLM_Vec_PTI_Get1(2, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, bool, arg1), PyGLM_Vec_PTI_Get1(3, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, bool, arg1), PyGLM_Vec_PTI_Get1(4, bool, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2))); - } - } - else { - if (arg4 == NULL) { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::max(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && PyGLM_Vec_PTI_Check2(1, int, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2), PyGLM_Vec_PTI_Get2(1, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(1, glm::uint, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2), PyGLM_Vec_PTI_Get2(1, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2), PyGLM_Vec_PTI_Get2(1, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2), PyGLM_Vec_PTI_Get2(1, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2), PyGLM_Vec_PTI_Get2(1, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2), PyGLM_Vec_PTI_Get2(1, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2), PyGLM_Vec_PTI_Get2(1, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2), PyGLM_Vec_PTI_Get2(1, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && PyGLM_Vec_PTI_Check2(2, int, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2), PyGLM_Vec_PTI_Get2(2, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(2, glm::uint, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2), PyGLM_Vec_PTI_Get2(2, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2), PyGLM_Vec_PTI_Get2(2, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2), PyGLM_Vec_PTI_Get2(2, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2), PyGLM_Vec_PTI_Get2(2, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2), PyGLM_Vec_PTI_Get2(2, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2), PyGLM_Vec_PTI_Get2(2, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2), PyGLM_Vec_PTI_Get2(2, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && PyGLM_Vec_PTI_Check2(3, int, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2), PyGLM_Vec_PTI_Get2(3, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(3, glm::uint, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2), PyGLM_Vec_PTI_Get2(3, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2), PyGLM_Vec_PTI_Get2(3, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2), PyGLM_Vec_PTI_Get2(3, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2), PyGLM_Vec_PTI_Get2(3, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2), PyGLM_Vec_PTI_Get2(3, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2), PyGLM_Vec_PTI_Get2(3, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2), PyGLM_Vec_PTI_Get2(3, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && PyGLM_Vec_PTI_Check2(4, int, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2), PyGLM_Vec_PTI_Get2(4, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(4, glm::uint, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2), PyGLM_Vec_PTI_Get2(4, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2), PyGLM_Vec_PTI_Get2(4, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u64, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2), PyGLM_Vec_PTI_Get2(4, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2), PyGLM_Vec_PTI_Get2(4, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u16, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2), PyGLM_Vec_PTI_Get2(4, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2), PyGLM_Vec_PTI_Get2(4, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u8, arg3)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2), PyGLM_Vec_PTI_Get2(4, glm::u8, arg3))); - } - } - else { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg4)) { - return pack(glm::max(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3), PyGLM_Number_FromPyObject(arg4))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init3(arg4, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3) && PyGLM_Vec_PTI_Check3(1, float, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3), PyGLM_Vec_PTI_Get3(1, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3) && PyGLM_Vec_PTI_Check3(1, double, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3), PyGLM_Vec_PTI_Get3(1, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && PyGLM_Vec_PTI_Check2(1, int, arg3) && PyGLM_Vec_PTI_Check3(1, int, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2), PyGLM_Vec_PTI_Get2(1, int, arg3), PyGLM_Vec_PTI_Get3(1, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(1, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(1, glm::uint, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2), PyGLM_Vec_PTI_Get2(1, glm::uint, arg3), PyGLM_Vec_PTI_Get3(1, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2), PyGLM_Vec_PTI_Get2(1, glm::i64, arg3), PyGLM_Vec_PTI_Get3(1, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2), PyGLM_Vec_PTI_Get2(1, glm::u64, arg3), PyGLM_Vec_PTI_Get3(1, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2), PyGLM_Vec_PTI_Get2(1, glm::i16, arg3), PyGLM_Vec_PTI_Get3(1, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2), PyGLM_Vec_PTI_Get2(1, glm::u16, arg3), PyGLM_Vec_PTI_Get3(1, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(1, glm::i8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2), PyGLM_Vec_PTI_Get2(1, glm::i8, arg3), PyGLM_Vec_PTI_Get3(1, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(1, glm::u8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2), PyGLM_Vec_PTI_Get2(1, glm::u8, arg3), PyGLM_Vec_PTI_Get3(1, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3) && PyGLM_Vec_PTI_Check3(2, float, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3), PyGLM_Vec_PTI_Get3(2, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3) && PyGLM_Vec_PTI_Check3(2, double, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3), PyGLM_Vec_PTI_Get3(2, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && PyGLM_Vec_PTI_Check2(2, int, arg3) && PyGLM_Vec_PTI_Check3(2, int, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2), PyGLM_Vec_PTI_Get2(2, int, arg3), PyGLM_Vec_PTI_Get3(2, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(2, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(2, glm::uint, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2), PyGLM_Vec_PTI_Get2(2, glm::uint, arg3), PyGLM_Vec_PTI_Get3(2, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2), PyGLM_Vec_PTI_Get2(2, glm::i64, arg3), PyGLM_Vec_PTI_Get3(2, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2), PyGLM_Vec_PTI_Get2(2, glm::u64, arg3), PyGLM_Vec_PTI_Get3(2, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2), PyGLM_Vec_PTI_Get2(2, glm::i16, arg3), PyGLM_Vec_PTI_Get3(2, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2), PyGLM_Vec_PTI_Get2(2, glm::u16, arg3), PyGLM_Vec_PTI_Get3(2, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(2, glm::i8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2), PyGLM_Vec_PTI_Get2(2, glm::i8, arg3), PyGLM_Vec_PTI_Get3(2, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(2, glm::u8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2), PyGLM_Vec_PTI_Get2(2, glm::u8, arg3), PyGLM_Vec_PTI_Get3(2, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3) && PyGLM_Vec_PTI_Check3(3, float, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3), PyGLM_Vec_PTI_Get3(3, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3) && PyGLM_Vec_PTI_Check3(3, double, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3), PyGLM_Vec_PTI_Get3(3, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && PyGLM_Vec_PTI_Check2(3, int, arg3) && PyGLM_Vec_PTI_Check3(3, int, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2), PyGLM_Vec_PTI_Get2(3, int, arg3), PyGLM_Vec_PTI_Get3(3, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(3, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(3, glm::uint, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2), PyGLM_Vec_PTI_Get2(3, glm::uint, arg3), PyGLM_Vec_PTI_Get3(3, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2), PyGLM_Vec_PTI_Get2(3, glm::i64, arg3), PyGLM_Vec_PTI_Get3(3, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2), PyGLM_Vec_PTI_Get2(3, glm::u64, arg3), PyGLM_Vec_PTI_Get3(3, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2), PyGLM_Vec_PTI_Get2(3, glm::i16, arg3), PyGLM_Vec_PTI_Get3(3, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2), PyGLM_Vec_PTI_Get2(3, glm::u16, arg3), PyGLM_Vec_PTI_Get3(3, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(3, glm::i8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2), PyGLM_Vec_PTI_Get2(3, glm::i8, arg3), PyGLM_Vec_PTI_Get3(3, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(3, glm::u8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2), PyGLM_Vec_PTI_Get2(3, glm::u8, arg3), PyGLM_Vec_PTI_Get3(3, glm::u8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && PyGLM_Vec_PTI_Check2(4, int, arg3) && PyGLM_Vec_PTI_Check3(4, int, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2), PyGLM_Vec_PTI_Get2(4, int, arg3), PyGLM_Vec_PTI_Get3(4, int, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(4, glm::uint, arg3) && PyGLM_Vec_PTI_Check3(4, glm::uint, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2), PyGLM_Vec_PTI_Get2(4, glm::uint, arg3), PyGLM_Vec_PTI_Get3(4, glm::uint, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i64, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2), PyGLM_Vec_PTI_Get2(4, glm::i64, arg3), PyGLM_Vec_PTI_Get3(4, glm::i64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u64, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u64, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2), PyGLM_Vec_PTI_Get2(4, glm::u64, arg3), PyGLM_Vec_PTI_Get3(4, glm::u64, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i16, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2), PyGLM_Vec_PTI_Get2(4, glm::i16, arg3), PyGLM_Vec_PTI_Get3(4, glm::i16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u16, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u16, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2), PyGLM_Vec_PTI_Get2(4, glm::u16, arg3), PyGLM_Vec_PTI_Get3(4, glm::u16, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i8, arg3) && PyGLM_Vec_PTI_Check3(4, glm::i8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2), PyGLM_Vec_PTI_Get2(4, glm::i8, arg3), PyGLM_Vec_PTI_Get3(4, glm::i8, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u8, arg3) && PyGLM_Vec_PTI_Check3(4, glm::u8, arg4)) { - return pack(glm::max(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2), PyGLM_Vec_PTI_Get2(4, glm::u8, arg3), PyGLM_Vec_PTI_Get3(4, glm::u8, arg4))); - } + else { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3) && arg1Subtype == GET_PyGLM_ArgSubtype(arg4)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_MAX_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::max(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3), PyGLM_VecOrMVec_Get(L, T, arg4))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_MAX_FUNC_TEMPLATE); +#undef PyGLM_MAX_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg4)) { + return pack(glm::max(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3), PyGLM_Number_FromPyObject(arg4))); + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for max()"); @@ -1573,125 +657,91 @@ fmin_(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3 = NULL, *arg4 = NULL; if (!PyArg_UnpackTuple(args, "fmin", 2, 4, &arg1, &arg2, &arg3, &arg4)) return NULL; if (arg3 == NULL) { + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmin(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmin(PyGLM_Vec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::fmin(PyGLM_MVec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::fmin(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } } else { if (arg4 == NULL) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmin(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { return pack(glm::fmin(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3))); - } } else { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3) && arg1Subtype == GET_PyGLM_ArgSubtype(arg4)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmin(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3), PyGLM_VecOrMVec_Get(L, T, arg4))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg4)) { return pack(glm::fmin(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3), PyGLM_Number_FromPyObject(arg4))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init3(arg4, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3) && PyGLM_Vec_PTI_Check3(1, float, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3), PyGLM_Vec_PTI_Get3(1, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3) && PyGLM_Vec_PTI_Check3(1, double, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3), PyGLM_Vec_PTI_Get3(1, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3) && PyGLM_Vec_PTI_Check3(2, float, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3), PyGLM_Vec_PTI_Get3(2, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3) && PyGLM_Vec_PTI_Check3(2, double, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3), PyGLM_Vec_PTI_Get3(2, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3) && PyGLM_Vec_PTI_Check3(3, float, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3), PyGLM_Vec_PTI_Get3(3, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3) && PyGLM_Vec_PTI_Check3(3, double, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3), PyGLM_Vec_PTI_Get3(3, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) { - return pack(glm::fmin(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4))); - } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for fmin()"); @@ -1720,125 +770,91 @@ fmax_(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3 = NULL, *arg4 = NULL; if (!PyArg_UnpackTuple(args, "fmax", 2, 4, &arg1, &arg2, &arg3, &arg4)) return NULL; if (arg3 == NULL) { + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmax(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmax(PyGLM_Vec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::fmax(PyGLM_MVec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::fmax(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2))); - } } else { if (arg4 == NULL) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmax(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { return pack(glm::fmax(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3))); - } } else { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3) && arg1Subtype == GET_PyGLM_ArgSubtype(arg4)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::fmax(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3), PyGLM_VecOrMVec_Get(L, T, arg4))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg4)) { return pack(glm::fmax(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3), PyGLM_Number_FromPyObject(arg4))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init3(arg4, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3) && PyGLM_Vec_PTI_Check3(1, float, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3), PyGLM_Vec_PTI_Get3(1, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3) && PyGLM_Vec_PTI_Check3(1, double, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3), PyGLM_Vec_PTI_Get3(1, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3) && PyGLM_Vec_PTI_Check3(2, float, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3), PyGLM_Vec_PTI_Get3(2, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3) && PyGLM_Vec_PTI_Check3(2, double, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3), PyGLM_Vec_PTI_Get3(2, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3) && PyGLM_Vec_PTI_Check3(3, float, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3), PyGLM_Vec_PTI_Get3(3, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3) && PyGLM_Vec_PTI_Check3(3, double, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3), PyGLM_Vec_PTI_Get3(3, double, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) { - return pack(glm::fmax(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4))); - } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for fmax()"); @@ -1859,6 +875,42 @@ static PyObject* clamp_(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3; PyGLM_Arg_Unpack_3O(args, "clamp", arg1, arg2, arg3); + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + + if (arg1Subtype == GET_PyGLM_ArgSubtype(arg2) && arg1Subtype == GET_PyGLM_ArgSubtype(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::clamp(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::clamp(PyGLM_Vec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::clamp(PyGLM_MVec_Get(L, T, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fFiI, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyFloat_Check(arg1) && PyFloat_Check(arg2) && PyFloat_Check(arg3)) { return pack(glm::clamp(PyFloat_AS_DOUBLE(arg1), PyFloat_AS_DOUBLE(arg2), PyFloat_AS_DOUBLE(arg3))); } @@ -1868,249 +920,6 @@ clamp_(PyObject*, PyObject* args) { if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { return pack(glm::clamp(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && PyGLM_Vec_PTI_Check2(1, int, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2), PyGLM_Vec_PTI_Get2(1, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && PyGLM_Vec_PTI_Check2(2, int, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2), PyGLM_Vec_PTI_Get2(2, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && PyGLM_Vec_PTI_Check2(3, int, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2), PyGLM_Vec_PTI_Get2(3, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && PyGLM_Vec_PTI_Check2(4, int, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2), PyGLM_Vec_PTI_Get2(4, int, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(1, glm::uint, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Vec_PTI_Get1(1, glm::uint, arg2), PyGLM_Vec_PTI_Get2(1, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(2, glm::uint, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Vec_PTI_Get1(2, glm::uint, arg2), PyGLM_Vec_PTI_Get2(2, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(3, glm::uint, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Vec_PTI_Get1(3, glm::uint, arg2), PyGLM_Vec_PTI_Get2(3, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && PyGLM_Vec_PTI_Check2(4, glm::uint, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Vec_PTI_Get1(4, glm::uint, arg2), PyGLM_Vec_PTI_Get2(4, glm::uint, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::uint, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Vec_PTI_Get1(1, glm::i64, arg2), PyGLM_Vec_PTI_Get2(1, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Vec_PTI_Get1(2, glm::i64, arg2), PyGLM_Vec_PTI_Get2(2, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Vec_PTI_Get1(3, glm::i64, arg2), PyGLM_Vec_PTI_Get2(3, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Vec_PTI_Get1(4, glm::i64, arg2), PyGLM_Vec_PTI_Get2(4, glm::i64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Vec_PTI_Get1(1, glm::u64, arg2), PyGLM_Vec_PTI_Get2(1, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Vec_PTI_Get1(2, glm::u64, arg2), PyGLM_Vec_PTI_Get2(2, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Vec_PTI_Get1(3, glm::u64, arg2), PyGLM_Vec_PTI_Get2(3, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u64, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Vec_PTI_Get1(4, glm::u64, arg2), PyGLM_Vec_PTI_Get2(4, glm::u64, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u64, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Vec_PTI_Get1(1, glm::i16, arg2), PyGLM_Vec_PTI_Get2(1, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Vec_PTI_Get1(2, glm::i16, arg2), PyGLM_Vec_PTI_Get2(2, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Vec_PTI_Get1(3, glm::i16, arg2), PyGLM_Vec_PTI_Get2(3, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Vec_PTI_Get1(4, glm::i16, arg2), PyGLM_Vec_PTI_Get2(4, glm::i16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Vec_PTI_Get1(1, glm::u16, arg2), PyGLM_Vec_PTI_Get2(1, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Vec_PTI_Get1(2, glm::u16, arg2), PyGLM_Vec_PTI_Get2(2, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Vec_PTI_Get1(3, glm::u16, arg2), PyGLM_Vec_PTI_Get2(3, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u16, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Vec_PTI_Get1(4, glm::u16, arg2), PyGLM_Vec_PTI_Get2(4, glm::u16, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u16, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::i8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Vec_PTI_Get1(1, glm::i8, arg2), PyGLM_Vec_PTI_Get2(1, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::i8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Vec_PTI_Get1(2, glm::i8, arg2), PyGLM_Vec_PTI_Get2(2, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::i8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Vec_PTI_Get1(3, glm::i8, arg2), PyGLM_Vec_PTI_Get2(3, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::i8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Vec_PTI_Get1(4, glm::i8, arg2), PyGLM_Vec_PTI_Get2(4, glm::i8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::i8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(1, glm::u8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Vec_PTI_Get1(1, glm::u8, arg2), PyGLM_Vec_PTI_Get2(1, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(2, glm::u8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Vec_PTI_Get1(2, glm::u8, arg2), PyGLM_Vec_PTI_Get2(2, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(3, glm::u8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Vec_PTI_Get1(3, glm::u8, arg2), PyGLM_Vec_PTI_Get2(3, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2) && PyGLM_Vec_PTI_Check2(4, glm::u8, arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Vec_PTI_Get1(4, glm::u8, arg2), PyGLM_Vec_PTI_Get2(4, glm::u8, arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(1, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(2, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(3, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return pack(glm::clamp(PyGLM_Vec_PTI_Get0(4, glm::u8, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " "clamp" "()"); return NULL; } @@ -2121,6 +930,9 @@ PyDoc_STRVAR(mix_docstr, " value `a`. The value for `a` is not restricted to the range `[0, 1]`.\n" "mix(x: number, y: number, a: bool) -> number\n" " Returns `y` if `a` is `True` and `x` otherwise.\n" + "mix(x: vecN, y: vecN, a: float) -> vecN\n" + " Returns `x * (1.0 - a) + y * a`, i.e., the linear blend of `x` and `y` using the floating-point\n" + " value `a`. The value for `a` is not restricted to the range `[0, 1]`.\n" "mix(x: vecN, y: vecN, a: fvecN) -> vecN\n" " Returns `x * (1.0 - a) + y * a`, i.e., the linear blend of `x` and `y` using the floating-point\n" " value `a`. The value for `a` is not restricted to the range `[0, 1]`.\n" @@ -2143,1532 +955,103 @@ mix_(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3; PyGLM_Arg_Unpack_3O(args, "mix", arg1, arg2, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyBool_Check(arg3)) { - return PyGLM_PyObject_FromNumber(glm::mix(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { - return PyGLM_PyObject_FromNumber(glm::mix(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - - PyGLM_PTI_Init0(arg1, PyGLM_T_ALL | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_ALL | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2) && PyGLM_Number_Check(arg3)) { - glm::quat o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::quat o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack_qua(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2) && PyGLM_Number_Check(arg3)) { - glm::dquat o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::dquat o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack_qua(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) { - glm::vec<1, int> o = PyGLM_Vec_PTI_Get0(1, int, arg1); - glm::vec<1, int> o2 = PyGLM_Vec_PTI_Get1(1, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - glm::vec<1, glm::uint> o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::vec<1, glm::uint> o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - glm::vec<1, glm::i64> o = PyGLM_Vec_PTI_Get0(1, glm::i64, arg1); - glm::vec<1, glm::i64> o2 = PyGLM_Vec_PTI_Get1(1, glm::i64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - glm::vec<1, glm::u64> o = PyGLM_Vec_PTI_Get0(1, glm::u64, arg1); - glm::vec<1, glm::u64> o2 = PyGLM_Vec_PTI_Get1(1, glm::u64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - glm::vec<1, glm::i16> o = PyGLM_Vec_PTI_Get0(1, glm::i16, arg1); - glm::vec<1, glm::i16> o2 = PyGLM_Vec_PTI_Get1(1, glm::i16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - glm::vec<1, glm::u16> o = PyGLM_Vec_PTI_Get0(1, glm::u16, arg1); - glm::vec<1, glm::u16> o2 = PyGLM_Vec_PTI_Get1(1, glm::u16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - glm::vec<1, glm::i8> o = PyGLM_Vec_PTI_Get0(1, glm::i8, arg1); - glm::vec<1, glm::i8> o2 = PyGLM_Vec_PTI_Get1(1, glm::i8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - glm::vec<1, glm::u8> o = PyGLM_Vec_PTI_Get0(1, glm::u8, arg1); - glm::vec<1, glm::u8> o2 = PyGLM_Vec_PTI_Get1(1, glm::u8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - glm::vec<1, bool> o = PyGLM_Vec_PTI_Get0(1, bool, arg1); - glm::vec<1, bool> o2 = PyGLM_Vec_PTI_Get1(1, bool, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(1, bool, arg3)) { - glm::vec<1, bool> o3 = PyGLM_Vec_PTI_Get2(1, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) { - glm::vec<2, int> o = PyGLM_Vec_PTI_Get0(2, int, arg1); - glm::vec<2, int> o2 = PyGLM_Vec_PTI_Get1(2, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - glm::vec<2, glm::uint> o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::vec<2, glm::uint> o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - glm::vec<2, glm::i64> o = PyGLM_Vec_PTI_Get0(2, glm::i64, arg1); - glm::vec<2, glm::i64> o2 = PyGLM_Vec_PTI_Get1(2, glm::i64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - glm::vec<2, glm::u64> o = PyGLM_Vec_PTI_Get0(2, glm::u64, arg1); - glm::vec<2, glm::u64> o2 = PyGLM_Vec_PTI_Get1(2, glm::u64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - glm::vec<2, glm::i16> o = PyGLM_Vec_PTI_Get0(2, glm::i16, arg1); - glm::vec<2, glm::i16> o2 = PyGLM_Vec_PTI_Get1(2, glm::i16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - glm::vec<2, glm::u16> o = PyGLM_Vec_PTI_Get0(2, glm::u16, arg1); - glm::vec<2, glm::u16> o2 = PyGLM_Vec_PTI_Get1(2, glm::u16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - glm::vec<2, glm::i8> o = PyGLM_Vec_PTI_Get0(2, glm::i8, arg1); - glm::vec<2, glm::i8> o2 = PyGLM_Vec_PTI_Get1(2, glm::i8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - glm::vec<2, glm::u8> o = PyGLM_Vec_PTI_Get0(2, glm::u8, arg1); - glm::vec<2, glm::u8> o2 = PyGLM_Vec_PTI_Get1(2, glm::u8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - glm::vec<2, bool> o = PyGLM_Vec_PTI_Get0(2, bool, arg1); - glm::vec<2, bool> o2 = PyGLM_Vec_PTI_Get1(2, bool, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(2, bool, arg3)) { - glm::vec<2, bool> o3 = PyGLM_Vec_PTI_Get2(2, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) { - glm::vec<3, int> o = PyGLM_Vec_PTI_Get0(3, int, arg1); - glm::vec<3, int> o2 = PyGLM_Vec_PTI_Get1(3, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - glm::vec<3, glm::uint> o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::vec<3, glm::uint> o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - glm::vec<3, glm::i64> o = PyGLM_Vec_PTI_Get0(3, glm::i64, arg1); - glm::vec<3, glm::i64> o2 = PyGLM_Vec_PTI_Get1(3, glm::i64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - glm::vec<3, glm::u64> o = PyGLM_Vec_PTI_Get0(3, glm::u64, arg1); - glm::vec<3, glm::u64> o2 = PyGLM_Vec_PTI_Get1(3, glm::u64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - glm::vec<3, glm::i16> o = PyGLM_Vec_PTI_Get0(3, glm::i16, arg1); - glm::vec<3, glm::i16> o2 = PyGLM_Vec_PTI_Get1(3, glm::i16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - glm::vec<3, glm::u16> o = PyGLM_Vec_PTI_Get0(3, glm::u16, arg1); - glm::vec<3, glm::u16> o2 = PyGLM_Vec_PTI_Get1(3, glm::u16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - glm::vec<3, glm::i8> o = PyGLM_Vec_PTI_Get0(3, glm::i8, arg1); - glm::vec<3, glm::i8> o2 = PyGLM_Vec_PTI_Get1(3, glm::i8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - glm::vec<3, glm::u8> o = PyGLM_Vec_PTI_Get0(3, glm::u8, arg1); - glm::vec<3, glm::u8> o2 = PyGLM_Vec_PTI_Get1(3, glm::u8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - glm::vec<3, bool> o = PyGLM_Vec_PTI_Get0(3, bool, arg1); - glm::vec<3, bool> o2 = PyGLM_Vec_PTI_Get1(3, bool, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(3, bool, arg3)) { - glm::vec<3, bool> o3 = PyGLM_Vec_PTI_Get2(3, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) { - glm::vec<4, int> o = PyGLM_Vec_PTI_Get0(4, int, arg1); - glm::vec<4, int> o2 = PyGLM_Vec_PTI_Get1(4, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - glm::vec<4, glm::uint> o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::vec<4, glm::uint> o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - glm::vec<4, glm::i64> o = PyGLM_Vec_PTI_Get0(4, glm::i64, arg1); - glm::vec<4, glm::i64> o2 = PyGLM_Vec_PTI_Get1(4, glm::i64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - glm::vec<4, glm::u64> o = PyGLM_Vec_PTI_Get0(4, glm::u64, arg1); - glm::vec<4, glm::u64> o2 = PyGLM_Vec_PTI_Get1(4, glm::u64, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - glm::vec<4, glm::i16> o = PyGLM_Vec_PTI_Get0(4, glm::i16, arg1); - glm::vec<4, glm::i16> o2 = PyGLM_Vec_PTI_Get1(4, glm::i16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - glm::vec<4, glm::u16> o = PyGLM_Vec_PTI_Get0(4, glm::u16, arg1); - glm::vec<4, glm::u16> o2 = PyGLM_Vec_PTI_Get1(4, glm::u16, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - glm::vec<4, glm::i8> o = PyGLM_Vec_PTI_Get0(4, glm::i8, arg1); - glm::vec<4, glm::i8> o2 = PyGLM_Vec_PTI_Get1(4, glm::i8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - glm::vec<4, glm::u8> o = PyGLM_Vec_PTI_Get0(4, glm::u8, arg1); - glm::vec<4, glm::u8> o2 = PyGLM_Vec_PTI_Get1(4, glm::u8, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - glm::vec<4, bool> o = PyGLM_Vec_PTI_Get0(4, bool, arg1); - glm::vec<4, bool> o2 = PyGLM_Vec_PTI_Get1(4, bool, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack_vec(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check2(4, bool, arg3)) { - glm::vec<4, bool> o3 = PyGLM_Vec_PTI_Get2(4, bool, arg3); - return pack_vec(glm::mix(o, o2, o3)); - } - } - - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_2x2 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(2, 2, float, arg3)) { - glm::mat<2, 2, float> o3 = PyGLM_Mat_PTI_Get2(2, 2, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(2, 2, double, arg3)) { - glm::mat<2, 2, double> o3 = PyGLM_Mat_PTI_Get2(2, 2, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_2x2 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(2, 2, float, arg3)) { - glm::mat<2, 2, float> o3 = PyGLM_Mat_PTI_Get2(2, 2, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(2, 2, double, arg3)) { - glm::mat<2, 2, double> o3 = PyGLM_Mat_PTI_Get2(2, 2, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(2, 2, int, arg1) && PyGLM_Mat_PTI_Check1(2, 2, int, arg2)) { - glm::mat<2, 2, int> o = PyGLM_Mat_PTI_Get0(2, 2, int, arg1); - glm::mat<2, 2, int> o2 = PyGLM_Mat_PTI_Get1(2, 2, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_2x2 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(2, 2, float, arg3)) { - glm::mat<2, 2, float> o3 = PyGLM_Mat_PTI_Get2(2, 2, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(2, 2, double, arg3)) { - glm::mat<2, 2, double> o3 = PyGLM_Mat_PTI_Get2(2, 2, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(2, 2, glm::uint, arg1) && PyGLM_Mat_PTI_Check1(2, 2, glm::uint, arg2)) { - glm::mat<2, 2, glm::uint> o = PyGLM_Mat_PTI_Get0(2, 2, glm::uint, arg1); - glm::mat<2, 2, glm::uint> o2 = PyGLM_Mat_PTI_Get1(2, 2, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_2x2 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(2, 2, float, arg3)) { - glm::mat<2, 2, float> o3 = PyGLM_Mat_PTI_Get2(2, 2, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(2, 2, double, arg3)) { - glm::mat<2, 2, double> o3 = PyGLM_Mat_PTI_Get2(2, 2, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - //if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check0(2, 3, float, arg2)) { - // glm::mat<2, 3, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, float, arg3)) { - // glm::mat<2, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, double, arg3)) { - // glm::mat<2, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check0(2, 3, double, arg2)) { - // glm::mat<2, 3, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, float, arg3)) { - // glm::mat<2, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, double, arg3)) { - // glm::mat<2, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 3, int, arg1) && PyGLM_Mat_PTI_Check0(2, 3, int, arg2)) { - // glm::mat<2, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, float, arg3)) { - // glm::mat<2, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, double, arg3)) { - // glm::mat<2, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 3, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(2, 3, glm::uint, arg2)) { - // glm::mat<2, 3, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, float, arg3)) { - // glm::mat<2, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 3, double, arg3)) { - // glm::mat<2, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check0(2, 4, float, arg2)) { - // glm::mat<2, 4, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, float, arg3)) { - // glm::mat<2, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, double, arg3)) { - // glm::mat<2, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check0(2, 4, double, arg2)) { - // glm::mat<2, 4, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, float, arg3)) { - // glm::mat<2, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, double, arg3)) { - // glm::mat<2, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 4, int, arg1) && PyGLM_Mat_PTI_Check0(2, 4, int, arg2)) { - // glm::mat<2, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, float, arg3)) { - // glm::mat<2, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, double, arg3)) { - // glm::mat<2, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(2, 4, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(2, 4, glm::uint, arg2)) { - // glm::mat<2, 4, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, float, arg3)) { - // glm::mat<2, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(2, 4, double, arg3)) { - // glm::mat<2, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check0(3, 2, float, arg2)) { - // glm::mat<3, 2, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, float, arg3)) { - // glm::mat<3, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, double, arg3)) { - // glm::mat<3, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check0(3, 2, double, arg2)) { - // glm::mat<3, 2, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, float, arg3)) { - // glm::mat<3, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, double, arg3)) { - // glm::mat<3, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 2, int, arg1) && PyGLM_Mat_PTI_Check0(3, 2, int, arg2)) { - // glm::mat<3, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, float, arg3)) { - // glm::mat<3, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, double, arg3)) { - // glm::mat<3, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 2, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(3, 2, glm::uint, arg2)) { - // glm::mat<3, 2, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, float, arg3)) { - // glm::mat<3, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 2, double, arg3)) { - // glm::mat<3, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(3, 3, float, arg3)) { - glm::mat<3, 3, float> o3 = PyGLM_Mat_PTI_Get2(3, 3, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(3, 3, double, arg3)) { - glm::mat<3, 3, double> o3 = PyGLM_Mat_PTI_Get2(3, 3, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(3, 3, float, arg3)) { - glm::mat<3, 3, float> o3 = PyGLM_Mat_PTI_Get2(3, 3, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(3, 3, double, arg3)) { - glm::mat<3, 3, double> o3 = PyGLM_Mat_PTI_Get2(3, 3, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(3, 3, int, arg1) && PyGLM_Mat_PTI_Check1(3, 3, int, arg2)) { - glm::mat<3, 3, int> o = PyGLM_Mat_PTI_Get0(3, 3, int, arg1); - glm::mat<3, 3, int> o2 = PyGLM_Mat_PTI_Get1(3, 3, int, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(3, 3, float, arg3)) { - glm::mat<3, 3, float> o3 = PyGLM_Mat_PTI_Get2(3, 3, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(3, 3, double, arg3)) { - glm::mat<3, 3, double> o3 = PyGLM_Mat_PTI_Get2(3, 3, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(3, 3, glm::uint, arg1) && PyGLM_Mat_PTI_Check1(3, 3, glm::uint, arg2)) { - glm::mat<3, 3, glm::uint> o = PyGLM_Mat_PTI_Get0(3, 3, glm::uint, arg1); - glm::mat<3, 3, glm::uint> o2 = PyGLM_Mat_PTI_Get1(3, 3, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(3, 3, float, arg3)) { - glm::mat<3, 3, float> o3 = PyGLM_Mat_PTI_Get2(3, 3, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(3, 3, double, arg3)) { - glm::mat<3, 3, double> o3 = PyGLM_Mat_PTI_Get2(3, 3, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - //if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check0(3, 4, float, arg2)) { - // glm::mat<3, 4, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, float, arg3)) { - // glm::mat<3, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, double, arg3)) { - // glm::mat<3, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check0(3, 4, double, arg2)) { - // glm::mat<3, 4, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, float, arg3)) { - // glm::mat<3, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, double, arg3)) { - // glm::mat<3, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 4, int, arg1) && PyGLM_Mat_PTI_Check0(3, 4, int, arg2)) { - // glm::mat<3, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, float, arg3)) { - // glm::mat<3, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, double, arg3)) { - // glm::mat<3, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(3, 4, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(3, 4, glm::uint, arg2)) { - // glm::mat<3, 4, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, float, arg3)) { - // glm::mat<3, 4, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(3, 4, double, arg3)) { - // glm::mat<3, 4, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check0(4, 2, float, arg2)) { - // glm::mat<4, 2, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, float, arg3)) { - // glm::mat<4, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, double, arg3)) { - // glm::mat<4, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check0(4, 2, double, arg2)) { - // glm::mat<4, 2, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, float, arg3)) { - // glm::mat<4, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, double, arg3)) { - // glm::mat<4, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 2, int, arg1) && PyGLM_Mat_PTI_Check0(4, 2, int, arg2)) { - // glm::mat<4, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, float, arg3)) { - // glm::mat<4, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, double, arg3)) { - // glm::mat<4, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 2, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(4, 2, glm::uint, arg2)) { - // glm::mat<4, 2, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, float, arg3)) { - // glm::mat<4, 2, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 2, double, arg3)) { - // glm::mat<4, 2, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check0(4, 3, float, arg2)) { - // glm::mat<4, 3, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, float, arg3)) { - // glm::mat<4, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, double, arg3)) { - // glm::mat<4, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check0(4, 3, double, arg2)) { - // glm::mat<4, 3, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, float, arg3)) { - // glm::mat<4, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, double, arg3)) { - // glm::mat<4, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 3, int, arg1) && PyGLM_Mat_PTI_Check0(4, 3, int, arg2)) { - // glm::mat<4, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, float, arg3)) { - // glm::mat<4, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, double, arg3)) { - // glm::mat<4, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - //if (PyGLM_Mat_PTI_Check0(4, 3, glm::uint, arg1) && PyGLM_Mat_PTI_Check0(4, 3, glm::uint, arg2)) { - // glm::mat<4, 3, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // if (PyGLM_Number_Check(arg3)) { - // return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, float, arg3)) { - // glm::mat<4, 3, float> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - // if (PyGLM_Mat_PTI_Check0(4, 3, double, arg3)) { - // glm::mat<4, 3, double> o3; - // unpack_mat(arg3, o3); - // return pack(glm::mix(o, o2, o3)); - // } - //} - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(4, 4, float, arg3)) { - glm::mat<4, 4, float> o3 = PyGLM_Mat_PTI_Get2(4, 4, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(4, 4, double, arg3)) { - glm::mat<4, 4, double> o3 = PyGLM_Mat_PTI_Get2(4, 4, double, arg3); - return pack(glm::mix(o, o2, o3)); - } - } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(4, 4, float, arg3)) { - glm::mat<4, 4, float> o3 = PyGLM_Mat_PTI_Get2(4, 4, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(4, 4, double, arg3)) { - glm::mat<4, 4, double> o3 = PyGLM_Mat_PTI_Get2(4, 4, double, arg3); - return pack(glm::mix(o, o2, o3)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + if (Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + + if (arg1Subtype == arg2Subtype && arg1Subtype->glmType == arg3Subtype->glmType) { + if (arg1Subtype->glmType == PyGLM_TYPE_VEC) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (arg3Subtype->format == PyGLM_FS_DOUBLE) {\ + return pack(glm::mix(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, double, arg3)));\ + }\ + if (arg3Subtype->format == PyGLM_FS_FLOAT) {\ + return pack(glm::mix(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, float, arg3)));\ + }\ + if (arg3Subtype->format == PyGLM_FS_BOOL) {\ + return pack(glm::mix(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_Vec_Get(L, bool, arg3)));\ + }\ + break; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + if (arg1Subtype->glmType == PyGLM_TYPE_MAT) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + if (arg3Subtype->format == PyGLM_FS_DOUBLE) {\ + return pack(glm::mix(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_Mat_Get(C, R, double, arg3)));\ + }\ + if (arg3Subtype->format == PyGLM_FS_FLOAT) {\ + return pack(glm::mix(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_Mat_Get(C, R, float, arg3)));\ + }\ + break; + + PyGLM_CODEGEN_PARAM_S_ALL(PyGLM_CODEGEN_PARAM_T_Mat_fFiI, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + } } - } - if (PyGLM_Mat_PTI_Check0(4, 4, int, arg1) && PyGLM_Mat_PTI_Check1(4, 4, int, arg2)) { - glm::mat<4, 4, int> o = PyGLM_Mat_PTI_Get0(4, 4, int, arg1); - glm::mat<4, 4, int> o2 = PyGLM_Mat_PTI_Get1(4, 4, int, arg2); if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(4, 4, float, arg3)) { - glm::mat<4, 4, float> o3 = PyGLM_Mat_PTI_Get2(4, 4, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(4, 4, double, arg3)) { - glm::mat<4, 4, double> o3 = PyGLM_Mat_PTI_Get2(4, 4, double, arg3); - return pack(glm::mix(o, o2, o3)); + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + + + if (arg1Subtype == arg2Subtype) { + if (arg1Subtype->glmType == PyGLM_TYPE_VEC) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (PyBool_Check(arg3)) { \ + return pack(glm::mix(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_Number_FromPyObject(arg3)));\ + } \ + return pack(glm::mix(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_Number_FromPyObject(arg3))); + + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + if (arg1Type->glmType == PyGLM_TYPE_MAT) { + const double a = PyGLM_Number_FromPyObject(arg3); + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Type)) { +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::mix(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), a)); + + PyGLM_CODEGEN_PARAM_S_ALL(PyGLM_CODEGEN_PARAM_T_Mat_fFiI, PyGLM_FUNC_TEMPLATE); +#undef PyGLM_FUNC_TEMPLATE + } + } + if (arg1Type == (PyGLMTypeObject*)&hfquaType) { + return pack(glm::mix(PyGLM_Qua_Get(float, arg1), PyGLM_Qua_Get(float, arg2), PyGLM_Number_FromPyObject(arg3))); + } + if (arg1Type == (PyGLMTypeObject*)&hdquaType) { + return pack(glm::mix(PyGLM_Qua_Get(double, arg1), PyGLM_Qua_Get(double, arg2), PyGLM_Number_FromPyObject(arg3))); + } + } } } - if (PyGLM_Mat_PTI_Check0(4, 4, glm::uint, arg1) && PyGLM_Mat_PTI_Check1(4, 4, glm::uint, arg2)) { - glm::mat<4, 4, glm::uint> o = PyGLM_Mat_PTI_Get0(4, 4, glm::uint, arg1); - glm::mat<4, 4, glm::uint> o2 = PyGLM_Mat_PTI_Get1(4, 4, glm::uint, arg2); - if (PyGLM_Number_Check(arg3)) { - return pack(glm::mix(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD); - if (PyGLM_Mat_PTI_Check2(4, 4, float, arg3)) { - glm::mat<4, 4, float> o3 = PyGLM_Mat_PTI_Get2(4, 4, float, arg3); - return pack(glm::mix(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check2(4, 4, double, arg3)) { - glm::mat<4, 4, double> o3 = PyGLM_Mat_PTI_Get2(4, 4, double, arg3); - return pack(glm::mix(o, o2, o3)); - } + + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyBool_Check(arg3)) { + return PyGLM_PyObject_FromNumber(glm::mix(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); + } + + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) { + return PyGLM_PyObject_FromNumber(glm::mix(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for mix()"); @@ -3689,449 +1072,41 @@ static PyObject* step_(PyObject*, PyObject* args) { PyObject *arg1, *arg2; PyGLM_Arg_Unpack_2O(args, "step", arg1, arg2); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return PyGLM_PyObject_FromNumber(glm::step(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - if (PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, float, arg1)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, int, arg2)) { - glm::vec<1, int> o2 = PyGLM_Vec_PTI_Get1(1, int, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1)) { - glm::vec<1, int> o = PyGLM_Vec_PTI_Get0(1, int, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - glm::vec<1, glm::uint> o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1)) { - glm::vec<1, glm::uint> o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - glm::vec<1, glm::i64> o2 = PyGLM_Vec_PTI_Get1(1, glm::i64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1)) { - glm::vec<1, glm::i64> o = PyGLM_Vec_PTI_Get0(1, glm::i64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - glm::vec<1, glm::u64> o2 = PyGLM_Vec_PTI_Get1(1, glm::u64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1)) { - glm::vec<1, glm::u64> o = PyGLM_Vec_PTI_Get0(1, glm::u64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - glm::vec<1, glm::i16> o2 = PyGLM_Vec_PTI_Get1(1, glm::i16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1)) { - glm::vec<1, glm::i16> o = PyGLM_Vec_PTI_Get0(1, glm::i16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - glm::vec<1, glm::u16> o2 = PyGLM_Vec_PTI_Get1(1, glm::u16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1)) { - glm::vec<1, glm::u16> o = PyGLM_Vec_PTI_Get0(1, glm::u16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - glm::vec<1, glm::i8> o2 = PyGLM_Vec_PTI_Get1(1, glm::i8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1)) { - glm::vec<1, glm::i8> o = PyGLM_Vec_PTI_Get0(1, glm::i8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - glm::vec<1, glm::u8> o2 = PyGLM_Vec_PTI_Get1(1, glm::u8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1)) { - glm::vec<1, glm::u8> o = PyGLM_Vec_PTI_Get0(1, glm::u8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - glm::vec<1, bool> o2 = PyGLM_Vec_PTI_Get1(1, bool, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1)) { - glm::vec<1, bool> o = PyGLM_Vec_PTI_Get0(1, bool, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, int, arg2)) { - glm::vec<2, int> o2 = PyGLM_Vec_PTI_Get1(2, int, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1)) { - glm::vec<2, int> o = PyGLM_Vec_PTI_Get0(2, int, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - glm::vec<2, glm::uint> o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1)) { - glm::vec<2, glm::uint> o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - glm::vec<2, glm::i64> o2 = PyGLM_Vec_PTI_Get1(2, glm::i64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1)) { - glm::vec<2, glm::i64> o = PyGLM_Vec_PTI_Get0(2, glm::i64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - glm::vec<2, glm::u64> o2 = PyGLM_Vec_PTI_Get1(2, glm::u64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1)) { - glm::vec<2, glm::u64> o = PyGLM_Vec_PTI_Get0(2, glm::u64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - glm::vec<2, glm::i16> o2 = PyGLM_Vec_PTI_Get1(2, glm::i16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1)) { - glm::vec<2, glm::i16> o = PyGLM_Vec_PTI_Get0(2, glm::i16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - glm::vec<2, glm::u16> o2 = PyGLM_Vec_PTI_Get1(2, glm::u16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1)) { - glm::vec<2, glm::u16> o = PyGLM_Vec_PTI_Get0(2, glm::u16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - glm::vec<2, glm::i8> o2 = PyGLM_Vec_PTI_Get1(2, glm::i8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1)) { - glm::vec<2, glm::i8> o = PyGLM_Vec_PTI_Get0(2, glm::i8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - glm::vec<2, glm::u8> o2 = PyGLM_Vec_PTI_Get1(2, glm::u8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1)) { - glm::vec<2, glm::u8> o = PyGLM_Vec_PTI_Get0(2, glm::u8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - glm::vec<2, bool> o2 = PyGLM_Vec_PTI_Get1(2, bool, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1)) { - glm::vec<2, bool> o = PyGLM_Vec_PTI_Get0(2, bool, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, int, arg2)) { - glm::vec<3, int> o2 = PyGLM_Vec_PTI_Get1(3, int, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1)) { - glm::vec<3, int> o = PyGLM_Vec_PTI_Get0(3, int, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - glm::vec<3, glm::uint> o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1)) { - glm::vec<3, glm::uint> o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - glm::vec<3, glm::i64> o2 = PyGLM_Vec_PTI_Get1(3, glm::i64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1)) { - glm::vec<3, glm::i64> o = PyGLM_Vec_PTI_Get0(3, glm::i64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - glm::vec<3, glm::u64> o2 = PyGLM_Vec_PTI_Get1(3, glm::u64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1)) { - glm::vec<3, glm::u64> o = PyGLM_Vec_PTI_Get0(3, glm::u64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - glm::vec<3, glm::i16> o2 = PyGLM_Vec_PTI_Get1(3, glm::i16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1)) { - glm::vec<3, glm::i16> o = PyGLM_Vec_PTI_Get0(3, glm::i16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - glm::vec<3, glm::u16> o2 = PyGLM_Vec_PTI_Get1(3, glm::u16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1)) { - glm::vec<3, glm::u16> o = PyGLM_Vec_PTI_Get0(3, glm::u16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - glm::vec<3, glm::i8> o2 = PyGLM_Vec_PTI_Get1(3, glm::i8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1)) { - glm::vec<3, glm::i8> o = PyGLM_Vec_PTI_Get0(3, glm::i8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - glm::vec<3, glm::u8> o2 = PyGLM_Vec_PTI_Get1(3, glm::u8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1)) { - glm::vec<3, glm::u8> o = PyGLM_Vec_PTI_Get0(3, glm::u8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - glm::vec<3, bool> o2 = PyGLM_Vec_PTI_Get1(3, bool, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1)) { - glm::vec<3, bool> o = PyGLM_Vec_PTI_Get0(3, bool, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, int, arg2)) { - glm::vec<4, int> o2 = PyGLM_Vec_PTI_Get1(4, int, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1)) { - glm::vec<4, int> o = PyGLM_Vec_PTI_Get0(4, int, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - glm::vec<4, glm::uint> o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1)) { - glm::vec<4, glm::uint> o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - glm::vec<4, glm::i64> o2 = PyGLM_Vec_PTI_Get1(4, glm::i64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1)) { - glm::vec<4, glm::i64> o = PyGLM_Vec_PTI_Get0(4, glm::i64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - glm::vec<4, glm::u64> o2 = PyGLM_Vec_PTI_Get1(4, glm::u64, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1)) { - glm::vec<4, glm::u64> o = PyGLM_Vec_PTI_Get0(4, glm::u64, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - glm::vec<4, glm::i16> o2 = PyGLM_Vec_PTI_Get1(4, glm::i16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1)) { - glm::vec<4, glm::i16> o = PyGLM_Vec_PTI_Get0(4, glm::i16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - glm::vec<4, glm::u16> o2 = PyGLM_Vec_PTI_Get1(4, glm::u16, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1)) { - glm::vec<4, glm::u16> o = PyGLM_Vec_PTI_Get0(4, glm::u16, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - glm::vec<4, glm::i8> o2 = PyGLM_Vec_PTI_Get1(4, glm::i8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1)) { - glm::vec<4, glm::i8> o = PyGLM_Vec_PTI_Get0(4, glm::i8, arg1); - return pack_vec(glm::step(o, o2)); - } - } - if (PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - glm::vec<4, glm::u8> o2 = PyGLM_Vec_PTI_Get1(4, glm::u8, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1)) { - glm::vec<4, glm::u8> o = PyGLM_Vec_PTI_Get0(4, glm::u8, arg1); - return pack_vec(glm::step(o, o2)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::step(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } } - if (PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - glm::vec<4, bool> o2 = PyGLM_Vec_PTI_Get1(4, bool, arg2); - if (PyGLM_Number_Check(arg1)) { - return pack_vec(glm::step(PyGLM_Number_FromPyObject(arg1), o2)); + if (PyGLM_Number_Check(arg1)) { + if (Is_PyGLM_Object(arg2)) { + + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg2); + + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg2Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::step(PyGLM_Number_FromPyObject(arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1)) { - glm::vec<4, bool> o = PyGLM_Vec_PTI_Get0(4, bool, arg1); - return pack_vec(glm::step(o, o2)); + if (PyGLM_Number_Check(arg2)) { + return PyGLM_PyObject_FromNumber(glm::step(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } } PyGLM_TYPEERROR_2O("invalid argument type(s) for step(): ", arg1, arg2); @@ -4165,113 +1140,43 @@ static PyObject* smoothstep_(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3; PyGLM_Arg_Unpack_3O(args, "smoothstep", arg1, arg2, arg3); - if (PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return PyGLM_PyObject_FromNumber(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FLOAT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_DOUBLE); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_DOUBLE); - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FLOAT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_DOUBLE); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_DOUBLE); - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FLOAT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_DOUBLE); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_DOUBLE); - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); + if (Is_PyGLM_Object(arg3)) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::smoothstep(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } - } - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FLOAT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg3); + + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg3Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_VecOrMVec_Get(L, T, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack_vec(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), o3)); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_DOUBLE); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_DOUBLE); - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack_vec(glm::smoothstep(o, o2, o3)); - } + if (PyGLM_Number_Check(arg3) && PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { + return PyGLM_PyObject_FromNumber(glm::smoothstep(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for smoothstep()"); return NULL; @@ -4349,38 +1254,24 @@ frexp_(PyObject*, PyObject* args) { } PyObject* arg1, * arg2; PyGLM_Arg_Unpack_2O(args, "frexp", arg1, arg2); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyObject_TypeCheck(arg2, &hivec1Type)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - return pack_vec(glm::frexp(o, ((vec<1, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyObject_TypeCheck(arg2, &hivec1Type)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - return pack_vec(glm::frexp(o, ((vec<1, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyObject_TypeCheck(arg2, &hivec2Type)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - return pack_vec(glm::frexp(o, ((vec<2, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyObject_TypeCheck(arg2, &hivec2Type)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - return pack_vec(glm::frexp(o, ((vec<2, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyObject_TypeCheck(arg2, &hivec3Type)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - return pack_vec(glm::frexp(o, ((vec<3, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyObject_TypeCheck(arg2, &hivec3Type)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - return pack_vec(glm::frexp(o, ((vec<3, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyObject_TypeCheck(arg2, &hivec4Type)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - return pack_vec(glm::frexp(o, ((vec<4, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyObject_TypeCheck(arg2, &hivec4Type)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - return pack_vec(glm::frexp(o, ((vec<4, int>*)arg2)->super_type)); + + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (arg2Subtype == reinterpret_cast(PyGLM_VEC_TYPE())) \ + return pack(glm::frexp(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, int, arg2))); \ + break; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for frexp(): ", arg1, arg2); return NULL; @@ -4403,38 +1294,23 @@ ldexp_(PyObject*, PyObject* args) { if (PyGLM_Number_Check(arg1), PyGLM_Number_Check(arg2)) { return PyGLM_PyObject_FromNumber(glm::ldexp(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyObject_TypeCheck(arg2, &hivec1Type)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - return pack_vec(glm::ldexp(o, ((vec<1, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyObject_TypeCheck(arg2, &hivec1Type)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - return pack_vec(glm::ldexp(o, ((vec<1, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyObject_TypeCheck(arg2, &hivec2Type)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - return pack_vec(glm::ldexp(o, ((vec<2, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyObject_TypeCheck(arg2, &hivec2Type)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - return pack_vec(glm::ldexp(o, ((vec<2, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyObject_TypeCheck(arg2, &hivec3Type)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - return pack_vec(glm::ldexp(o, ((vec<3, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyObject_TypeCheck(arg2, &hivec3Type)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - return pack_vec(glm::ldexp(o, ((vec<3, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyObject_TypeCheck(arg2, &hivec4Type)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - return pack_vec(glm::ldexp(o, ((vec<4, int>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyObject_TypeCheck(arg2, &hivec4Type)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - return pack_vec(glm::ldexp(o, ((vec<4, int>*)arg2)->super_type)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (arg2Subtype == reinterpret_cast(PyGLM_VEC_TYPE())) \ + return pack(glm::ldexp(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, int, arg2)));\ + break; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for ldexp(): ", arg1, arg2); return NULL; @@ -4454,22 +1330,20 @@ floatBitsToInt_(PyObject*, PyObject* arg) { float f = static_cast(PyFloat_AS_DOUBLE(arg)); return PyGLM_PyObject_FromNumber(glm::floatBitsToInt(f)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(1, float, arg)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg); - return pack_vec(glm::floatBitsToInt(o)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg); - return pack_vec(glm::floatBitsToInt(o)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg); - return pack_vec(glm::floatBitsToInt(o)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg); - return pack_vec(glm::floatBitsToInt(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::floatBitsToInt(PyGLM_Vec_Get(L, float, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::floatBitsToInt(PyGLM_MVec_Get(L, float, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type(s) for floatBitsToInt(): ", arg); return NULL; @@ -4489,22 +1363,20 @@ floatBitsToUint_(PyObject*, PyObject* arg) { float f = static_cast(PyFloat_AS_DOUBLE(arg)); return PyGLM_PyObject_FromNumber(glm::floatBitsToUint(f)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(1, float, arg)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg); - return pack_vec(glm::floatBitsToUint(o)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg); - return pack_vec(glm::floatBitsToUint(o)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg); - return pack_vec(glm::floatBitsToUint(o)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg); - return pack_vec(glm::floatBitsToUint(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::floatBitsToUint(PyGLM_Vec_Get(L, float, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::floatBitsToUint(PyGLM_MVec_Get(L, float, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type(s) for floatBitsToUint(): ", arg); return NULL; @@ -4526,22 +1398,20 @@ intBitsToFloat_(PyObject*, PyObject* arg) { int i = static_cast(PyLong_AS_LONG(arg)); return PyGLM_PyObject_FromNumber(glm::intBitsToFloat(i)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT); - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg); - return pack_vec(glm::intBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg); - return pack_vec(glm::intBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg); - return pack_vec(glm::intBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg); - return pack_vec(glm::intBitsToFloat(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::intBitsToFloat(PyGLM_Vec_Get(L, int32, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::intBitsToFloat(PyGLM_MVec_Get(L, int32, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type(s) for intBitsToFloat(): ", arg); return NULL; @@ -4563,22 +1433,20 @@ uintBitsToFloat_(PyObject*, PyObject* arg) { unsigned int i = static_cast(PyLong_AsUnsignedLong(arg)); return PyGLM_PyObject_FromNumber(glm::uintBitsToFloat(i)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - if (PyGLM_Vec_PTI_Check0(1, uint32, arg)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg); - return pack_vec(glm::uintBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg); - return pack_vec(glm::uintBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg); - return pack_vec(glm::uintBitsToFloat(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg); - return pack_vec(glm::uintBitsToFloat(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::uintBitsToFloat(PyGLM_Vec_Get(L, uint32, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::uintBitsToFloat(PyGLM_MVec_Get(L, uint32, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type(s) for uintBitsToFloat(): ", arg); return NULL; @@ -4607,38 +1475,23 @@ modf_(PyObject*, PyObject* args) { } PyObject *arg1, *arg2; PyGLM_Arg_Unpack_2O(args, "modf", arg1, arg2); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyObject_TypeCheck(arg2, &hfvec1Type)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - return pack_vec(glm::modf(o, ((vec<1, float>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyObject_TypeCheck(arg2, &hdvec1Type)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - return pack_vec(glm::modf(o, ((vec<1, double>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyObject_TypeCheck(arg2, &hfvec2Type)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - return pack_vec(glm::modf(o, ((vec<2, float>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyObject_TypeCheck(arg2, &hdvec2Type)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - return pack_vec(glm::modf(o, ((vec<2, double>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyObject_TypeCheck(arg2, &hfvec3Type)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - return pack_vec(glm::modf(o, ((vec<3, float>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyObject_TypeCheck(arg2, &hdvec3Type)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - return pack_vec(glm::modf(o, ((vec<3, double>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyObject_TypeCheck(arg2, &hfvec4Type)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - return pack_vec(glm::modf(o, ((vec<4, float>*)arg2)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyObject_TypeCheck(arg2, &hdvec4Type)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - return pack_vec(glm::modf(o, ((vec<4, double>*)arg2)->super_type)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::modf(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for modf(): ", arg1, arg2); return NULL; diff --git a/PyGLM/functions/detail/func_exponential.h b/PyGLM/functions/detail/func_exponential.h index 1056456..f7fe79a 100644 --- a/PyGLM/functions/detail/func_exponential.h +++ b/PyGLM/functions/detail/func_exponential.h @@ -24,38 +24,35 @@ pow_(PyObject*, PyObject* args) { if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::pow(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - return pack(glm::pow(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2))); - } + if (Is_PyGLM_Object(arg1)) { + if (Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::pow(PyGLM_Qua_PTI_Get0(float, arg1), PyGLM_Number_FromPyObject(arg2))); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::pow(PyGLM_Qua_PTI_Get0(double, arg1), PyGLM_Number_FromPyObject(arg2))); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::pow(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } + } + if (PyGLM_Number_Check(arg2)) { + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::pow(PyGLM_Qua_Get(T, arg1), PyGLM_Number_FromPyObject(arg2))); + + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for pow(): ", arg1, arg2); return NULL; diff --git a/PyGLM/functions/detail/func_geometric.h b/PyGLM/functions/detail/func_geometric.h index 5e98050..e1fcce9 100644 --- a/PyGLM/functions/detail/func_geometric.h +++ b/PyGLM/functions/detail/func_geometric.h @@ -47,27 +47,30 @@ static PyObject* cross_(PyObject*, PyObject* args) { PyObject *arg1, *arg2; PyGLM_Arg_Unpack_2O(args, "cross", arg1, arg2); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_3 | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_3 | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::cross(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::cross(o, o2)); - } - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack(glm::cross(o, o2)); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack(glm::cross(o, o2)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::cross(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_T_Vec_fF(PyGLM_FUNC_TEMPLATE, 3) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::cross(PyGLM_Qua_Get(T, arg1), PyGLM_Qua_Get(T, arg2))); + + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for cross(): ", arg1, arg2); return NULL; diff --git a/PyGLM/functions/detail/func_integer.h b/PyGLM/functions/detail/func_integer.h index 8d0db50..ab7a717 100644 --- a/PyGLM/functions/detail/func_integer.h +++ b/PyGLM/functions/detail/func_integer.h @@ -26,27 +26,25 @@ uaddCarry_(PyObject*, PyObject* args) { } } else { - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && Py_TYPE(arg3) == &huvec1Type) { - glm::uvec1 o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::uvec1 o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - return pack_vec(glm::uaddCarry(o, o2, ((vec<1, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && Py_TYPE(arg3) == &huvec2Type) { - glm::uvec2 o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::uvec2 o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - return pack_vec(glm::uaddCarry(o, o2, ((vec<2, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && Py_TYPE(arg3) == &huvec3Type) { - glm::uvec3 o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::uvec3 o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - return pack_vec(glm::uaddCarry(o, o2, ((vec<3, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && Py_TYPE(arg3) == &huvec4Type) { - glm::uvec4 o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::uvec4 o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - return pack_vec(glm::uaddCarry(o, o2, ((vec<4, glm::uint>*)arg3)->super_type)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::uaddCarry(PyGLM_VecOrMVec_Get(L, uint32, arg1), PyGLM_VecOrMVec_Get(L, uint32, arg2), PyGLM_VecOrMVec_Get(L, uint32, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for uaddCarry()"); @@ -75,27 +73,25 @@ usubBorrow_(PyObject*, PyObject* args) { } } else { - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && Py_TYPE(arg3) == &huvec1Type) { - glm::uvec1 o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::uvec1 o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - return pack_vec(glm::usubBorrow(o, o2, ((vec<1, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && Py_TYPE(arg3) == &huvec2Type) { - glm::uvec2 o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::uvec2 o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - return pack_vec(glm::usubBorrow(o, o2, ((vec<2, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && Py_TYPE(arg3) == &huvec3Type) { - glm::uvec3 o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::uvec3 o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - return pack_vec(glm::usubBorrow(o, o2, ((vec<3, glm::uint>*)arg3)->super_type)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && Py_TYPE(arg3) == &huvec4Type) { - glm::uvec4 o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::uvec4 o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - return pack_vec(glm::usubBorrow(o, o2, ((vec<4, glm::uint>*)arg3)->super_type)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::usubBorrow(PyGLM_VecOrMVec_Get(L, uint32, arg1), PyGLM_VecOrMVec_Get(L, uint32, arg2), PyGLM_VecOrMVec_Get(L, uint32, arg3))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for usubBorrow()"); @@ -122,31 +118,28 @@ umulExtended_(PyObject*, PyObject* args) { } } else if (arg4 != NULL) { - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_UINT); - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2) && Py_TYPE(arg3) == &huvec1Type && Py_TYPE(arg4) == &huvec1Type) { - glm::uvec1 o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::uvec1 o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - glm::umulExtended(o, o2, ((vec<1, glm::uint>*)arg3)->super_type, ((vec<1, glm::uint>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2) && Py_TYPE(arg3) == &huvec2Type && Py_TYPE(arg4) == &huvec2Type) { - glm::uvec2 o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::uvec2 o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - glm::umulExtended(o, o2, ((vec<2, glm::uint>*)arg3)->super_type, ((vec<2, glm::uint>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2) && Py_TYPE(arg3) == &huvec3Type && Py_TYPE(arg4) == &huvec3Type) { - glm::uvec3 o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::uvec3 o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - glm::umulExtended(o, o2, ((vec<3, glm::uint>*)arg3)->super_type, ((vec<3, glm::uint>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2) && Py_TYPE(arg3) == &huvec4Type && Py_TYPE(arg4) == &huvec4Type) { - glm::uvec4 o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::uvec4 o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - glm::umulExtended(o, o2, ((vec<4, glm::uint>*)arg3)->super_type, ((vec<4, glm::uint>*)arg4)->super_type); - Py_RETURN_NONE; + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg4); + + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype && arg1Subtype == arg4Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + glm::umulExtended(PyGLM_VecOrMVec_Get(L, uint32, arg1), PyGLM_VecOrMVec_Get(L, uint32, arg2), PyGLM_VecOrMVec_Get(L, uint32, arg3), PyGLM_VecOrMVec_Get(L, uint32, arg4)); \ + Py_RETURN_NONE; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for umulExtended()"); @@ -173,31 +166,28 @@ imulExtended_(PyObject*, PyObject* args) { } } else if (arg4 != NULL) { - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT); - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2) && Py_TYPE(arg3) == &hivec1Type && Py_TYPE(arg4) == &hivec1Type) { - glm::ivec1 o = PyGLM_Vec_PTI_Get0(1, int, arg1); - glm::ivec1 o2 = PyGLM_Vec_PTI_Get1(1, int, arg2); - glm::imulExtended(o, o2, ((vec<1, int>*)arg3)->super_type, ((vec<1, int>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2) && Py_TYPE(arg3) == &hivec2Type && Py_TYPE(arg4) == &hivec2Type) { - glm::ivec2 o = PyGLM_Vec_PTI_Get0(2, int, arg1); - glm::ivec2 o2 = PyGLM_Vec_PTI_Get1(2, int, arg2); - glm::imulExtended(o, o2, ((vec<2, int>*)arg3)->super_type, ((vec<2, int>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2) && Py_TYPE(arg3) == &hivec3Type && Py_TYPE(arg4) == &hivec3Type) { - glm::ivec3 o = PyGLM_Vec_PTI_Get0(3, int, arg1); - glm::ivec3 o2 = PyGLM_Vec_PTI_Get1(3, int, arg2); - glm::imulExtended(o, o2, ((vec<3, int>*)arg3)->super_type, ((vec<3, int>*)arg4)->super_type); - Py_RETURN_NONE; - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2) && Py_TYPE(arg3) == &hivec4Type && Py_TYPE(arg4) == &hivec4Type) { - glm::ivec4 o = PyGLM_Vec_PTI_Get0(4, int, arg1); - glm::ivec4 o2 = PyGLM_Vec_PTI_Get1(4, int, arg2); - glm::imulExtended(o, o2, ((vec<4, int>*)arg3)->super_type, ((vec<4, int>*)arg4)->super_type); - Py_RETURN_NONE; + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3) && Is_PyGLM_Object(arg4)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); + GET_PyGLM_ARG_TYPE(arg4); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); + GET_PyGLM_ARG_SUBTYPE(arg4); + + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype && arg1Subtype == arg4Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + glm::imulExtended(PyGLM_VecOrMVec_Get(L, int32, arg1), PyGLM_VecOrMVec_Get(L, int32, arg2), PyGLM_VecOrMVec_Get(L, int32, arg3), PyGLM_VecOrMVec_Get(L, int32, arg4)); \ + Py_RETURN_NONE; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for imulExtended()"); @@ -259,134 +249,20 @@ bitfieldExtract_(PyObject*, PyObject* args) { } return pack(glm::bitfieldExtract(ul, i, i2)); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I); - if (PyGLM_Vec_PTI_Check0(1, int32, arg1)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg1)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg1)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg1)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg1)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg1)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg1)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg1)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg1)) { - glm::vec<1, int64> o = PyGLM_Vec_PTI_Get0(1, int64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg1)) { - glm::vec<2, int64> o = PyGLM_Vec_PTI_Get0(2, int64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg1)) { - glm::vec<3, int64> o = PyGLM_Vec_PTI_Get0(3, int64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg1)) { - glm::vec<4, int64> o = PyGLM_Vec_PTI_Get0(4, int64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg1)) { - glm::vec<1, uint64> o = PyGLM_Vec_PTI_Get0(1, uint64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg1)) { - glm::vec<2, uint64> o = PyGLM_Vec_PTI_Get0(2, uint64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg1)) { - glm::vec<3, uint64> o = PyGLM_Vec_PTI_Get0(3, uint64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg1)) { - glm::vec<4, uint64> o = PyGLM_Vec_PTI_Get0(4, uint64, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, int16, arg1)) { - glm::vec<1, int16> o = PyGLM_Vec_PTI_Get0(1, int16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int16, arg1)) { - glm::vec<2, int16> o = PyGLM_Vec_PTI_Get0(2, int16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int16, arg1)) { - glm::vec<3, int16> o = PyGLM_Vec_PTI_Get0(3, int16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int16, arg1)) { - glm::vec<4, int16> o = PyGLM_Vec_PTI_Get0(4, int16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint16, arg1)) { - glm::vec<1, uint16> o = PyGLM_Vec_PTI_Get0(1, uint16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint16, arg1)) { - glm::vec<2, uint16> o = PyGLM_Vec_PTI_Get0(2, uint16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint16, arg1)) { - glm::vec<3, uint16> o = PyGLM_Vec_PTI_Get0(3, uint16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint16, arg1)) { - glm::vec<4, uint16> o = PyGLM_Vec_PTI_Get0(4, uint16, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, int8, arg1)) { - glm::vec<1, int8> o = PyGLM_Vec_PTI_Get0(1, int8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int8, arg1)) { - glm::vec<2, int8> o = PyGLM_Vec_PTI_Get0(2, int8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int8, arg1)) { - glm::vec<3, int8> o = PyGLM_Vec_PTI_Get0(3, int8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int8, arg1)) { - glm::vec<4, int8> o = PyGLM_Vec_PTI_Get0(4, int8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint8, arg1)) { - glm::vec<1, uint8> o = PyGLM_Vec_PTI_Get0(1, uint8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint8, arg1)) { - glm::vec<2, uint8> o = PyGLM_Vec_PTI_Get0(2, uint8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint8, arg1)) { - glm::vec<3, uint8> o = PyGLM_Vec_PTI_Get0(3, uint8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint8, arg1)) { - glm::vec<4, uint8> o = PyGLM_Vec_PTI_Get0(4, uint8, arg1); - return pack_vec(glm::bitfieldExtract(o, i, i2)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::bitfieldExtract(PyGLM_Vec_Get(L, T, arg1), i, i2)); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqsuIQSU, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::bitfieldExtract(PyGLM_Vec_Get(L, T, arg1), i, i2)); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_iI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for bitfieldExtract()"); @@ -450,87 +326,23 @@ bitfieldInsert_(PyObject*, PyObject* args) { } return pack(glm::bitfieldInsert(ul1, ul2, i, i2)); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I32 | PyGLM_DT_I64); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I32 | PyGLM_DT_I64); - if (PyGLM_Vec_PTI_Check0(1, int32, arg1) && PyGLM_Vec_PTI_Check1(1, int32, arg2)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg1); - glm::vec<1, int32> o2 = PyGLM_Vec_PTI_Get1(1, int32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg1) && PyGLM_Vec_PTI_Check1(2, int32, arg2)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg1); - glm::vec<2, int32> o2 = PyGLM_Vec_PTI_Get1(2, int32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg1) && PyGLM_Vec_PTI_Check1(3, int32, arg2)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg1); - glm::vec<3, int32> o2 = PyGLM_Vec_PTI_Get1(3, int32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg1) && PyGLM_Vec_PTI_Check1(4, int32, arg2)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg1); - glm::vec<4, int32> o2 = PyGLM_Vec_PTI_Get1(4, int32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg1) && PyGLM_Vec_PTI_Check1(1, uint32, arg2)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg1); - glm::vec<1, uint32> o2 = PyGLM_Vec_PTI_Get1(1, uint32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg1) && PyGLM_Vec_PTI_Check1(2, uint32, arg2)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg1); - glm::vec<2, uint32> o2 = PyGLM_Vec_PTI_Get1(2, uint32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg1); - glm::vec<3, uint32> o2 = PyGLM_Vec_PTI_Get1(3, uint32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg1) && PyGLM_Vec_PTI_Check1(4, uint32, arg2)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg1); - glm::vec<4, uint32> o2 = PyGLM_Vec_PTI_Get1(4, uint32, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) { - glm::vec<1, int64> o = PyGLM_Vec_PTI_Get0(1, int64, arg1); - glm::vec<1, int64> o2 = PyGLM_Vec_PTI_Get1(1, int64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) { - glm::vec<2, int64> o = PyGLM_Vec_PTI_Get0(2, int64, arg1); - glm::vec<2, int64> o2 = PyGLM_Vec_PTI_Get1(2, int64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) { - glm::vec<3, int64> o = PyGLM_Vec_PTI_Get0(3, int64, arg1); - glm::vec<3, int64> o2 = PyGLM_Vec_PTI_Get1(3, int64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) { - glm::vec<4, int64> o = PyGLM_Vec_PTI_Get0(4, int64, arg1); - glm::vec<4, int64> o2 = PyGLM_Vec_PTI_Get1(4, int64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg1) && PyGLM_Vec_PTI_Check1(1, uint64, arg2)) { - glm::vec<1, uint64> o = PyGLM_Vec_PTI_Get0(1, uint64, arg1); - glm::vec<1, uint64> o2 = PyGLM_Vec_PTI_Get1(1, uint64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg1) && PyGLM_Vec_PTI_Check1(2, uint64, arg2)) { - glm::vec<2, uint64> o = PyGLM_Vec_PTI_Get0(2, uint64, arg1); - glm::vec<2, uint64> o2 = PyGLM_Vec_PTI_Get1(2, uint64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg1) && PyGLM_Vec_PTI_Check1(3, uint64, arg2)) { - glm::vec<3, uint64> o = PyGLM_Vec_PTI_Get0(3, uint64, arg1); - glm::vec<3, uint64> o2 = PyGLM_Vec_PTI_Get1(3, uint64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg1) && PyGLM_Vec_PTI_Check1(4, uint64, arg2)) { - glm::vec<4, uint64> o = PyGLM_Vec_PTI_Get0(4, uint64, arg1); - glm::vec<4, uint64> o2 = PyGLM_Vec_PTI_Get1(4, uint64, arg2); - return pack_vec(glm::bitfieldInsert(o, o2, i, i2)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::bitfieldInsert(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), i, i2)); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqIQ, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for bitfieldInsert()"); @@ -585,54 +397,20 @@ static PyObject* bitfieldReverse_(PyObject*, PyObject* arg) { } return pack(glm::bitfieldReverse(ul)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I32 | PyGLM_DT_I64); - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(1, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(2, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(3, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(4, int32, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(1, uint32, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(2, uint32, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(3, uint32, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(4, uint32, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(1, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(2, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(3, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(4, int64, arg))); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(1, uint64, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(2, uint64, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(3, uint64, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg)) { - return pack_vec(glm::bitfieldReverse(PyGLM_Vec_PTI_Get0(4, uint64, arg))); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::bitfieldReverse(PyGLM_Vec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqIQ, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::bitfieldReverse(PyGLM_MVec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_iI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for bitfieldReverse(): ", arg); return NULL; @@ -666,134 +444,20 @@ bitCount_(PyObject*, PyObject* arg) { } return pack(glm::bitCount(ul)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I); - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) { - glm::vec<1, int64> o = PyGLM_Vec_PTI_Get0(1, int64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) { - glm::vec<2, int64> o = PyGLM_Vec_PTI_Get0(2, int64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) { - glm::vec<3, int64> o = PyGLM_Vec_PTI_Get0(3, int64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) { - glm::vec<4, int64> o = PyGLM_Vec_PTI_Get0(4, int64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg)) { - glm::vec<1, uint64> o = PyGLM_Vec_PTI_Get0(1, uint64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg)) { - glm::vec<2, uint64> o = PyGLM_Vec_PTI_Get0(2, uint64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg)) { - glm::vec<3, uint64> o = PyGLM_Vec_PTI_Get0(3, uint64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg)) { - glm::vec<4, uint64> o = PyGLM_Vec_PTI_Get0(4, uint64, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int16, arg)) { - glm::vec<1, int16> o = PyGLM_Vec_PTI_Get0(1, int16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int16, arg)) { - glm::vec<2, int16> o = PyGLM_Vec_PTI_Get0(2, int16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int16, arg)) { - glm::vec<3, int16> o = PyGLM_Vec_PTI_Get0(3, int16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int16, arg)) { - glm::vec<4, int16> o = PyGLM_Vec_PTI_Get0(4, int16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint16, arg)) { - glm::vec<1, uint16> o = PyGLM_Vec_PTI_Get0(1, uint16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint16, arg)) { - glm::vec<2, uint16> o = PyGLM_Vec_PTI_Get0(2, uint16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint16, arg)) { - glm::vec<3, uint16> o = PyGLM_Vec_PTI_Get0(3, uint16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint16, arg)) { - glm::vec<4, uint16> o = PyGLM_Vec_PTI_Get0(4, uint16, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int8, arg)) { - glm::vec<1, int8> o = PyGLM_Vec_PTI_Get0(1, int8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int8, arg)) { - glm::vec<2, int8> o = PyGLM_Vec_PTI_Get0(2, int8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int8, arg)) { - glm::vec<3, int8> o = PyGLM_Vec_PTI_Get0(3, int8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int8, arg)) { - glm::vec<4, int8> o = PyGLM_Vec_PTI_Get0(4, int8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint8, arg)) { - glm::vec<1, uint8> o = PyGLM_Vec_PTI_Get0(1, uint8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint8, arg)) { - glm::vec<2, uint8> o = PyGLM_Vec_PTI_Get0(2, uint8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint8, arg)) { - glm::vec<3, uint8> o = PyGLM_Vec_PTI_Get0(3, uint8, arg); - return pack_vec(glm::bitCount(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint8, arg)) { - glm::vec<4, uint8> o = PyGLM_Vec_PTI_Get0(4, uint8, arg); - return pack_vec(glm::bitCount(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::bitCount(PyGLM_Vec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqsuIQSU, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::bitCount(PyGLM_MVec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_iI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for bitCount(): ", arg); return NULL; @@ -828,134 +492,20 @@ findLSB_(PyObject*, PyObject* arg) { } return pack(glm::findLSB(ul)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I); - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) { - glm::vec<1, int64> o = PyGLM_Vec_PTI_Get0(1, int64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) { - glm::vec<2, int64> o = PyGLM_Vec_PTI_Get0(2, int64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) { - glm::vec<3, int64> o = PyGLM_Vec_PTI_Get0(3, int64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) { - glm::vec<4, int64> o = PyGLM_Vec_PTI_Get0(4, int64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg)) { - glm::vec<1, uint64> o = PyGLM_Vec_PTI_Get0(1, uint64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg)) { - glm::vec<2, uint64> o = PyGLM_Vec_PTI_Get0(2, uint64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg)) { - glm::vec<3, uint64> o = PyGLM_Vec_PTI_Get0(3, uint64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg)) { - glm::vec<4, uint64> o = PyGLM_Vec_PTI_Get0(4, uint64, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int16, arg)) { - glm::vec<1, int16> o = PyGLM_Vec_PTI_Get0(1, int16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int16, arg)) { - glm::vec<2, int16> o = PyGLM_Vec_PTI_Get0(2, int16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int16, arg)) { - glm::vec<3, int16> o = PyGLM_Vec_PTI_Get0(3, int16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int16, arg)) { - glm::vec<4, int16> o = PyGLM_Vec_PTI_Get0(4, int16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint16, arg)) { - glm::vec<1, uint16> o = PyGLM_Vec_PTI_Get0(1, uint16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint16, arg)) { - glm::vec<2, uint16> o = PyGLM_Vec_PTI_Get0(2, uint16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint16, arg)) { - glm::vec<3, uint16> o = PyGLM_Vec_PTI_Get0(3, uint16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint16, arg)) { - glm::vec<4, uint16> o = PyGLM_Vec_PTI_Get0(4, uint16, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int8, arg)) { - glm::vec<1, int8> o = PyGLM_Vec_PTI_Get0(1, int8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int8, arg)) { - glm::vec<2, int8> o = PyGLM_Vec_PTI_Get0(2, int8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int8, arg)) { - glm::vec<3, int8> o = PyGLM_Vec_PTI_Get0(3, int8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int8, arg)) { - glm::vec<4, int8> o = PyGLM_Vec_PTI_Get0(4, int8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint8, arg)) { - glm::vec<1, uint8> o = PyGLM_Vec_PTI_Get0(1, uint8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint8, arg)) { - glm::vec<2, uint8> o = PyGLM_Vec_PTI_Get0(2, uint8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint8, arg)) { - glm::vec<3, uint8> o = PyGLM_Vec_PTI_Get0(3, uint8, arg); - return pack_vec(glm::findLSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint8, arg)) { - glm::vec<4, uint8> o = PyGLM_Vec_PTI_Get0(4, uint8, arg); - return pack_vec(glm::findLSB(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::findLSB(PyGLM_Vec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqsuIQSU, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::findLSB(PyGLM_MVec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_iI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for findLSB(): ", arg); return NULL; @@ -992,134 +542,20 @@ findMSB_(PyObject*, PyObject* arg) { } return pack(glm::findMSB(ul)); } - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I); - if (PyGLM_Vec_PTI_Check0(1, int32, arg)) { - glm::vec<1, int32> o = PyGLM_Vec_PTI_Get0(1, int32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int32, arg)) { - glm::vec<2, int32> o = PyGLM_Vec_PTI_Get0(2, int32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int32, arg)) { - glm::vec<3, int32> o = PyGLM_Vec_PTI_Get0(3, int32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int32, arg)) { - glm::vec<4, int32> o = PyGLM_Vec_PTI_Get0(4, int32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint32, arg)) { - glm::vec<1, uint32> o = PyGLM_Vec_PTI_Get0(1, uint32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint32, arg)) { - glm::vec<2, uint32> o = PyGLM_Vec_PTI_Get0(2, uint32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint32, arg)) { - glm::vec<3, uint32> o = PyGLM_Vec_PTI_Get0(3, uint32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint32, arg)) { - glm::vec<4, uint32> o = PyGLM_Vec_PTI_Get0(4, uint32, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) { - glm::vec<1, int64> o = PyGLM_Vec_PTI_Get0(1, int64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) { - glm::vec<2, int64> o = PyGLM_Vec_PTI_Get0(2, int64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) { - glm::vec<3, int64> o = PyGLM_Vec_PTI_Get0(3, int64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) { - glm::vec<4, int64> o = PyGLM_Vec_PTI_Get0(4, int64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint64, arg)) { - glm::vec<1, uint64> o = PyGLM_Vec_PTI_Get0(1, uint64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint64, arg)) { - glm::vec<2, uint64> o = PyGLM_Vec_PTI_Get0(2, uint64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint64, arg)) { - glm::vec<3, uint64> o = PyGLM_Vec_PTI_Get0(3, uint64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint64, arg)) { - glm::vec<4, uint64> o = PyGLM_Vec_PTI_Get0(4, uint64, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int16, arg)) { - glm::vec<1, int16> o = PyGLM_Vec_PTI_Get0(1, int16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int16, arg)) { - glm::vec<2, int16> o = PyGLM_Vec_PTI_Get0(2, int16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int16, arg)) { - glm::vec<3, int16> o = PyGLM_Vec_PTI_Get0(3, int16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int16, arg)) { - glm::vec<4, int16> o = PyGLM_Vec_PTI_Get0(4, int16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint16, arg)) { - glm::vec<1, uint16> o = PyGLM_Vec_PTI_Get0(1, uint16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint16, arg)) { - glm::vec<2, uint16> o = PyGLM_Vec_PTI_Get0(2, uint16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint16, arg)) { - glm::vec<3, uint16> o = PyGLM_Vec_PTI_Get0(3, uint16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint16, arg)) { - glm::vec<4, uint16> o = PyGLM_Vec_PTI_Get0(4, uint16, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, int8, arg)) { - glm::vec<1, int8> o = PyGLM_Vec_PTI_Get0(1, int8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, int8, arg)) { - glm::vec<2, int8> o = PyGLM_Vec_PTI_Get0(2, int8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, int8, arg)) { - glm::vec<3, int8> o = PyGLM_Vec_PTI_Get0(3, int8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, int8, arg)) { - glm::vec<4, int8> o = PyGLM_Vec_PTI_Get0(4, int8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(1, uint8, arg)) { - glm::vec<1, uint8> o = PyGLM_Vec_PTI_Get0(1, uint8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(2, uint8, arg)) { - glm::vec<2, uint8> o = PyGLM_Vec_PTI_Get0(2, uint8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(3, uint8, arg)) { - glm::vec<3, uint8> o = PyGLM_Vec_PTI_Get0(3, uint8, arg); - return pack_vec(glm::findMSB(o)); - } - if (PyGLM_Vec_PTI_Check0(4, uint8, arg)) { - glm::vec<4, uint8> o = PyGLM_Vec_PTI_Get0(4, uint8, arg); - return pack_vec(glm::findMSB(o)); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::findMSB(PyGLM_Vec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_iqsuIQSU, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::findMSB(PyGLM_MVec_Get(L, T, arg))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_iI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for findMSB(): ", arg); return NULL; diff --git a/PyGLM/functions/detail/func_matrix.h b/PyGLM/functions/detail/func_matrix.h index e415660..b59cc92 100644 --- a/PyGLM/functions/detail/func_matrix.h +++ b/PyGLM/functions/detail/func_matrix.h @@ -17,97 +17,27 @@ static PyObject* outerProduct_(PyObject*, PyObject* args) { PyObject *arg1, *arg2; PyGLM_Arg_Unpack_2O(args, "outerProduct", arg1, arg2); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_SHAPE_4 | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_SHAPE_4 | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec2 o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec3 o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec4 o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec3 o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec2 o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec3 o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec3 o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec3 o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec4 o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec2 o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec3 o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec4 o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::dvec2 o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::dvec2 o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::dvec2 o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::dvec3 o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::dvec2 o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::dvec4 o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::dvec3 o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::dvec2 o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::dvec3 o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::dvec3 o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::dvec3 o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::dvec4 o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::dvec4 o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::dvec2 o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::dvec4 o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::dvec3 o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::outerProduct(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::dvec4 o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::dvec4 o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::outerProduct(o, o2)); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (arg2Subtype == reinterpret_cast(PyGLM_VEC_TYPE<2, T>())) \ + return pack(glm::outerProduct(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(2, T, arg2)));\ + if (arg2Subtype == reinterpret_cast(PyGLM_VEC_TYPE<3, T>())) \ + return pack(glm::outerProduct(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(3, T, arg2)));\ + if (arg2Subtype == reinterpret_cast(PyGLM_VEC_TYPE<4, T>())) \ + return pack(glm::outerProduct(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(4, T, arg2)));\ + break; + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for outerProduct(): ", arg1, arg2); return NULL; diff --git a/PyGLM/functions/detail/func_packing.h b/PyGLM/functions/detail/func_packing.h index 3e1b764..fb69de0 100644 --- a/PyGLM/functions/detail/func_packing.h +++ b/PyGLM/functions/detail/func_packing.h @@ -16,9 +16,8 @@ PyDoc_STRVAR(packDouble2x32_docstr, ); static PyObject* packDouble2x32_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_UINT); - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg)) { - glm::uvec2 o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg); + if (PyGLM_Vec_Check(2, uint32, arg)) { + glm::uvec2 o = PyGLM_VecOrMVec_GET(2, uint32, arg); return PyFloat_FromDouble(glm::packDouble2x32(o)); } PyGLM_TYPEERROR_O("invalid argument type for packDouble2x32(): ", arg); @@ -36,10 +35,9 @@ PyDoc_STRVAR(packUnorm2x16_docstr, ); static PyObject* packUnorm2x16_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg); - return PyLong_FromLong((long)glm::packUnorm2x16(o)); + if (PyGLM_Vec_Check(2, float, arg)) { + glm::vec2 o = PyGLM_VecOrMVec_GET(2, float, arg); + return pack(glm::packUnorm2x16(o)); } PyGLM_TYPEERROR_O("invalid argument type for packUnorm2x16(): ", arg); return NULL; @@ -56,10 +54,9 @@ PyDoc_STRVAR(packSnorm2x16_docstr, ); static PyObject* packSnorm2x16_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg); - return PyLong_FromLong((long)glm::packSnorm2x16(o)); + if (PyGLM_Vec_Check(2, float, arg)) { + glm::vec2 o = PyGLM_VecOrMVec_GET(2, float, arg); + return pack(glm::packSnorm2x16(o)); } PyGLM_TYPEERROR_O("invalid argument type for packSnorm2x16(): ", arg); return NULL; @@ -76,10 +73,9 @@ PyDoc_STRVAR(packUnorm4x8_docstr, ); static PyObject* packUnorm4x8_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(4, float, arg)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg); - return PyLong_FromLong((long)glm::packUnorm4x8(o)); + if (PyGLM_Vec_Check(4, float, arg)) { + glm::vec4 o = PyGLM_VecOrMVec_GET(4, float, arg); + return pack(glm::packUnorm4x8(o)); } PyGLM_TYPEERROR_O("invalid argument type for packUnorm4x8(): ", arg); return NULL; @@ -96,10 +92,9 @@ PyDoc_STRVAR(packSnorm4x8_docstr, ); static PyObject* packSnorm4x8_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(4, float, arg)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg); - return PyLong_FromLong((long)glm::packSnorm4x8(o)); + if (PyGLM_Vec_Check(4, float, arg)) { + glm::vec4 o = PyGLM_VecOrMVec_GET(4, float, arg); + return pack(glm::packSnorm4x8(o)); } PyGLM_TYPEERROR_O("invalid argument type for packSnorm4x8(): ", arg); return NULL; @@ -115,10 +110,9 @@ PyDoc_STRVAR(packHalf2x16_docstr, ); static PyObject* packHalf2x16_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FLOAT); - if (PyGLM_Vec_PTI_Check0(2, float, arg)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg); - return PyLong_FromUnsignedLong((unsigned long)glm::packHalf2x16(o)); + if (PyGLM_Vec_Check(2, float, arg)) { + glm::vec2 o = PyGLM_VecOrMVec_GET(2, float, arg); + return pack(glm::packHalf2x16(o)); } PyGLM_TYPEERROR_O("invalid argument type for packHalf2x16(): ", arg); return NULL; diff --git a/PyGLM/functions/detail/func_trigonometric.h b/PyGLM/functions/detail/func_trigonometric.h index f23f996..4775a57 100644 --- a/PyGLM/functions/detail/func_trigonometric.h +++ b/PyGLM/functions/detail/func_trigonometric.h @@ -90,91 +90,49 @@ atan_(PyObject*, PyObject* args) { } if (arg2 != NULL) { + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::atan(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } + } if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { return pack(glm::atan(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec1 o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec1 o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec2 o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec3 o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec3 o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec4 o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::dvec1 o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::dvec1 o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::dvec2 o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::dvec2 o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::dvec3 o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::dvec3 o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::atan(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::dvec4 o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::dvec4 o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::atan(o, o2)); - } PyGLM_TYPEERROR_2O("invalid argument type(s) for atan(): ", arg1, arg2); return NULL; } + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::atan(PyGLM_Vec_Get(L, T, arg1))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetMVec(): \ + return pack(glm::atan(PyGLM_MVec_Get(L, T, arg1))); + + PyGLM_CODEGEN_PARAM_L_MVEC(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } if (PyGLM_Number_Check(arg1)) { return pack(glm::atan(PyGLM_Number_FromPyObject(arg1))); } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1)) { - glm::vec1 o = PyGLM_Vec_PTI_Get0(1, float, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1)) { - glm::vec2 o = PyGLM_Vec_PTI_Get0(2, float, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1)) { - glm::vec3 o = PyGLM_Vec_PTI_Get0(3, float, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1)) { - glm::vec4 o = PyGLM_Vec_PTI_Get0(4, float, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1)) { - glm::dvec1 o = PyGLM_Vec_PTI_Get0(1, double, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1)) { - glm::dvec2 o = PyGLM_Vec_PTI_Get0(2, double, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1)) { - glm::dvec3 o = PyGLM_Vec_PTI_Get0(3, double, arg1); - return pack(glm::atan(o)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1)) { - glm::dvec4 o = PyGLM_Vec_PTI_Get0(4, double, arg1); - return pack(glm::atan(o)); - } PyGLM_TYPEERROR_O("invalid argument type for atan(): ", arg1); return NULL; } diff --git a/PyGLM/functions/detail/func_vector_relational.h b/PyGLM/functions/detail/func_vector_relational.h index 8ce124e..080e6ca 100644 --- a/PyGLM/functions/detail/func_vector_relational.h +++ b/PyGLM/functions/detail/func_vector_relational.h @@ -44,1090 +44,164 @@ equal(PyObject*, PyObject* args) { PyObject *arg1, *arg2, *arg3 = NULL; if (!PyArg_UnpackTuple(args, "equal", 2, 3, &arg1, &arg2, &arg3)) return NULL; if (arg3 == NULL) { - PyGLM_PTI_Init0(arg1, PyGLM_T_ALL | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_ALL | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) { - glm::vec<1, int> o = PyGLM_Vec_PTI_Get0(1, int, arg1); - glm::vec<1, int> o2 = PyGLM_Vec_PTI_Get1(1, int, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - glm::vec<1, glm::uint> o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::vec<1, glm::uint> o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - glm::vec<1, glm::i64> o = PyGLM_Vec_PTI_Get0(1, glm::i64, arg1); - glm::vec<1, glm::i64> o2 = PyGLM_Vec_PTI_Get1(1, glm::i64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - glm::vec<1, glm::u64> o = PyGLM_Vec_PTI_Get0(1, glm::u64, arg1); - glm::vec<1, glm::u64> o2 = PyGLM_Vec_PTI_Get1(1, glm::u64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - glm::vec<1, glm::i16> o = PyGLM_Vec_PTI_Get0(1, glm::i16, arg1); - glm::vec<1, glm::i16> o2 = PyGLM_Vec_PTI_Get1(1, glm::i16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - glm::vec<1, glm::u16> o = PyGLM_Vec_PTI_Get0(1, glm::u16, arg1); - glm::vec<1, glm::u16> o2 = PyGLM_Vec_PTI_Get1(1, glm::u16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - glm::vec<1, glm::i8> o = PyGLM_Vec_PTI_Get0(1, glm::i8, arg1); - glm::vec<1, glm::i8> o2 = PyGLM_Vec_PTI_Get1(1, glm::i8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - glm::vec<1, glm::u8> o = PyGLM_Vec_PTI_Get0(1, glm::u8, arg1); - glm::vec<1, glm::u8> o2 = PyGLM_Vec_PTI_Get1(1, glm::u8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - glm::vec<1, bool> o = PyGLM_Vec_PTI_Get0(1, bool, arg1); - glm::vec<1, bool> o2 = PyGLM_Vec_PTI_Get1(1, bool, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) { - glm::vec<2, int> o = PyGLM_Vec_PTI_Get0(2, int, arg1); - glm::vec<2, int> o2 = PyGLM_Vec_PTI_Get1(2, int, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - glm::vec<2, glm::uint> o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::vec<2, glm::uint> o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - glm::vec<2, glm::i64> o = PyGLM_Vec_PTI_Get0(2, glm::i64, arg1); - glm::vec<2, glm::i64> o2 = PyGLM_Vec_PTI_Get1(2, glm::i64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - glm::vec<2, glm::u64> o = PyGLM_Vec_PTI_Get0(2, glm::u64, arg1); - glm::vec<2, glm::u64> o2 = PyGLM_Vec_PTI_Get1(2, glm::u64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - glm::vec<2, glm::i16> o = PyGLM_Vec_PTI_Get0(2, glm::i16, arg1); - glm::vec<2, glm::i16> o2 = PyGLM_Vec_PTI_Get1(2, glm::i16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - glm::vec<2, glm::u16> o = PyGLM_Vec_PTI_Get0(2, glm::u16, arg1); - glm::vec<2, glm::u16> o2 = PyGLM_Vec_PTI_Get1(2, glm::u16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - glm::vec<2, glm::i8> o = PyGLM_Vec_PTI_Get0(2, glm::i8, arg1); - glm::vec<2, glm::i8> o2 = PyGLM_Vec_PTI_Get1(2, glm::i8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - glm::vec<2, glm::u8> o = PyGLM_Vec_PTI_Get0(2, glm::u8, arg1); - glm::vec<2, glm::u8> o2 = PyGLM_Vec_PTI_Get1(2, glm::u8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - glm::vec<2, bool> o = PyGLM_Vec_PTI_Get0(2, bool, arg1); - glm::vec<2, bool> o2 = PyGLM_Vec_PTI_Get1(2, bool, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) { - glm::vec<3, int> o = PyGLM_Vec_PTI_Get0(3, int, arg1); - glm::vec<3, int> o2 = PyGLM_Vec_PTI_Get1(3, int, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - glm::vec<3, glm::uint> o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::vec<3, glm::uint> o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - glm::vec<3, glm::i64> o = PyGLM_Vec_PTI_Get0(3, glm::i64, arg1); - glm::vec<3, glm::i64> o2 = PyGLM_Vec_PTI_Get1(3, glm::i64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - glm::vec<3, glm::u64> o = PyGLM_Vec_PTI_Get0(3, glm::u64, arg1); - glm::vec<3, glm::u64> o2 = PyGLM_Vec_PTI_Get1(3, glm::u64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - glm::vec<3, glm::i16> o = PyGLM_Vec_PTI_Get0(3, glm::i16, arg1); - glm::vec<3, glm::i16> o2 = PyGLM_Vec_PTI_Get1(3, glm::i16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - glm::vec<3, glm::u16> o = PyGLM_Vec_PTI_Get0(3, glm::u16, arg1); - glm::vec<3, glm::u16> o2 = PyGLM_Vec_PTI_Get1(3, glm::u16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - glm::vec<3, glm::i8> o = PyGLM_Vec_PTI_Get0(3, glm::i8, arg1); - glm::vec<3, glm::i8> o2 = PyGLM_Vec_PTI_Get1(3, glm::i8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - glm::vec<3, glm::u8> o = PyGLM_Vec_PTI_Get0(3, glm::u8, arg1); - glm::vec<3, glm::u8> o2 = PyGLM_Vec_PTI_Get1(3, glm::u8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - glm::vec<3, bool> o = PyGLM_Vec_PTI_Get0(3, bool, arg1); - glm::vec<3, bool> o2 = PyGLM_Vec_PTI_Get1(3, bool, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) { - glm::vec<4, int> o = PyGLM_Vec_PTI_Get0(4, int, arg1); - glm::vec<4, int> o2 = PyGLM_Vec_PTI_Get1(4, int, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - glm::vec<4, glm::uint> o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::vec<4, glm::uint> o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - glm::vec<4, glm::i64> o = PyGLM_Vec_PTI_Get0(4, glm::i64, arg1); - glm::vec<4, glm::i64> o2 = PyGLM_Vec_PTI_Get1(4, glm::i64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - glm::vec<4, glm::u64> o = PyGLM_Vec_PTI_Get0(4, glm::u64, arg1); - glm::vec<4, glm::u64> o2 = PyGLM_Vec_PTI_Get1(4, glm::u64, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - glm::vec<4, glm::i16> o = PyGLM_Vec_PTI_Get0(4, glm::i16, arg1); - glm::vec<4, glm::i16> o2 = PyGLM_Vec_PTI_Get1(4, glm::i16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - glm::vec<4, glm::u16> o = PyGLM_Vec_PTI_Get0(4, glm::u16, arg1); - glm::vec<4, glm::u16> o2 = PyGLM_Vec_PTI_Get1(4, glm::u16, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - glm::vec<4, glm::i8> o = PyGLM_Vec_PTI_Get0(4, glm::i8, arg1); - glm::vec<4, glm::i8> o2 = PyGLM_Vec_PTI_Get1(4, glm::i8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - glm::vec<4, glm::u8> o = PyGLM_Vec_PTI_Get0(4, glm::u8, arg1); - glm::vec<4, glm::u8> o2 = PyGLM_Vec_PTI_Get1(4, glm::u8, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - glm::vec<4, bool> o = PyGLM_Vec_PTI_Get0(4, bool, arg1); - glm::vec<4, bool> o2 = PyGLM_Vec_PTI_Get1(4, bool, arg2); - return pack(glm::equal(o, o2)); - } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); - if (PyGLM_Mat_Check(2, 2, float, arg1) && PyGLM_Mat_Check(2, 2, float, arg2)) { - glm::mat<2, 2, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(2, 2, double, arg1) && PyGLM_Mat_Check(2, 2, double, arg2)) { - glm::mat<2, 2, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(2, 2, int, arg1) && PyGLM_Mat_Check(2, 2, int, arg2)) { - // glm::mat<2, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(2, 2, glm::uint, arg1) && PyGLM_Mat_Check(2, 2, glm::uint, arg2)) { - glm::mat<2, 2, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(2, 3, float, arg1) && PyGLM_Mat_Check(2, 3, float, arg2)) { - glm::mat<2, 3, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(2, 3, double, arg1) && PyGLM_Mat_Check(2, 3, double, arg2)) { - glm::mat<2, 3, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(2, 3, int, arg1) && PyGLM_Mat_Check(2, 3, int, arg2)) { - // glm::mat<2, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(2, 3, glm::uint, arg1) && PyGLM_Mat_Check(2, 3, glm::uint, arg2)) { - glm::mat<2, 3, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(2, 4, float, arg1) && PyGLM_Mat_Check(2, 4, float, arg2)) { - glm::mat<2, 4, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(2, 4, double, arg1) && PyGLM_Mat_Check(2, 4, double, arg2)) { - glm::mat<2, 4, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(2, 4, int, arg1) && PyGLM_Mat_Check(2, 4, int, arg2)) { - // glm::mat<2, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(2, 4, glm::uint, arg1) && PyGLM_Mat_Check(2, 4, glm::uint, arg2)) { - glm::mat<2, 4, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 2, float, arg1) && PyGLM_Mat_Check(3, 2, float, arg2)) { - glm::mat<3, 2, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 2, double, arg1) && PyGLM_Mat_Check(3, 2, double, arg2)) { - glm::mat<3, 2, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(3, 2, int, arg1) && PyGLM_Mat_Check(3, 2, int, arg2)) { - // glm::mat<3, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(3, 2, glm::uint, arg1) && PyGLM_Mat_Check(3, 2, glm::uint, arg2)) { - glm::mat<3, 2, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 3, float, arg1) && PyGLM_Mat_Check(3, 3, float, arg2)) { - glm::mat<3, 3, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 3, double, arg1) && PyGLM_Mat_Check(3, 3, double, arg2)) { - glm::mat<3, 3, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(3, 3, int, arg1) && PyGLM_Mat_Check(3, 3, int, arg2)) { - // glm::mat<3, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(3, 3, glm::uint, arg1) && PyGLM_Mat_Check(3, 3, glm::uint, arg2)) { - glm::mat<3, 3, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 4, float, arg1) && PyGLM_Mat_Check(3, 4, float, arg2)) { - glm::mat<3, 4, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(3, 4, double, arg1) && PyGLM_Mat_Check(3, 4, double, arg2)) { - glm::mat<3, 4, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(3, 4, int, arg1) && PyGLM_Mat_Check(3, 4, int, arg2)) { - // glm::mat<3, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(3, 4, glm::uint, arg1) && PyGLM_Mat_Check(3, 4, glm::uint, arg2)) { - glm::mat<3, 4, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 2, float, arg1) && PyGLM_Mat_Check(4, 2, float, arg2)) { - glm::mat<4, 2, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 2, double, arg1) && PyGLM_Mat_Check(4, 2, double, arg2)) { - glm::mat<4, 2, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(4, 2, int, arg1) && PyGLM_Mat_Check(4, 2, int, arg2)) { - // glm::mat<4, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(4, 2, glm::uint, arg1) && PyGLM_Mat_Check(4, 2, glm::uint, arg2)) { - glm::mat<4, 2, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 3, float, arg1) && PyGLM_Mat_Check(4, 3, float, arg2)) { - glm::mat<4, 3, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 3, double, arg1) && PyGLM_Mat_Check(4, 3, double, arg2)) { - glm::mat<4, 3, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(4, 3, int, arg1) && PyGLM_Mat_Check(4, 3, int, arg2)) { - // glm::mat<4, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(4, 3, glm::uint, arg1) && PyGLM_Mat_Check(4, 3, glm::uint, arg2)) { - glm::mat<4, 3, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 4, float, arg1) && PyGLM_Mat_Check(4, 4, float, arg2)) { - glm::mat<4, 4, float> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Mat_Check(4, 4, double, arg1) && PyGLM_Mat_Check(4, 4, double, arg2)) { - glm::mat<4, 4, double> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } - //if (PyGLM_Mat_Check(4, 4, int, arg1) && PyGLM_Mat_Check(4, 4, int, arg2)) { - // glm::mat<4, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::equal(o, o2)); - //} - if (PyGLM_Mat_Check(4, 4, glm::uint, arg1) && PyGLM_Mat_Check(4, 4, glm::uint, arg2)) { - glm::mat<4, 4, glm::uint> o, o2; - unpack_mat(arg1, o); - unpack_mat(arg2, o2); - return pack(glm::equal(o, o2)); - } + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack(glm::equal(o, o2)); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack(glm::equal(o, o2)); + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::equal(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::equal(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fFiI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::equal(PyGLM_Qua_Get(T, arg1), PyGLM_Qua_Get(T, arg2))); + + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for equal(): ", arg1, arg2); return NULL; } if (PyLong_Check(arg3)) { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::equal(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + const int o3 = PyGLM_Number_FromPyObject(arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::equal(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), o3)); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::equal(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), o3)); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { + return pack(glm::equal(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); return NULL; } if (PyGLM_Number_Check(arg3)) { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::equal(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_T_QUA | PyGLM_SHAPE_NxM | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_T_QUA | PyGLM_SHAPE_NxM | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack(glm::equal(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_FD); - - if (PyGLM_Vec_PTI_Check2(1, int, arg3)) { - glm::vec<1, int> o3 = PyGLM_Vec_PTI_Get2(1, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_1 | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::equal(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Vec_PTI_Check2(2, int, arg3)) { - glm::vec<2, int> o3 = PyGLM_Vec_PTI_Get2(2, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_2 | PyGLM_SHAPE_2xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_2 | PyGLM_SHAPE_2xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::equal(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Vec_PTI_Check2(3, int, arg3)) { - glm::vec<3, int> o3 = PyGLM_Vec_PTI_Get2(3, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_3 | PyGLM_SHAPE_3xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_3 | PyGLM_SHAPE_3xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::equal(PyGLM_Qua_Get(T, arg1), PyGLM_Qua_Get(T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Vec_PTI_Check2(4, int, arg3)) { - glm::vec<4, int> o3 = PyGLM_Vec_PTI_Get2(4, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_4 | PyGLM_SHAPE_4xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_4 | PyGLM_SHAPE_4xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::equal(o, o2, o3)); - } + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); + + } + } } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { + return pack(glm::equal(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); return NULL; } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack(glm::equal(o, o2, o3)); - } + if (arg1Subtype == arg2Subtype && arg1Subtype->C == arg3Subtype->C && arg3Subtype->glmType == PyGLM_TYPE_VEC) { + if (arg3Subtype->format == PyGLM_FS_INT32) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::equal(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, int32, arg2))); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::equal(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::equal(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::equal(o, o2, o3)); + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::equal(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_VecOrMVec_Get(C, int32, arg3))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } + if (arg3Subtype->format == arg1Subtype->format) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::equal(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::equal(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_VecOrMVec_Get(C, T, arg3))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); - return NULL; } + PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for equal()"); return NULL; } @@ -1138,1064 +212,167 @@ PyDoc_STRVAR(notEqual_docstr, ); static PyObject* notEqual(PyObject*, PyObject* args) { - PyObject *arg1, *arg2, *arg3 = NULL; + PyObject* arg1, * arg2, * arg3 = NULL; if (!PyArg_UnpackTuple(args, "notEqual", 2, 3, &arg1, &arg2, &arg3)) return NULL; if (arg3 == NULL) { - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_ALL); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) { - glm::vec<1, int> o = PyGLM_Vec_PTI_Get0(1, int, arg1); - glm::vec<1, int> o2 = PyGLM_Vec_PTI_Get1(1, int, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(1, glm::uint, arg2)) { - glm::vec<1, glm::uint> o = PyGLM_Vec_PTI_Get0(1, glm::uint, arg1); - glm::vec<1, glm::uint> o2 = PyGLM_Vec_PTI_Get1(1, glm::uint, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i64, arg2)) { - glm::vec<1, glm::i64> o = PyGLM_Vec_PTI_Get0(1, glm::i64, arg1); - glm::vec<1, glm::i64> o2 = PyGLM_Vec_PTI_Get1(1, glm::i64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u64, arg2)) { - glm::vec<1, glm::u64> o = PyGLM_Vec_PTI_Get0(1, glm::u64, arg1); - glm::vec<1, glm::u64> o2 = PyGLM_Vec_PTI_Get1(1, glm::u64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i16, arg2)) { - glm::vec<1, glm::i16> o = PyGLM_Vec_PTI_Get0(1, glm::i16, arg1); - glm::vec<1, glm::i16> o2 = PyGLM_Vec_PTI_Get1(1, glm::i16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u16, arg2)) { - glm::vec<1, glm::u16> o = PyGLM_Vec_PTI_Get0(1, glm::u16, arg1); - glm::vec<1, glm::u16> o2 = PyGLM_Vec_PTI_Get1(1, glm::u16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::i8, arg2)) { - glm::vec<1, glm::i8> o = PyGLM_Vec_PTI_Get0(1, glm::i8, arg1); - glm::vec<1, glm::i8> o2 = PyGLM_Vec_PTI_Get1(1, glm::i8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(1, glm::u8, arg2)) { - glm::vec<1, glm::u8> o = PyGLM_Vec_PTI_Get0(1, glm::u8, arg1); - glm::vec<1, glm::u8> o2 = PyGLM_Vec_PTI_Get1(1, glm::u8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) { - glm::vec<1, bool> o = PyGLM_Vec_PTI_Get0(1, bool, arg1); - glm::vec<1, bool> o2 = PyGLM_Vec_PTI_Get1(1, bool, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) { - glm::vec<2, int> o = PyGLM_Vec_PTI_Get0(2, int, arg1); - glm::vec<2, int> o2 = PyGLM_Vec_PTI_Get1(2, int, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(2, glm::uint, arg2)) { - glm::vec<2, glm::uint> o = PyGLM_Vec_PTI_Get0(2, glm::uint, arg1); - glm::vec<2, glm::uint> o2 = PyGLM_Vec_PTI_Get1(2, glm::uint, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i64, arg2)) { - glm::vec<2, glm::i64> o = PyGLM_Vec_PTI_Get0(2, glm::i64, arg1); - glm::vec<2, glm::i64> o2 = PyGLM_Vec_PTI_Get1(2, glm::i64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u64, arg2)) { - glm::vec<2, glm::u64> o = PyGLM_Vec_PTI_Get0(2, glm::u64, arg1); - glm::vec<2, glm::u64> o2 = PyGLM_Vec_PTI_Get1(2, glm::u64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i16, arg2)) { - glm::vec<2, glm::i16> o = PyGLM_Vec_PTI_Get0(2, glm::i16, arg1); - glm::vec<2, glm::i16> o2 = PyGLM_Vec_PTI_Get1(2, glm::i16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u16, arg2)) { - glm::vec<2, glm::u16> o = PyGLM_Vec_PTI_Get0(2, glm::u16, arg1); - glm::vec<2, glm::u16> o2 = PyGLM_Vec_PTI_Get1(2, glm::u16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::i8, arg2)) { - glm::vec<2, glm::i8> o = PyGLM_Vec_PTI_Get0(2, glm::i8, arg1); - glm::vec<2, glm::i8> o2 = PyGLM_Vec_PTI_Get1(2, glm::i8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(2, glm::u8, arg2)) { - glm::vec<2, glm::u8> o = PyGLM_Vec_PTI_Get0(2, glm::u8, arg1); - glm::vec<2, glm::u8> o2 = PyGLM_Vec_PTI_Get1(2, glm::u8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) { - glm::vec<2, bool> o = PyGLM_Vec_PTI_Get0(2, bool, arg1); - glm::vec<2, bool> o2 = PyGLM_Vec_PTI_Get1(2, bool, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) { - glm::vec<3, int> o = PyGLM_Vec_PTI_Get0(3, int, arg1); - glm::vec<3, int> o2 = PyGLM_Vec_PTI_Get1(3, int, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(3, glm::uint, arg2)) { - glm::vec<3, glm::uint> o = PyGLM_Vec_PTI_Get0(3, glm::uint, arg1); - glm::vec<3, glm::uint> o2 = PyGLM_Vec_PTI_Get1(3, glm::uint, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i64, arg2)) { - glm::vec<3, glm::i64> o = PyGLM_Vec_PTI_Get0(3, glm::i64, arg1); - glm::vec<3, glm::i64> o2 = PyGLM_Vec_PTI_Get1(3, glm::i64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u64, arg2)) { - glm::vec<3, glm::u64> o = PyGLM_Vec_PTI_Get0(3, glm::u64, arg1); - glm::vec<3, glm::u64> o2 = PyGLM_Vec_PTI_Get1(3, glm::u64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i16, arg2)) { - glm::vec<3, glm::i16> o = PyGLM_Vec_PTI_Get0(3, glm::i16, arg1); - glm::vec<3, glm::i16> o2 = PyGLM_Vec_PTI_Get1(3, glm::i16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u16, arg2)) { - glm::vec<3, glm::u16> o = PyGLM_Vec_PTI_Get0(3, glm::u16, arg1); - glm::vec<3, glm::u16> o2 = PyGLM_Vec_PTI_Get1(3, glm::u16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::i8, arg2)) { - glm::vec<3, glm::i8> o = PyGLM_Vec_PTI_Get0(3, glm::i8, arg1); - glm::vec<3, glm::i8> o2 = PyGLM_Vec_PTI_Get1(3, glm::i8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(3, glm::u8, arg2)) { - glm::vec<3, glm::u8> o = PyGLM_Vec_PTI_Get0(3, glm::u8, arg1); - glm::vec<3, glm::u8> o2 = PyGLM_Vec_PTI_Get1(3, glm::u8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) { - glm::vec<3, bool> o = PyGLM_Vec_PTI_Get0(3, bool, arg1); - glm::vec<3, bool> o2 = PyGLM_Vec_PTI_Get1(3, bool, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) { - glm::vec<4, int> o = PyGLM_Vec_PTI_Get0(4, int, arg1); - glm::vec<4, int> o2 = PyGLM_Vec_PTI_Get1(4, int, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::uint, arg1) && PyGLM_Vec_PTI_Check1(4, glm::uint, arg2)) { - glm::vec<4, glm::uint> o = PyGLM_Vec_PTI_Get0(4, glm::uint, arg1); - glm::vec<4, glm::uint> o2 = PyGLM_Vec_PTI_Get1(4, glm::uint, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i64, arg2)) { - glm::vec<4, glm::i64> o = PyGLM_Vec_PTI_Get0(4, glm::i64, arg1); - glm::vec<4, glm::i64> o2 = PyGLM_Vec_PTI_Get1(4, glm::i64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u64, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u64, arg2)) { - glm::vec<4, glm::u64> o = PyGLM_Vec_PTI_Get0(4, glm::u64, arg1); - glm::vec<4, glm::u64> o2 = PyGLM_Vec_PTI_Get1(4, glm::u64, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i16, arg2)) { - glm::vec<4, glm::i16> o = PyGLM_Vec_PTI_Get0(4, glm::i16, arg1); - glm::vec<4, glm::i16> o2 = PyGLM_Vec_PTI_Get1(4, glm::i16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u16, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u16, arg2)) { - glm::vec<4, glm::u16> o = PyGLM_Vec_PTI_Get0(4, glm::u16, arg1); - glm::vec<4, glm::u16> o2 = PyGLM_Vec_PTI_Get1(4, glm::u16, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::i8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::i8, arg2)) { - glm::vec<4, glm::i8> o = PyGLM_Vec_PTI_Get0(4, glm::i8, arg1); - glm::vec<4, glm::i8> o2 = PyGLM_Vec_PTI_Get1(4, glm::i8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, glm::u8, arg1) && PyGLM_Vec_PTI_Check1(4, glm::u8, arg2)) { - glm::vec<4, glm::u8> o = PyGLM_Vec_PTI_Get0(4, glm::u8, arg1); - glm::vec<4, glm::u8> o2 = PyGLM_Vec_PTI_Get1(4, glm::u8, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) { - glm::vec<4, bool> o = PyGLM_Vec_PTI_Get0(4, bool, arg1); - glm::vec<4, bool> o2 = PyGLM_Vec_PTI_Get1(4, bool, arg2); - return pack(glm::notEqual(o, o2)); - } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); - //if (PyGLM_Mat_Check(2, 2, float, arg1) && PyGLM_Mat_Check(2, 2, float, arg2)) { - // glm::mat<2, 2, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 2, double, arg1) && PyGLM_Mat_Check(2, 2, double, arg2)) { - // glm::mat<2, 2, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 2, int, arg1) && PyGLM_Mat_Check(2, 2, int, arg2)) { - // glm::mat<2, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 2, glm::uint, arg1) && PyGLM_Mat_Check(2, 2, glm::uint, arg2)) { - // glm::mat<2, 2, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 3, float, arg1) && PyGLM_Mat_Check(2, 3, float, arg2)) { - // glm::mat<2, 3, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 3, double, arg1) && PyGLM_Mat_Check(2, 3, double, arg2)) { - // glm::mat<2, 3, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 3, int, arg1) && PyGLM_Mat_Check(2, 3, int, arg2)) { - // glm::mat<2, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 3, glm::uint, arg1) && PyGLM_Mat_Check(2, 3, glm::uint, arg2)) { - // glm::mat<2, 3, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 4, float, arg1) && PyGLM_Mat_Check(2, 4, float, arg2)) { - // glm::mat<2, 4, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 4, double, arg1) && PyGLM_Mat_Check(2, 4, double, arg2)) { - // glm::mat<2, 4, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 4, int, arg1) && PyGLM_Mat_Check(2, 4, int, arg2)) { - // glm::mat<2, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(2, 4, glm::uint, arg1) && PyGLM_Mat_Check(2, 4, glm::uint, arg2)) { - // glm::mat<2, 4, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 2, float, arg1) && PyGLM_Mat_Check(3, 2, float, arg2)) { - // glm::mat<3, 2, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 2, double, arg1) && PyGLM_Mat_Check(3, 2, double, arg2)) { - // glm::mat<3, 2, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 2, int, arg1) && PyGLM_Mat_Check(3, 2, int, arg2)) { - // glm::mat<3, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 2, glm::uint, arg1) && PyGLM_Mat_Check(3, 2, glm::uint, arg2)) { - // glm::mat<3, 2, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 3, float, arg1) && PyGLM_Mat_Check(3, 3, float, arg2)) { - // glm::mat<3, 3, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 3, double, arg1) && PyGLM_Mat_Check(3, 3, double, arg2)) { - // glm::mat<3, 3, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 3, int, arg1) && PyGLM_Mat_Check(3, 3, int, arg2)) { - // glm::mat<3, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 3, glm::uint, arg1) && PyGLM_Mat_Check(3, 3, glm::uint, arg2)) { - // glm::mat<3, 3, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 4, float, arg1) && PyGLM_Mat_Check(3, 4, float, arg2)) { - // glm::mat<3, 4, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 4, double, arg1) && PyGLM_Mat_Check(3, 4, double, arg2)) { - // glm::mat<3, 4, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 4, int, arg1) && PyGLM_Mat_Check(3, 4, int, arg2)) { - // glm::mat<3, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(3, 4, glm::uint, arg1) && PyGLM_Mat_Check(3, 4, glm::uint, arg2)) { - // glm::mat<3, 4, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 2, float, arg1) && PyGLM_Mat_Check(4, 2, float, arg2)) { - // glm::mat<4, 2, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 2, double, arg1) && PyGLM_Mat_Check(4, 2, double, arg2)) { - // glm::mat<4, 2, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 2, int, arg1) && PyGLM_Mat_Check(4, 2, int, arg2)) { - // glm::mat<4, 2, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 2, glm::uint, arg1) && PyGLM_Mat_Check(4, 2, glm::uint, arg2)) { - // glm::mat<4, 2, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 3, float, arg1) && PyGLM_Mat_Check(4, 3, float, arg2)) { - // glm::mat<4, 3, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 3, double, arg1) && PyGLM_Mat_Check(4, 3, double, arg2)) { - // glm::mat<4, 3, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 3, int, arg1) && PyGLM_Mat_Check(4, 3, int, arg2)) { - // glm::mat<4, 3, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 3, glm::uint, arg1) && PyGLM_Mat_Check(4, 3, glm::uint, arg2)) { - // glm::mat<4, 3, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 4, float, arg1) && PyGLM_Mat_Check(4, 4, float, arg2)) { - // glm::mat<4, 4, float> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 4, double, arg1) && PyGLM_Mat_Check(4, 4, double, arg2)) { - // glm::mat<4, 4, double> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 4, int, arg1) && PyGLM_Mat_Check(4, 4, int, arg2)) { - // glm::mat<4, 4, int> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - //if (PyGLM_Mat_Check(4, 4, glm::uint, arg1) && PyGLM_Mat_Check(4, 4, glm::uint, arg2)) { - // glm::mat<4, 4, glm::uint> o, o2; - // unpack_mat(arg1, o); - // unpack_mat(arg2, o2); - // return pack(glm::notEqual(o, o2)); - //} - - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack(glm::notEqual(o, o2)); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack(glm::notEqual(o, o2)); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::notEqual(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::notEqual(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fFiI, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::notEqual(PyGLM_Qua_Get(T, arg1), PyGLM_Qua_Get(T, arg2))); + + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } PyGLM_TYPEERROR_2O("invalid argument type(s) for notEqual(): ", arg1, arg2); return NULL; } if (PyLong_Check(arg3)) { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - return pack(glm::notEqual(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + const int o3 = PyGLM_Number_FromPyObject(arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::notEqual(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), o3)); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::notEqual(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), o3)); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { + return pack(glm::notEqual(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); return NULL; } if (PyGLM_Number_Check(arg3)) { - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { - pack(glm::notEqual(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); - } - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_T_QUA | PyGLM_SHAPE_NxM | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_SHAPE_4 | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_T_QUA | PyGLM_SHAPE_NxM | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_SHAPE_4 | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(float, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(float, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) { - glm::qua o = PyGLM_Qua_PTI_Get0(double, arg1); - glm::qua o2 = PyGLM_Qua_PTI_Get1(double, arg2); - return pack(glm::notEqual(o, o2, PyGLM_Number_FromPyObject(arg3))); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_SHAPE_4 | PyGLM_DT_INT | PyGLM_DT_FD) - if (PyGLM_Vec_PTI_Check2(2, int, arg3)) { - glm::vec<2, int> o3 = PyGLM_Vec_PTI_Get2(2, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_2 | PyGLM_SHAPE_2xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_2 | PyGLM_SHAPE_2xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } + if (arg1Subtype == arg2Subtype) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::notEqual(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE - if (PyGLM_Vec_PTI_Check2(3, int, arg3)) { - glm::vec<3, int> o3 = PyGLM_Vec_PTI_Get2(3, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_3 | PyGLM_SHAPE_3xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_3 | PyGLM_SHAPE_3xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::notEqual(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE - if (PyGLM_Vec_PTI_Check2(4, int, arg3)) { - glm::vec<4, int> o3 = PyGLM_Vec_PTI_Get2(4, int, arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_4 | PyGLM_SHAPE_4xM | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_4 | PyGLM_SHAPE_4xM | PyGLM_DT_FD); - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } +#define PyGLM_FUNC_TEMPLATE(T) \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::notEqual(PyGLM_Qua_Get(T, arg1), PyGLM_Qua_Get(T, arg2), PyGLM_Number_FromPyObject(arg3))); - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + + + } + } } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) { + return pack(glm::notEqual(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3))); } PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); return NULL; } + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { + GET_PyGLM_ARG_TYPE(arg1); + GET_PyGLM_ARG_TYPE(arg2); + GET_PyGLM_ARG_TYPE(arg3); - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD); + GET_PyGLM_ARG_SUBTYPE(arg1); + GET_PyGLM_ARG_SUBTYPE(arg2); + GET_PyGLM_ARG_SUBTYPE(arg3); - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) { - glm::vec<1, float> o = PyGLM_Vec_PTI_Get0(1, float, arg1); - glm::vec<1, float> o2 = PyGLM_Vec_PTI_Get1(1, float, arg2); - glm::vec<1, float> o3 = PyGLM_Vec_PTI_Get2(1, float, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) { - glm::vec<1, double> o = PyGLM_Vec_PTI_Get0(1, double, arg1); - glm::vec<1, double> o2 = PyGLM_Vec_PTI_Get1(1, double, arg2); - glm::vec<1, double> o3 = PyGLM_Vec_PTI_Get2(1, double, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o = PyGLM_Vec_PTI_Get0(2, float, arg1); - glm::vec<2, float> o2 = PyGLM_Vec_PTI_Get1(2, float, arg2); - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o = PyGLM_Vec_PTI_Get0(2, double, arg1); - glm::vec<2, double> o2 = PyGLM_Vec_PTI_Get1(2, double, arg2); - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o = PyGLM_Vec_PTI_Get0(3, float, arg1); - glm::vec<3, float> o2 = PyGLM_Vec_PTI_Get1(3, float, arg2); - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o = PyGLM_Vec_PTI_Get0(3, double, arg1); - glm::vec<3, double> o2 = PyGLM_Vec_PTI_Get1(3, double, arg2); - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o = PyGLM_Vec_PTI_Get0(4, float, arg1); - glm::vec<4, float> o2 = PyGLM_Vec_PTI_Get1(4, float, arg2); - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o = PyGLM_Vec_PTI_Get0(4, double, arg1); - glm::vec<4, double> o2 = PyGLM_Vec_PTI_Get1(4, double, arg2); - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - return pack(glm::notEqual(o, o2, o3)); - } + if (arg1Subtype == arg2Subtype && arg1Subtype->C == arg3Subtype->C && arg3Subtype->glmType == PyGLM_TYPE_VEC) { + if (arg3Subtype->format == PyGLM_FS_INT32) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::notEqual(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, int32, arg2))); - if (PyGLM_Vec_PTI_Check2(2, float, arg3)) { - glm::vec<2, float> o3 = PyGLM_Vec_PTI_Get2(2, float, arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) { - glm::mat<2, 2, float> o = PyGLM_Mat_PTI_Get0(2, 2, float, arg1); - glm::mat<2, 2, float> o2 = PyGLM_Mat_PTI_Get1(2, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) { - glm::mat<2, 3, float> o = PyGLM_Mat_PTI_Get0(2, 3, float, arg1); - glm::mat<2, 3, float> o2 = PyGLM_Mat_PTI_Get1(2, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) { - glm::mat<2, 4, float> o = PyGLM_Mat_PTI_Get0(2, 4, float, arg1); - glm::mat<2, 4, float> o2 = PyGLM_Mat_PTI_Get1(2, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(2, double, arg3)) { - glm::vec<2, double> o3 = PyGLM_Vec_PTI_Get2(2, double, arg3); - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) { - glm::mat<2, 2, double> o = PyGLM_Mat_PTI_Get0(2, 2, double, arg1); - glm::mat<2, 2, double> o2 = PyGLM_Mat_PTI_Get1(2, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) { - glm::mat<2, 3, double> o = PyGLM_Mat_PTI_Get0(2, 3, double, arg1); - glm::mat<2, 3, double> o2 = PyGLM_Mat_PTI_Get1(2, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) { - glm::mat<2, 4, double> o = PyGLM_Mat_PTI_Get0(2, 4, double, arg1); - glm::mat<2, 4, double> o2 = PyGLM_Mat_PTI_Get1(2, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(3, float, arg3)) { - glm::vec<3, float> o3 = PyGLM_Vec_PTI_Get2(3, float, arg3); - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) { - glm::mat<3, 2, float> o = PyGLM_Mat_PTI_Get0(3, 2, float, arg1); - glm::mat<3, 2, float> o2 = PyGLM_Mat_PTI_Get1(3, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) { - glm::mat<3, 3, float> o = PyGLM_Mat_PTI_Get0(3, 3, float, arg1); - glm::mat<3, 3, float> o2 = PyGLM_Mat_PTI_Get1(3, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) { - glm::mat<3, 4, float> o = PyGLM_Mat_PTI_Get0(3, 4, float, arg1); - glm::mat<3, 4, float> o2 = PyGLM_Mat_PTI_Get1(3, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(3, double, arg3)) { - glm::vec<3, double> o3 = PyGLM_Vec_PTI_Get2(3, double, arg3); - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) { - glm::mat<3, 2, double> o = PyGLM_Mat_PTI_Get0(3, 2, double, arg1); - glm::mat<3, 2, double> o2 = PyGLM_Mat_PTI_Get1(3, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) { - glm::mat<3, 3, double> o = PyGLM_Mat_PTI_Get0(3, 3, double, arg1); - glm::mat<3, 3, double> o2 = PyGLM_Mat_PTI_Get1(3, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) { - glm::mat<3, 4, double> o = PyGLM_Mat_PTI_Get0(3, 4, double, arg1); - glm::mat<3, 4, double> o2 = PyGLM_Mat_PTI_Get1(3, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(4, float, arg3)) { - glm::vec<4, float> o3 = PyGLM_Vec_PTI_Get2(4, float, arg3); - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) { - glm::mat<4, 2, float> o = PyGLM_Mat_PTI_Get0(4, 2, float, arg1); - glm::mat<4, 2, float> o2 = PyGLM_Mat_PTI_Get1(4, 2, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) { - glm::mat<4, 3, float> o = PyGLM_Mat_PTI_Get0(4, 3, float, arg1); - glm::mat<4, 3, float> o2 = PyGLM_Mat_PTI_Get1(4, 3, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) { - glm::mat<4, 4, float> o = PyGLM_Mat_PTI_Get0(4, 4, float, arg1); - glm::mat<4, 4, float> o2 = PyGLM_Mat_PTI_Get1(4, 4, float, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; - } - if (PyGLM_Vec_PTI_Check2(4, double, arg3)) { - glm::vec<4, double> o3 = PyGLM_Vec_PTI_Get2(4, double, arg3); - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) { - glm::mat<4, 2, double> o = PyGLM_Mat_PTI_Get0(4, 2, double, arg1); - glm::mat<4, 2, double> o2 = PyGLM_Mat_PTI_Get1(4, 2, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) { - glm::mat<4, 3, double> o = PyGLM_Mat_PTI_Get0(4, 3, double, arg1); - glm::mat<4, 3, double> o2 = PyGLM_Mat_PTI_Get1(4, 3, double, arg2); - return pack(glm::notEqual(o, o2, o3)); - } - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) { - glm::mat<4, 4, double> o = PyGLM_Mat_PTI_Get0(4, 4, double, arg1); - glm::mat<4, 4, double> o2 = PyGLM_Mat_PTI_Get1(4, 4, double, arg2); - return pack(glm::notEqual(o, o2, o3)); + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::notEqual(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_VecOrMVec_Get(C, int32, arg3))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } + if (arg3Subtype->format == arg1Subtype->format) { + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { +#define PyGLM_FUNC_TEMPLATE(L, T) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::notEqual(PyGLM_VecOrMVec_Get(L, T, arg1), PyGLM_VecOrMVec_Get(L, T, arg2), PyGLM_VecOrMVec_Get(L, T, arg2))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + +#define PyGLM_FUNC_TEMPLATE(C, R, T) \ + case PyGLMTypeObjectArrayOffsetMat(): \ + return pack(glm::notEqual(PyGLM_Mat_Get(C, R, T, arg1), PyGLM_Mat_Get(C, R, T, arg2), PyGLM_VecOrMVec_Get(C, T, arg3))); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fF, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE + } + } } - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); - return NULL; } + PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for notEqual()"); return NULL; } @@ -2238,30 +415,16 @@ PyDoc_STRVAR(any_docstr, ); static PyObject* any(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check0(1, bool, arg)) { - if (glm::any(PyGLM_Vec_PTI_Get0(1, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg)) { - if (glm::any(PyGLM_Vec_PTI_Get0(2, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg)) { - if (glm::any(PyGLM_Vec_PTI_Get0(3, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg)) { - if (glm::any(PyGLM_Vec_PTI_Get0(4, bool, arg))) { - Py_RETURN_TRUE; - } + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (glm::any(PyGLM_Vec_Get(L, bool, arg))) { \ + Py_RETURN_TRUE; \ + } \ Py_RETURN_FALSE; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for any(): ", arg); return NULL; @@ -2273,30 +436,16 @@ PyDoc_STRVAR(all_docstr, ); static PyObject* all(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check0(1, bool, arg)) { - if (glm::all(PyGLM_Vec_PTI_Get0(1, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg)) { - if (glm::all(PyGLM_Vec_PTI_Get0(2, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg)) { - if (glm::all(PyGLM_Vec_PTI_Get0(3, bool, arg))) { - Py_RETURN_TRUE; - } - Py_RETURN_FALSE; - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg)) { - if (glm::all(PyGLM_Vec_PTI_Get0(4, bool, arg))) { - Py_RETURN_TRUE; - } + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + if (glm::all(PyGLM_Vec_Get(L, bool, arg))) { \ + Py_RETURN_TRUE; \ + } \ Py_RETURN_FALSE; + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for all(): ", arg); return NULL; @@ -2308,18 +457,13 @@ PyDoc_STRVAR(not_docstr, ); static PyObject* not_(PyObject*, PyObject* arg) { - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_BOOL); - if (PyGLM_Vec_PTI_Check0(1, bool, arg)) { - return pack_vec(glm::not_(PyGLM_Vec_PTI_Get0(1, bool, arg))); - } - if (PyGLM_Vec_PTI_Check0(2, bool, arg)) { - return pack_vec(glm::not_(PyGLM_Vec_PTI_Get0(2, bool, arg))); - } - if (PyGLM_Vec_PTI_Check0(3, bool, arg)) { - return pack_vec(glm::not_(PyGLM_Vec_PTI_Get0(3, bool, arg))); - } - if (PyGLM_Vec_PTI_Check0(4, bool, arg)) { - return pack_vec(glm::not_(PyGLM_Vec_PTI_Get0(4, bool, arg))); + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg)) { +#define PyGLM_FUNC_TEMPLATE(L) \ + case PyGLMTypeObjectArrayOffsetVec(): \ + return pack(glm::not_(PyGLM_Vec_Get(L, bool, arg))); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_Undefined, PyGLM_FUNC_TEMPLATE) +#undef PyGLM_FUNC_TEMPLATE } PyGLM_TYPEERROR_O("invalid argument type for not_(): ", arg); return NULL; diff --git a/PyGLM/functions/function_generator_macros.h b/PyGLM/functions/function_generator_macros.h index 0d677c8..aff50b4 100644 --- a/PyGLM/functions/function_generator_macros.h +++ b/PyGLM/functions/function_generator_macros.h @@ -4,19 +4,151 @@ #include "../types/all.h" -#include "../internal_functions/all.h" +//#include "../internal_functions/all.h" + +// Repeats the code with T in [float, double, int32, uint32, int64, uint64, int16, uint16, int8, uint8, bool] +#define PyGLM_CODEGEN_PARAM_T_Vec_ALL(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double)\ +MACRO(L, int32)\ +MACRO(L, uint32)\ +MACRO(L, int64)\ +MACRO(L, uint64)\ +MACRO(L, int16)\ +MACRO(L, uint16)\ +MACRO(L, int8)\ +MACRO(L, uint8)\ +MACRO(L, bool) + +// Repeats the code with T in [float, double, int32, uint32, int64, uint64, int16, uint16, int8, uint8] +#define PyGLM_CODEGEN_PARAM_T_Vec_fFiqsuIQSU(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double)\ +MACRO(L, int32)\ +MACRO(L, uint32)\ +MACRO(L, int64)\ +MACRO(L, uint64)\ +MACRO(L, int16)\ +MACRO(L, uint16)\ +MACRO(L, int8)\ +MACRO(L, uint8) + +// Repeats the code with T in [int32, uint32, int64, uint64, int16, uint16, int8, uint8] +#define PyGLM_CODEGEN_PARAM_T_Vec_iqsuIQSU(MACRO, L)\ +MACRO(L, int32)\ +MACRO(L, uint32)\ +MACRO(L, int64)\ +MACRO(L, uint64)\ +MACRO(L, int16)\ +MACRO(L, uint16)\ +MACRO(L, int8)\ +MACRO(L, uint8) + +// Repeats the code with T in [int32, uint32, int64, uint64] +#define PyGLM_CODEGEN_PARAM_T_Vec_iqIQ(MACRO, L)\ +MACRO(L, int32)\ +MACRO(L, uint32)\ +MACRO(L, int64)\ +MACRO(L, uint64) + +// Repeats the code with T in [float, double, int32, int64, int16, int8] +#define PyGLM_CODEGEN_PARAM_T_Vec_fFiqsu(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double)\ +MACRO(L, int32)\ +MACRO(L, int64)\ +MACRO(L, int16)\ +MACRO(L, int8) + +// Repeats the code with T in [float, double, int32] +#define PyGLM_CODEGEN_PARAM_T_Vec_fFi(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double)\ +MACRO(L, int32) + +// Repeats the code with T in [float, double, int32, uint32] +#define PyGLM_CODEGEN_PARAM_T_Mat_fFiI(MACRO, C, R)\ +MACRO(C, R, float)\ +MACRO(C, R, double)\ +MACRO(C, R, int32)\ +MACRO(C, R, uint32) + +// Repeats the code with T in [float, double] +#define PyGLM_CODEGEN_PARAM_T_Mat_fF(MACRO, C, R)\ +MACRO(C, R, float)\ +MACRO(C, R, double) + +// Repeats the code with T in [float, double] +#define PyGLM_CODEGEN_PARAM_T_Vec_fF(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double) + +// Repeats the code with T in [float, double, int32, uint32] +#define PyGLM_CODEGEN_PARAM_T_Vec_fFiI(MACRO, L)\ +MACRO(L, float)\ +MACRO(L, double)\ +MACRO(L, int32)\ +MACRO(L, uint32) + +// Repeats the code with T in [int32, uint32] +#define PyGLM_CODEGEN_PARAM_T_Vec_iI(MACRO, L)\ +MACRO(L, int32)\ +MACRO(L, uint32) + +// Repeats the code with T in [float, double] +#define PyGLM_CODEGEN_PARAM_T_Qua_fF(MACRO)\ +MACRO(float)\ +MACRO(double) + +// Just passes through L +#define PyGLM_CODEGEN_PARAM_T_Vec_Undefined(MACRO, L)\ +MACRO(L) + +// Runs T_MACRO(CODE_MACRO, L) for L in [1, 2, 3, 4] +#define PyGLM_CODEGEN_PARAM_L_ALL(T_MACRO, CODE_MACRO)\ +T_MACRO(CODE_MACRO, 1) \ +T_MACRO(CODE_MACRO, 2) \ +T_MACRO(CODE_MACRO, 3) \ +T_MACRO(CODE_MACRO, 4) + +// Runs T_MACRO(CODE_MACRO, L) for L in [2, 3, 4] +#define PyGLM_CODEGEN_PARAM_L_MVEC(T_MACRO, CODE_MACRO)\ +T_MACRO(CODE_MACRO, 2) \ +T_MACRO(CODE_MACRO, 3) \ +T_MACRO(CODE_MACRO, 4) + +// Runs T_MACRO(CODE_MACRO, S, S) for S in [2, 3, 4] +#define PyGLM_CODEGEN_PARAM_S_ALL(T_MACRO, CODE_MACRO)\ +T_MACRO(CODE_MACRO, 2, 2) \ +T_MACRO(CODE_MACRO, 3, 3) \ +T_MACRO(CODE_MACRO, 4, 4) + +// Runs T_MACRO(CODE_MACRO, C, R) for R in [2, 3, 4] +#define PyGLM_CODEGEN_PARAM_R_ALL(C, T_MACRO, CODE_MACRO)\ +T_MACRO(CODE_MACRO, C, 2) \ +T_MACRO(CODE_MACRO, C, 3) \ +T_MACRO(CODE_MACRO, C, 4) + +// Runs R_MACRO(C, T_MACRO, CODE_MACRO) for C in [2, 3, 4] +#define PyGLM_CODEGEN_PARAM_C_ALL(R_MACRO, T_MACRO, CODE_MACRO)\ +R_MACRO(2, T_MACRO, CODE_MACRO) \ +R_MACRO(3, T_MACRO, CODE_MACRO) \ +R_MACRO(4, T_MACRO, CODE_MACRO) #define PyGLM_MAKE_GLM_FUNC_V3__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -24,13 +156,16 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_V2__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_SHAPE_2 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -38,34 +173,39 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_N_V__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) {\ + case PyGLMTypeObjectArrayOffsetVec<1, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(1, float, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<1, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(1, double, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<2, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(2, float, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<2, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(2, double, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<3, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(3, float, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<3, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(3, double, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<4, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(4, float, arg)));\ + case PyGLMTypeObjectArrayOffsetVec<4, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(4, double, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<2, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(2, float, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<2, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(2, double, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<3, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(3, float, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<3, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(3, double, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<4, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(4, float, arg)));\ + case PyGLMTypeObjectArrayOffsetMVec<4, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(4, double, arg)));\ + }\ if (PyGLM_Number_Check(arg)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg)));\ }\ - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg)));\ - }\ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -75,165 +215,111 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ + if (Is_PyGLM_Object(arg1)){\ + if (Is_PyGLM_Object(arg2)) {\ + GET_PyGLM_ARG_TYPE(arg1);\ + GET_PyGLM_ARG_TYPE(arg2);\ + if (arg1Type->subtype == arg2Type->subtype) {\ + switch(GET_PyGLMTypeObjectArrayOffsetOfType(arg1Type->subtype)) {\ + case PyGLMTypeObjectArrayOffsetVec<1, float>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<1, double>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<2, float>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<2, double>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<3, float>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<3, double>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<4, float>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<4, double>():\ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2)));\ + }\ + }\ + }\ + if (PyGLM_Number_Check(arg2)){\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg1)){\ + case PyGLMTypeObjectArrayOffsetVec<1, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(1, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<1, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(1, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<2, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(2, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<2, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(2, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<3, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(3, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<3, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(3, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<4, float>():\ + return pack(glm::NAME(PyGLM_Vec_Get(4, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetVec<4, double>():\ + return pack(glm::NAME(PyGLM_Vec_Get(4, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<2, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(2, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<2, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(2, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<3, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(3, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<3, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(3, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<4, float>():\ + return pack(glm::NAME(PyGLM_MVec_Get(4, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ + case PyGLMTypeObjectArrayOffsetMVec<4, double>():\ + return pack(glm::NAME(PyGLM_MVec_Get(4, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ + }\ + }\ + }\ if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } -#define PyGLM_MAKE_GLM_FUNC_NNN_VVV_VNN__tfF(NAME)\ -static PyObject*\ -NAME##_(PyObject*, PyObject* args) {\ - PyObject *arg1, *arg2, *arg3;\ - PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3);\ - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init2(arg3, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ - return NULL;\ -} - #define PyGLM_MAKE_GLM_FUNC_N_V_Q__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(1, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(1, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<4, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<4, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg))); \ + } \ if (PyGLM_Number_Check(arg)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg)));\ }\ - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_PTI_IsVec(0)) {\ - if (PyGLM_Vec_PTI_Check0(1, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg)));\ - }\ - }\ - if (PyGLM_Qua_PTI_Check0(float, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg)));\ - }\ - if (PyGLM_Qua_PTI_Check0(double, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg)));\ - }\ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -242,36 +328,36 @@ NAME##_(PyObject*, PyObject* arg) {\ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ - PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ + PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2); \ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + if (arg1Subtype == arg2Subtype) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2))); \ + } \ + } \ + } \ if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -279,39 +365,40 @@ NAME##_(PyObject*, PyObject* args) {\ #define PyGLM_MAKE_GLM_FUNC_V_Q__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_ANY_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_PTI_IsVec(0)) {\ - if (PyGLM_Vec_PTI_Check0(1, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg)));\ - }\ - }\ - if (PyGLM_Qua_PTI_Check0(float, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg)));\ - }\ - if (PyGLM_Qua_PTI_Check0(double, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(1, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(1, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_Vec_Get(4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<2, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<3, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<4, float>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMVec<4, double>(): \ + return pack(glm::NAME(PyGLM_MVec_Get(4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -320,36 +407,37 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2, *arg3;\ PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3);\ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2) && Is_PyGLM_Object(arg3)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_TYPE(arg3); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg3); \ + if (arg1Subtype == arg2Subtype && arg1Subtype == arg3Subtype) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2), PyGLM_VecOrMVec_Get(1, float, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2), PyGLM_VecOrMVec_Get(1, double, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2), PyGLM_VecOrMVec_Get(2, float, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2), PyGLM_VecOrMVec_Get(2, double, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2), PyGLM_VecOrMVec_Get(3, float, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2), PyGLM_VecOrMVec_Get(3, double, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2), PyGLM_VecOrMVec_Get(4, float, arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2), PyGLM_VecOrMVec_Get(4, double, arg3))); \ + } \ + } \ + } \ if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init2(arg3, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Vec_PTI_Check2(1, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Vec_PTI_Get2(1, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Vec_PTI_Check2(1, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Vec_PTI_Get2(1, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Vec_PTI_Check2(2, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Vec_PTI_Get2(2, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Vec_PTI_Check2(2, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Vec_PTI_Get2(2, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Vec_PTI_Check2(4, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Vec_PTI_Get2(4, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Vec_PTI_Check2(4, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Vec_PTI_Get2(4, double, arg3)));\ - }\ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ } @@ -358,36 +446,38 @@ NAME##_(PyObject*, PyObject* args) {\ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2, *arg3;\ - PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3);\ - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_ANY_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2), PyGLM_Number_FromPyObject(arg3)));\ - }\ + PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3); \ + if (PyGLM_Number_Check(arg3)) { \ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + if (arg1Subtype == arg2Subtype) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2), PyGLM_Number_FromPyObject(arg3))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2), PyGLM_Number_FromPyObject(arg3))); \ + } \ + } \ + } \ + if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ + return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2), PyGLM_Number_FromPyObject(arg3)));\ + }\ + } \ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ } @@ -397,62 +487,46 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg1) && PyGLM_Mat_PTI_Check1(2, 2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, float, arg1), PyGLM_Mat_PTI_Get1(2, 2, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg1) && PyGLM_Mat_PTI_Check1(2, 2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, double, arg1), PyGLM_Mat_PTI_Get1(2, 2, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg1) && PyGLM_Mat_PTI_Check1(2, 3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, float, arg1), PyGLM_Mat_PTI_Get1(2, 3, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg1) && PyGLM_Mat_PTI_Check1(2, 3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, double, arg1), PyGLM_Mat_PTI_Get1(2, 3, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg1) && PyGLM_Mat_PTI_Check1(2, 4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, float, arg1), PyGLM_Mat_PTI_Get1(2, 4, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg1) && PyGLM_Mat_PTI_Check1(2, 4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, double, arg1), PyGLM_Mat_PTI_Get1(2, 4, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg1) && PyGLM_Mat_PTI_Check1(3, 2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, float, arg1), PyGLM_Mat_PTI_Get1(3, 2, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg1) && PyGLM_Mat_PTI_Check1(3, 2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, double, arg1), PyGLM_Mat_PTI_Get1(3, 2, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Mat_PTI_Check1(3, 3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg1), PyGLM_Mat_PTI_Get1(3, 3, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Mat_PTI_Check1(3, 3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg1), PyGLM_Mat_PTI_Get1(3, 3, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg1) && PyGLM_Mat_PTI_Check1(3, 4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, float, arg1), PyGLM_Mat_PTI_Get1(3, 4, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg1) && PyGLM_Mat_PTI_Check1(3, 4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, double, arg1), PyGLM_Mat_PTI_Get1(3, 4, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg1) && PyGLM_Mat_PTI_Check1(4, 2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, float, arg1), PyGLM_Mat_PTI_Get1(4, 2, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg1) && PyGLM_Mat_PTI_Check1(4, 2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, double, arg1), PyGLM_Mat_PTI_Get1(4, 2, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, float, arg1), PyGLM_Mat_PTI_Get1(4, 3, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, double, arg1), PyGLM_Mat_PTI_Get1(4, 3, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg1), PyGLM_Mat_PTI_Get1(4, 4, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg1), PyGLM_Mat_PTI_Get1(4, 4, double, arg2)));\ - }\ + if (Py_TYPE(arg1) == Py_TYPE(arg2)) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOf(arg1)) { \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, float, arg1), PyGLM_Mat_Get(2, 2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, double, arg1), PyGLM_Mat_Get(2, 2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, float, arg1), PyGLM_Mat_Get(2, 3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, double, arg1), PyGLM_Mat_Get(2, 3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, float, arg1), PyGLM_Mat_Get(2, 4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, double, arg1), PyGLM_Mat_Get(2, 4, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, float, arg1), PyGLM_Mat_Get(3, 2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, double, arg1), PyGLM_Mat_Get(3, 2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg1), PyGLM_Mat_Get(3, 3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg1), PyGLM_Mat_Get(3, 3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, float, arg1), PyGLM_Mat_Get(3, 4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, double, arg1), PyGLM_Mat_Get(3, 4, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, float, arg1), PyGLM_Mat_Get(4, 2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, double, arg1), PyGLM_Mat_Get(4, 2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, float, arg1), PyGLM_Mat_Get(4, 3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, double, arg1), PyGLM_Mat_Get(4, 3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg1), PyGLM_Mat_Get(4, 4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg1), PyGLM_Mat_Get(4, 4, double, arg2))); \ + } \ + } \ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -460,61 +534,44 @@ NAME##_(PyObject*, PyObject* args) {\ #define PyGLM_MAKE_GLM_FUNC_M__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -522,115 +579,80 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_M(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_MAT | PyGLM_SHAPE_ALL | PyGLM_DT_ALL);\ - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 3, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 3, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 4, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 4, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 2, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 2, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 4, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 4, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 2, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 2, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 3, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 3, uint32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, int32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, int32, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, uint32, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, uint32, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 3, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 3, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 4, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 4, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 2, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 2, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 4, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 4, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 2, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 2, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 3, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 3, uint32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, int32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, uint32>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, uint32, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -638,25 +660,20 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_S__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_MAT | PyGLM_SHAPE_SQUARE | PyGLM_DT_FD);\ - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -664,33 +681,24 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_S_Q__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_MAT | PyGLM_T_QUA | PyGLM_SHAPE_SQUARE | PyGLM_DT_FD);\ - if (PyGLM_PTI_IsMat(0)) {\ - if (PyGLM_Mat_PTI_Check0(2, 2, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(2, 2, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(2, 2, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg)));\ - }\ - }\ - if (PyGLM_Qua_PTI_Check0(float, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg)));\ - }\ - if (PyGLM_Qua_PTI_Check0(double, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<2, 2, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(2, 2, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } @@ -701,34 +709,7 @@ NAME##_(PyObject*, PyObject*) {\ return pack(glm::NAME());\ } -#define PyGLM_MAKE_GLM_FUNC_M3V2_M4V3__tfF(NAME)\ -static PyObject*\ -NAME##_(PyObject*, PyObject* args) {\ - PyObject *arg1, *arg2;\ - PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_SHAPE_4x4 | PyGLM_DT_NORMAL);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_2 | PyGLM_SHAPE_3 | PyGLM_DT_NORMAL);\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ - return NULL;\ -} + #define PyGLM_MAKE_GLM_FUNC_M3N__tfF(NAME)\ static PyObject*\ @@ -736,13 +717,12 @@ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ if (PyGLM_Number_Check(arg2)) {\ - PyGLM_PTI_Init0(arg1, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_DT_FD);\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg1)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg1)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ + if (PyGLM_Mat_Check(3, 3, float, arg1)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg1), PyGLM_Number_FromPyObject(arg2))); \ + } \ + if (PyGLM_Mat_Check(3, 3, double, arg1)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg1), PyGLM_Number_FromPyObject(arg2))); \ + } \ }\ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ @@ -753,20 +733,18 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_NORMAL);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_NORMAL);\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));\ - }\ + if (PyGLM_Mat_Check(4, 4, float, arg1) && PyGLM_Vec_Check(3, float, arg2)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg1), PyGLM_VecOrMVec_GET(3, float, arg2))); \ + } \ + if (PyGLM_Mat_Check(4, 4, double, arg1) && PyGLM_Vec_Check(3, double, arg2)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg1), PyGLM_VecOrMVec_GET(3, double, arg2))); \ + } \ + if (PyGLM_Mat_Check(4, 4, int32, arg1) && PyGLM_Vec_Check(3, int32, arg2)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, int32, arg1), PyGLM_VecOrMVec_GET(3, int32, arg2))); \ + } \ + if (PyGLM_Mat_Check(4, 4, uint32, arg1) && PyGLM_Vec_Check(3, uint32, arg2)) { \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, uint32, arg1), PyGLM_VecOrMVec_GET(3, uint32, arg2))); \ + } \ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -811,23 +789,23 @@ NAME##_(PyObject*, PyObject* args) {\ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2, *arg3, *arg4;\ - PyGLM_Arg_Unpack_4O(args, #NAME, arg1, arg2, arg3, arg4);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD);\ - PyGLM_PTI_Init2(arg3, PyGLM_T_MAT | PyGLM_SHAPE_4x4 | PyGLM_DT_FD);\ - PyGLM_PTI_Init3(arg4, PyGLM_T_VEC | PyGLM_SHAPE_4 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2) && PyGLM_Mat_PTI_Check2(4, 4, float, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Mat_PTI_Get1(4, 4, float, arg2), PyGLM_Mat_PTI_Get2(4, 4, float, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Mat_PTI_Check1(4, 4, float, arg2) && PyGLM_Mat_PTI_Check2(4, 4, float, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Mat_PTI_Get1(4, 4, float, arg2), PyGLM_Mat_PTI_Get2(4, 4, float, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2) && PyGLM_Mat_PTI_Check2(4, 4, double, arg3) && PyGLM_Vec_PTI_Check3(4, float, arg4)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Mat_PTI_Get1(4, 4, double, arg2), PyGLM_Mat_PTI_Get2(4, 4, double, arg3), PyGLM_Vec_PTI_Get3(4, float, arg4)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Mat_PTI_Check1(4, 4, double, arg2) && PyGLM_Mat_PTI_Check2(4, 4, double, arg3) && PyGLM_Vec_PTI_Check3(4, double, arg4)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Mat_PTI_Get1(4, 4, double, arg2), PyGLM_Mat_PTI_Get2(4, 4, double, arg3), PyGLM_Vec_PTI_Get3(4, double, arg4)));\ - }\ + PyGLM_Arg_Unpack_4O(args, #NAME, arg1, arg2, arg3, arg4); \ + if (PyGLM_Vec_Check(4, float, arg4)) { \ + if (PyGLM_Vec_Check(3, float, arg1) && PyGLM_Mat_Check(4, 4, float, arg2) && PyGLM_Mat_Check(4, 4, float, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1), PyGLM_Mat_Get(4, 4, float, arg2), PyGLM_Mat_Get(4, 4, float, arg3), PyGLM_VecOrMVec_GET(4, float, arg4))); \ + } \ + if (PyGLM_Vec_Check(3, double, arg1) && PyGLM_Mat_Check(4, 4, double, arg2) && PyGLM_Mat_Check(4, 4, double, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1), PyGLM_Mat_Get(4, 4, double, arg2), PyGLM_Mat_Get(4, 4, double, arg3), PyGLM_VecOrMVec_GET(4, float, arg4))); \ + } \ + } \ + if (PyGLM_Vec_Check(4, double, arg4)) { \ + if (PyGLM_Vec_Check(3, float, arg1) && PyGLM_Mat_Check(4, 4, float, arg2) && PyGLM_Mat_Check(4, 4, float, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1), PyGLM_Mat_Get(4, 4, float, arg2), PyGLM_Mat_Get(4, 4, float, arg3), PyGLM_VecOrMVec_GET(4, double, arg4))); \ + } \ + if (PyGLM_Vec_Check(3, double, arg1) && PyGLM_Mat_Check(4, 4, double, arg2) && PyGLM_Mat_Check(4, 4, double, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1), PyGLM_Mat_Get(4, 4, double, arg2), PyGLM_Mat_Get(4, 4, double, arg3), PyGLM_VecOrMVec_GET(4, double, arg4))); \ + } \ + } \ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ } @@ -837,15 +815,12 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2, *arg3;\ PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - PyGLM_PTI_Init2(arg3, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2) && PyGLM_Vec_PTI_Check2(3, float, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2), PyGLM_Vec_PTI_Get2(3, float, arg3)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2) && PyGLM_Vec_PTI_Check2(3, double, arg3)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2), PyGLM_Vec_PTI_Get2(3, double, arg3)));\ - }\ + if (PyGLM_Vec_Check(3, float, arg1) && PyGLM_Vec_Check(3, float, arg2) && PyGLM_Vec_Check(3, float, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1), PyGLM_VecOrMVec_GET(3, float, arg2), PyGLM_VecOrMVec_GET(3, float, arg3))); \ + } \ + if (PyGLM_Vec_Check(3, double, arg1) && PyGLM_Vec_Check(3, double, arg2) && PyGLM_Vec_Check(3, double, arg3)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1), PyGLM_VecOrMVec_GET(3, double, arg2), PyGLM_VecOrMVec_GET(3, double, arg3))); \ + } \ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ } @@ -855,14 +830,12 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ + if (PyGLM_Vec_Check(3, float, arg1) && PyGLM_Vec_Check(3, float, arg2)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1), PyGLM_VecOrMVec_GET(3, float, arg2))); \ + } \ + if (PyGLM_Vec_Check(3, double, arg1) && PyGLM_Vec_Check(3, double, arg2)) { \ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1), PyGLM_VecOrMVec_GET(3, double, arg2))); \ + } \ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ } @@ -873,22 +846,19 @@ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2 = NULL;\ if (!PyArg_UnpackTuple(args, #NAME, 1, 2, &arg1, &arg2)) return NULL;\ if (arg2 == NULL) {\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1)));\ + if (PyGLM_Vec_Check(3, float, arg1)) {\ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1)));\ }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1)));\ + if (PyGLM_Vec_Check(3, double, arg1)) {\ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1)));\ }\ }\ else {\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_3 | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ + if (PyGLM_Vec_Check(3, float, arg1) && PyGLM_Vec_Check(3, float, arg2)) {\ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, float, arg1), PyGLM_VecOrMVec_GET(3, float, arg2)));\ }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ + if (PyGLM_Vec_Check(3, double, arg1) && PyGLM_Vec_Check(3, double, arg2)) {\ + return pack(glm::NAME(PyGLM_VecOrMVec_GET(3, double, arg1), PyGLM_VecOrMVec_GET(3, double, arg2)));\ }\ }\ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ @@ -900,13 +870,11 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2, *arg3;\ PyGLM_Arg_Unpack_3O(args, #NAME, arg1, arg2, arg3);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_QUA | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_QUA | PyGLM_DT_FD);\ - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg1), PyGLM_Qua_PTI_Get1(float, arg2), PyGLM_Number_FromPyObject(arg3)));\ + if (PyGLM_Qua_Check(float, arg1) && PyGLM_Qua_Check(float, arg2) && PyGLM_Number_Check(arg3)) {\ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg1), PyGLM_Qua_Get(float, arg2), PyGLM_Number_FromPyObject(arg3)));\ }\ - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2) && PyGLM_Number_Check(arg3)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg1), PyGLM_Qua_PTI_Get1(double, arg2), PyGLM_Number_FromPyObject(arg3)));\ + if (PyGLM_Qua_Check(double, arg1) && PyGLM_Qua_Check(double, arg2) && PyGLM_Number_Check(arg3)) {\ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg1), PyGLM_Qua_Get(double, arg2), PyGLM_Number_FromPyObject(arg3)));\ }\ PyErr_SetString(PyExc_TypeError, "invalid argument type(s) for " #NAME "()");\ return NULL;\ @@ -915,12 +883,11 @@ NAME##_(PyObject*, PyObject* args) {\ #define PyGLM_MAKE_GLM_FUNC_Q(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_QUA | PyGLM_DT_FD);\ - if (PyGLM_Qua_PTI_Check0(float, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg)));\ + if (PyGLM_Qua_Check(float, arg)) {\ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg)));\ }\ - if (PyGLM_Qua_PTI_Check0(double, arg)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg)));\ + if (PyGLM_Qua_Check(double, arg)) {\ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg)));\ }\ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ @@ -929,299 +896,116 @@ NAME##_(PyObject*, PyObject* arg) {\ #define PyGLM_MAKE_GLM_FUNC_M3_M4__tfF(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ - PyGLM_PTI_Init0(arg, PyGLM_T_MAT | PyGLM_SHAPE_3x3 | PyGLM_SHAPE_4x4 | PyGLM_DT_FD);\ - if (PyGLM_Mat_PTI_Check0(3, 3, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(3, 3, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(3, 3, double, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, float, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, float, arg)));\ - }\ - if (PyGLM_Mat_PTI_Check0(4, 4, double, arg)) {\ - return pack(glm::NAME(PyGLM_Mat_PTI_Get0(4, 4, double, arg)));\ - }\ + switch(GET_PyGLMTypeObjectArrayOffsetOf(arg)) { \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<3, 3, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(3, 3, double, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, float>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, float, arg))); \ + case PyGLMTypeObjectArrayOffsetMat<4, 4, double>(): \ + return pack(glm::NAME(PyGLM_Mat_Get(4, 4, double, arg))); \ + } \ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } -#define PyGLM_MAKE_GLM_FUNC_NN_VV(NAME)\ -static PyObject*\ -NAME##_(PyObject*, PyObject* args) {\ - PyObject *arg1, *arg2;\ - PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_ALL);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint32, arg1) && PyGLM_Vec_PTI_Check1(1, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint32, arg1), PyGLM_Vec_PTI_Get1(1, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint64, arg1) && PyGLM_Vec_PTI_Check1(1, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint64, arg1), PyGLM_Vec_PTI_Get1(1, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint16, arg1) && PyGLM_Vec_PTI_Check1(1, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint16, arg1), PyGLM_Vec_PTI_Get1(1, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint8, arg1) && PyGLM_Vec_PTI_Check1(1, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint8, arg1), PyGLM_Vec_PTI_Get1(1, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, bool, arg1), PyGLM_Vec_PTI_Get1(1, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint32, arg1) && PyGLM_Vec_PTI_Check1(2, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint32, arg1), PyGLM_Vec_PTI_Get1(2, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint64, arg1) && PyGLM_Vec_PTI_Check1(2, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint64, arg1), PyGLM_Vec_PTI_Get1(2, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint16, arg1) && PyGLM_Vec_PTI_Check1(2, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint16, arg1), PyGLM_Vec_PTI_Get1(2, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint8, arg1) && PyGLM_Vec_PTI_Check1(2, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint8, arg1), PyGLM_Vec_PTI_Get1(2, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, bool, arg1), PyGLM_Vec_PTI_Get1(2, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint64, arg1) && PyGLM_Vec_PTI_Check1(3, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint64, arg1), PyGLM_Vec_PTI_Get1(3, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint16, arg1) && PyGLM_Vec_PTI_Check1(3, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint16, arg1), PyGLM_Vec_PTI_Get1(3, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint8, arg1) && PyGLM_Vec_PTI_Check1(3, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint8, arg1), PyGLM_Vec_PTI_Get1(3, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, bool, arg1), PyGLM_Vec_PTI_Get1(3, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint32, arg1) && PyGLM_Vec_PTI_Check1(4, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint32, arg1), PyGLM_Vec_PTI_Get1(4, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint64, arg1) && PyGLM_Vec_PTI_Check1(4, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint64, arg1), PyGLM_Vec_PTI_Get1(4, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint16, arg1) && PyGLM_Vec_PTI_Check1(4, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint16, arg1), PyGLM_Vec_PTI_Get1(4, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint8, arg1) && PyGLM_Vec_PTI_Check1(4, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint8, arg1), PyGLM_Vec_PTI_Get1(4, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, bool, arg1), PyGLM_Vec_PTI_Get1(4, bool, arg2)));\ - }\ - PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ - return NULL;\ -} - #define PyGLM_MAKE_GLM_FUNC_NN_VV__tGPL(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int64, arg1), PyGLM_VecOrMVec_Get(1, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int32, arg1), PyGLM_VecOrMVec_Get(1, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int16, arg1), PyGLM_VecOrMVec_Get(1, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int8, arg1), PyGLM_VecOrMVec_Get(1, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint64, arg1), PyGLM_VecOrMVec_Get(1, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint32, arg1), PyGLM_VecOrMVec_Get(1, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint16, arg1), PyGLM_VecOrMVec_Get(1, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint8, arg1), PyGLM_VecOrMVec_Get(1, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int64, arg1), PyGLM_VecOrMVec_Get(2, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int32, arg1), PyGLM_VecOrMVec_Get(2, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int16, arg1), PyGLM_VecOrMVec_Get(2, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int8, arg1), PyGLM_VecOrMVec_Get(2, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint64, arg1), PyGLM_VecOrMVec_Get(2, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint32, arg1), PyGLM_VecOrMVec_Get(2, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint16, arg1), PyGLM_VecOrMVec_Get(2, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint8, arg1), PyGLM_VecOrMVec_Get(2, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int64, arg1), PyGLM_VecOrMVec_Get(3, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int32, arg1), PyGLM_VecOrMVec_Get(3, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int16, arg1), PyGLM_VecOrMVec_Get(3, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int8, arg1), PyGLM_VecOrMVec_Get(3, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint64, arg1), PyGLM_VecOrMVec_Get(3, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint32, arg1), PyGLM_VecOrMVec_Get(3, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint16, arg1), PyGLM_VecOrMVec_Get(3, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint8, arg1), PyGLM_VecOrMVec_Get(3, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int64, arg1), PyGLM_VecOrMVec_Get(4, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int32, arg1), PyGLM_VecOrMVec_Get(4, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int16, arg1), PyGLM_VecOrMVec_Get(4, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int8, arg1), PyGLM_VecOrMVec_Get(4, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint64, arg1), PyGLM_VecOrMVec_Get(4, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint32, arg1), PyGLM_VecOrMVec_Get(4, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint16, arg1), PyGLM_VecOrMVec_Get(4, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint8, arg1), PyGLM_VecOrMVec_Get(4, uint8, arg2))); \ + } \ + } \ if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_I | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint32, arg1) && PyGLM_Vec_PTI_Check1(1, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint32, arg1), PyGLM_Vec_PTI_Get1(1, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint64, arg1) && PyGLM_Vec_PTI_Check1(1, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint64, arg1), PyGLM_Vec_PTI_Get1(1, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint16, arg1) && PyGLM_Vec_PTI_Check1(1, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint16, arg1), PyGLM_Vec_PTI_Get1(1, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint8, arg1) && PyGLM_Vec_PTI_Check1(1, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint8, arg1), PyGLM_Vec_PTI_Get1(1, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint32, arg1) && PyGLM_Vec_PTI_Check1(2, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint32, arg1), PyGLM_Vec_PTI_Get1(2, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint64, arg1) && PyGLM_Vec_PTI_Check1(2, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint64, arg1), PyGLM_Vec_PTI_Get1(2, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint16, arg1) && PyGLM_Vec_PTI_Check1(2, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint16, arg1), PyGLM_Vec_PTI_Get1(2, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint8, arg1) && PyGLM_Vec_PTI_Check1(2, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint8, arg1), PyGLM_Vec_PTI_Get1(2, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint64, arg1) && PyGLM_Vec_PTI_Check1(3, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint64, arg1), PyGLM_Vec_PTI_Get1(3, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint16, arg1) && PyGLM_Vec_PTI_Check1(3, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint16, arg1), PyGLM_Vec_PTI_Get1(3, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint8, arg1) && PyGLM_Vec_PTI_Check1(3, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint8, arg1), PyGLM_Vec_PTI_Get1(3, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint32, arg1) && PyGLM_Vec_PTI_Check1(4, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint32, arg1), PyGLM_Vec_PTI_Get1(4, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint64, arg1) && PyGLM_Vec_PTI_Check1(4, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint64, arg1), PyGLM_Vec_PTI_Get1(4, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint16, arg1) && PyGLM_Vec_PTI_Check1(4, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint16, arg1), PyGLM_Vec_PTI_Get1(4, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint8, arg1) && PyGLM_Vec_PTI_Check1(4, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint8, arg1), PyGLM_Vec_PTI_Get1(4, uint8, arg2)));\ - }\ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -1231,43 +1015,39 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + if (arg1Subtype == arg2Subtype) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg1), PyGLM_Qua_Get(float, arg2))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg1), PyGLM_Qua_Get(double, arg2))); \ + } \ + } \ + } \ if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_PTI_IsVec(0)) {\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ - }\ - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg1), PyGLM_Qua_PTI_Get1(float, arg2)));\ - }\ - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg1), PyGLM_Qua_PTI_Get1(double, arg2)));\ - }\ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -1275,379 +1055,156 @@ NAME##_(PyObject*, PyObject* args) {\ #define PyGLM_MAKE_GLM_FUNC_N_V__tiqsu(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* arg) {\ + if (Is_PyGLM_Object(arg)) { \ + GET_PyGLM_ARG_TYPE(arg); \ + GET_PyGLM_ARG_SUBTYPE(arg); \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(argSubtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int64, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int16, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int8, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int64, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int16, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int8, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int64, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int16, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int8, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int64, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int32, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int16, arg))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int8, arg))); \ + } \ + } \ if (PyGLM_Number_Check(arg)) {\ return pack(glm::NAME(PyGLM_Number_FromPyObject(arg)));\ }\ - PyGLM_PTI_Init0(arg, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8);\ - if (PyGLM_Vec_PTI_Check0(1, int, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg)));\ - }\ PyGLM_TYPEERROR_O("invalid argument type for " #NAME "(): ", arg);\ return NULL;\ } -#define PyGLM_MAKE_GLM_FUNC_NN_VV_VN__tiqsu(NAME)\ -static PyObject*\ -NAME##_(PyObject*, PyObject* args) {\ - PyObject *arg1, *arg2;\ - PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8);\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ - return NULL;\ -} - -#define PyGLM_MAKE_GLM_FUNC_NN_VV__tiqsu(NAME)\ -static PyObject*\ -NAME##_(PyObject*, PyObject* args) {\ - PyObject *arg1, *arg2;\ - PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {\ - return pack(glm::NAME(PyGLM_Number_FromPyObject(arg1), PyGLM_Number_FromPyObject(arg2)));\ - }\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_INT | PyGLM_DT_INT64 | PyGLM_DT_INT16 | PyGLM_DT_INT8);\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));\ - }\ - PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ - return NULL;\ -} - #define PyGLM_MAKE_GLM_FUNC_VV_QQ(NAME)\ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_ALL);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_ALL);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int, arg1) && PyGLM_Vec_PTI_Check1(1, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int, arg1), PyGLM_Vec_PTI_Get1(1, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint32, arg1) && PyGLM_Vec_PTI_Check1(1, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint32, arg1), PyGLM_Vec_PTI_Get1(1, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint64, arg1) && PyGLM_Vec_PTI_Check1(1, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint64, arg1), PyGLM_Vec_PTI_Get1(1, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint16, arg1) && PyGLM_Vec_PTI_Check1(1, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint16, arg1), PyGLM_Vec_PTI_Get1(1, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, uint8, arg1) && PyGLM_Vec_PTI_Check1(1, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, uint8, arg1), PyGLM_Vec_PTI_Get1(1, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, bool, arg1) && PyGLM_Vec_PTI_Check1(1, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, bool, arg1), PyGLM_Vec_PTI_Get1(1, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int, arg1) && PyGLM_Vec_PTI_Check1(2, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int, arg1), PyGLM_Vec_PTI_Get1(2, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint32, arg1) && PyGLM_Vec_PTI_Check1(2, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint32, arg1), PyGLM_Vec_PTI_Get1(2, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint64, arg1) && PyGLM_Vec_PTI_Check1(2, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint64, arg1), PyGLM_Vec_PTI_Get1(2, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint16, arg1) && PyGLM_Vec_PTI_Check1(2, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint16, arg1), PyGLM_Vec_PTI_Get1(2, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, uint8, arg1) && PyGLM_Vec_PTI_Check1(2, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, uint8, arg1), PyGLM_Vec_PTI_Get1(2, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, bool, arg1) && PyGLM_Vec_PTI_Check1(2, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, bool, arg1), PyGLM_Vec_PTI_Get1(2, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int, arg1) && PyGLM_Vec_PTI_Check1(3, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int, arg1), PyGLM_Vec_PTI_Get1(3, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint64, arg1) && PyGLM_Vec_PTI_Check1(3, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint64, arg1), PyGLM_Vec_PTI_Get1(3, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint16, arg1) && PyGLM_Vec_PTI_Check1(3, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint16, arg1), PyGLM_Vec_PTI_Get1(3, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, uint8, arg1) && PyGLM_Vec_PTI_Check1(3, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, uint8, arg1), PyGLM_Vec_PTI_Get1(3, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, bool, arg1) && PyGLM_Vec_PTI_Check1(3, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, bool, arg1), PyGLM_Vec_PTI_Get1(3, bool, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int, arg1) && PyGLM_Vec_PTI_Check1(4, int, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int, arg1), PyGLM_Vec_PTI_Get1(4, int, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint32, arg1) && PyGLM_Vec_PTI_Check1(4, uint32, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint32, arg1), PyGLM_Vec_PTI_Get1(4, uint32, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint64, arg1) && PyGLM_Vec_PTI_Check1(4, uint64, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint64, arg1), PyGLM_Vec_PTI_Get1(4, uint64, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint16, arg1) && PyGLM_Vec_PTI_Check1(4, uint16, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint16, arg1), PyGLM_Vec_PTI_Get1(4, uint16, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, uint8, arg1) && PyGLM_Vec_PTI_Check1(4, uint8, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, uint8, arg1), PyGLM_Vec_PTI_Get1(4, uint8, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, bool, arg1) && PyGLM_Vec_PTI_Check1(4, bool, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, bool, arg1), PyGLM_Vec_PTI_Get1(4, bool, arg2)));\ - }\ - if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(float, arg1), PyGLM_Qua_PTI_Get1(float, arg2)));\ - }\ - if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) {\ - return pack(glm::NAME(PyGLM_Qua_PTI_Get0(double, arg1), PyGLM_Qua_PTI_Get1(double, arg2)));\ - }\ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int64, arg1), PyGLM_VecOrMVec_Get(1, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int32, arg1), PyGLM_VecOrMVec_Get(1, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int16, arg1), PyGLM_VecOrMVec_Get(1, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, int8, arg1), PyGLM_VecOrMVec_Get(1, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint64, arg1), PyGLM_VecOrMVec_Get(1, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint32, arg1), PyGLM_VecOrMVec_Get(1, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint16, arg1), PyGLM_VecOrMVec_Get(1, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, uint8, arg1), PyGLM_VecOrMVec_Get(1, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, bool>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, bool, arg1), PyGLM_VecOrMVec_Get(1, bool, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int64, arg1), PyGLM_VecOrMVec_Get(2, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int32, arg1), PyGLM_VecOrMVec_Get(2, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int16, arg1), PyGLM_VecOrMVec_Get(2, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, int8, arg1), PyGLM_VecOrMVec_Get(2, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint64, arg1), PyGLM_VecOrMVec_Get(2, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint32, arg1), PyGLM_VecOrMVec_Get(2, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint16, arg1), PyGLM_VecOrMVec_Get(2, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, uint8, arg1), PyGLM_VecOrMVec_Get(2, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, bool>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, bool, arg1), PyGLM_VecOrMVec_Get(2, bool, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int64, arg1), PyGLM_VecOrMVec_Get(3, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int32, arg1), PyGLM_VecOrMVec_Get(3, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int16, arg1), PyGLM_VecOrMVec_Get(3, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, int8, arg1), PyGLM_VecOrMVec_Get(3, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint64, arg1), PyGLM_VecOrMVec_Get(3, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint32, arg1), PyGLM_VecOrMVec_Get(3, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint16, arg1), PyGLM_VecOrMVec_Get(3, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, uint8, arg1), PyGLM_VecOrMVec_Get(3, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, bool>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, bool, arg1), PyGLM_VecOrMVec_Get(3, bool, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int64, arg1), PyGLM_VecOrMVec_Get(4, int64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int32, arg1), PyGLM_VecOrMVec_Get(4, int32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int16, arg1), PyGLM_VecOrMVec_Get(4, int16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, int8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, int8, arg1), PyGLM_VecOrMVec_Get(4, int8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint64>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint64, arg1), PyGLM_VecOrMVec_Get(4, uint64, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint32>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint32, arg1), PyGLM_VecOrMVec_Get(4, uint32, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint16>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint16, arg1), PyGLM_VecOrMVec_Get(4, uint16, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, uint8>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, uint8, arg1), PyGLM_VecOrMVec_Get(4, uint8, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, bool>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, bool, arg1), PyGLM_VecOrMVec_Get(4, bool, arg2))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(float, arg1), PyGLM_Qua_Get(float, arg2))); \ + case PyGLMTypeObjectArrayOffsetQua(): \ + return pack(glm::NAME(PyGLM_Qua_Get(double, arg1), PyGLM_Qua_Get(double, arg2))); \ + } \ + } \ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } @@ -1658,32 +1215,32 @@ static PyObject*\ NAME##_(PyObject*, PyObject* args) {\ PyObject *arg1, *arg2;\ PyGLM_Arg_Unpack_2O(args, #NAME, arg1, arg2);\ - PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_SHAPE_ALL | PyGLM_DT_FD);\ - if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));\ - }\ - if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {\ - return pack(glm::NAME(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));\ - }\ + if (Is_PyGLM_Object(arg1) && Is_PyGLM_Object(arg2)) { \ + GET_PyGLM_ARG_TYPE(arg1); \ + GET_PyGLM_ARG_TYPE(arg2); \ + GET_PyGLM_ARG_SUBTYPE(arg1); \ + GET_PyGLM_ARG_SUBTYPE(arg2); \ + if (arg1Subtype == arg2Subtype) { \ + switch (GET_PyGLMTypeObjectArrayOffsetOfType(arg1Subtype)) { \ + case PyGLMTypeObjectArrayOffsetVec<1, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, float, arg1), PyGLM_VecOrMVec_Get(1, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<1, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(1, double, arg1), PyGLM_VecOrMVec_Get(1, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, float, arg1), PyGLM_VecOrMVec_Get(2, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<2, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(2, double, arg1), PyGLM_VecOrMVec_Get(2, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, float, arg1), PyGLM_VecOrMVec_Get(3, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<3, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(3, double, arg1), PyGLM_VecOrMVec_Get(3, double, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, float>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, float, arg1), PyGLM_VecOrMVec_Get(4, float, arg2))); \ + case PyGLMTypeObjectArrayOffsetVec<4, double>(): \ + return pack(glm::NAME(PyGLM_VecOrMVec_Get(4, double, arg1), PyGLM_VecOrMVec_Get(4, double, arg2))); \ + } \ + } \ + } \ PyGLM_TYPEERROR_2O("invalid argument type(s) for " #NAME "(): ", arg1, arg2);\ return NULL;\ } diff --git a/PyGLM/internal_functions/type_checkers.h b/PyGLM/internal_functions/type_checkers.h index e288ae9..3b6611f 100644 --- a/PyGLM/internal_functions/type_checkers.h +++ b/PyGLM/internal_functions/type_checkers.h @@ -10,6 +10,8 @@ #include "helper_macros.h" #include "number_functions.h" +#include "../functions/function_generator_macros.h" +#include "packers.h" #include @@ -28,6 +30,66 @@ #define _SUB_PyGLM_PTI_GET_TYPE(o) ((o->ob_type->tp_dealloc == (destructor)vec_dealloc) ? PyGLM_T_VEC : (o->ob_type->tp_dealloc == (destructor)mat_dealloc) ? PyGLM_T_MAT : (o->ob_type->tp_dealloc == (destructor)qua_dealloc) ? PyGLM_T_QUA : (o->ob_type->tp_dealloc == (destructor)mvec_dealloc) ? PyGLM_T_MVEC : PyGLM_UNKNOWN) #define PyGLM_PTI_GET_TYPE(o) _SUB_PyGLM_PTI_GET_TYPE(((PyObject*)o)) +template +static constexpr int get_PTI_type() { + return ( + (std::is_same::value) ? PyGLM_DT_DOUBLE : + (std::is_same::value) ? PyGLM_DT_FLOAT : + (std::is_same::value) ? PyGLM_DT_INT : + (std::is_same::value) ? PyGLM_DT_UINT : + (std::is_same::value) ? PyGLM_DT_INT64 : + (std::is_same::value) ? PyGLM_DT_UINT64 : + (std::is_same::value) ? PyGLM_DT_INT16 : + (std::is_same::value) ? PyGLM_DT_UINT16 : + (std::is_same::value) ? PyGLM_DT_INT8 : + (std::is_same::value) ? PyGLM_DT_UINT8 : + PyGLM_DT_BOOL + ); +} + +template +static constexpr int get_vec_PTI_info() { + return PyGLM_T_VEC | + ( + (L == 1) ? PyGLM_SHAPE_1 : + (L == 2) ? PyGLM_SHAPE_2 : + (L == 3) ? PyGLM_SHAPE_3 : + PyGLM_SHAPE_4 + ) | + get_PTI_type(); +} + +template +static constexpr int get_mat_PTI_info() { + return PyGLM_T_MAT | + ( + (C == 2) ? + ( + (R == 2) ? PyGLM_SHAPE_2x2 : + (R == 3) ? PyGLM_SHAPE_2x3 : + PyGLM_SHAPE_2x4 + ) : + (C == 3) ? + ( + (R == 2) ? PyGLM_SHAPE_3x2 : + (R == 3) ? PyGLM_SHAPE_3x3 : + PyGLM_SHAPE_3x4 + ) : + ( + (R == 2) ? PyGLM_SHAPE_4x2 : + (R == 3) ? PyGLM_SHAPE_4x3 : + PyGLM_SHAPE_4x4 + ) + ) | + get_PTI_type(); +} + +template +static constexpr int get_qua_PTI_info() { + return PyGLM_T_QUA | + get_PTI_type(); +} + enum class _FormatType { FLOAT, DOUBLE, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, BOOL, NONE }; @@ -2456,6 +2518,32 @@ struct PyGLMTypeInfo { return *((glm::qua*)data); } + PyObject* asPyObject() { + switch (info) { +#define PyGLM_TEMPLATE_FUNC(L, T) \ + case get_vec_PTI_info(): \ + return pack(getVec()); + + PyGLM_CODEGEN_PARAM_L_ALL(PyGLM_CODEGEN_PARAM_T_Vec_ALL, PyGLM_TEMPLATE_FUNC); +#undef PyGLM_TEMPLATE_FUNC + +#define PyGLM_TEMPLATE_FUNC(C, R, T) \ + case get_mat_PTI_info(): \ + return pack(getMat()); + + PyGLM_CODEGEN_PARAM_C_ALL(PyGLM_CODEGEN_PARAM_R_ALL, PyGLM_CODEGEN_PARAM_T_Mat_fFiI, PyGLM_TEMPLATE_FUNC); +#undef PyGLM_TEMPLATE_FUNC + +#define PyGLM_TEMPLATE_FUNC(T) \ + case get_qua_PTI_info(): \ + return pack(getQua()); + + PyGLM_CODEGEN_PARAM_T_Qua_fF(PyGLM_TEMPLATE_FUNC); +#undef PyGLM_TEMPLATE_FUNC + } + return Py_None; + } + private: inline void allocate(size_t size) { assert(size <= 128); @@ -2493,65 +2581,7 @@ struct PyGLMTypeInfo { #define PyGLM_Qua_CheckExact(T, o) (Py_TYPE(o) == UNBRACKET (PyGLM_QUA_TYPE())) -template -static constexpr int get_PTI_type() { - return ( - (std::is_same::value) ? PyGLM_DT_DOUBLE : - (std::is_same::value) ? PyGLM_DT_FLOAT : - (std::is_same::value) ? PyGLM_DT_INT : - (std::is_same::value) ? PyGLM_DT_UINT : - (std::is_same::value) ? PyGLM_DT_INT64 : - (std::is_same::value) ? PyGLM_DT_UINT64 : - (std::is_same::value) ? PyGLM_DT_INT16 : - (std::is_same::value) ? PyGLM_DT_UINT16 : - (std::is_same::value) ? PyGLM_DT_INT8 : - (std::is_same::value) ? PyGLM_DT_UINT8 : - PyGLM_DT_BOOL - ); -} -template -static constexpr int get_vec_PTI_info() { - return PyGLM_T_VEC | - ( - (L == 1) ? PyGLM_SHAPE_1 : - (L == 2) ? PyGLM_SHAPE_2 : - (L == 3) ? PyGLM_SHAPE_3 : - PyGLM_SHAPE_4 - ) | - get_PTI_type(); -} - -template -static constexpr int get_mat_PTI_info() { - return PyGLM_T_MAT | - ( - (C == 2) ? - ( - (R == 2) ? PyGLM_SHAPE_2x2 : - (R == 3) ? PyGLM_SHAPE_2x3 : - PyGLM_SHAPE_2x4 - ) : - (C == 3) ? - ( - (R == 2) ? PyGLM_SHAPE_3x2 : - (R == 3) ? PyGLM_SHAPE_3x3 : - PyGLM_SHAPE_3x4 - ) : - ( - (R == 2) ? PyGLM_SHAPE_4x2 : - (R == 3) ? PyGLM_SHAPE_4x3 : - PyGLM_SHAPE_4x4 - ) - ) | - get_PTI_type(); -} - -template -static constexpr int get_qua_PTI_info() { - return PyGLM_T_QUA | - get_PTI_type(); -} static bool GET_PTI_COMPATIBLE_SIMPLE(PyObject* o, int accepted_types) { int& PTI_info = ((PyGLMTypeObject*)(o->ob_type))->PTI_info; @@ -2839,4 +2869,23 @@ static SourceType sourceType3; #define PyGLM_Qua_PTI_Assign2(T) glm::qua o3 = PyGLM_Qua_PTI_Get2(T, arg3); #define PyGLM_Qua_PTI_Assign3(T) glm::qua o4 = PyGLM_Qua_PTI_Get3(T, arg4); +// New typecheckers +#define Is_PyGLM_TypeObject(o) (PyGLMTypeObjectArrayStart <= reinterpret_cast(o) && reinterpret_cast(o) < PyGLMTypeObjectArrayEnd) +#define Is_PyGLM_Object(o) Is_PyGLM_TypeObject(Py_TYPE(o)) + + +#define GET_PyGLM_ARG_TYPE(name) PyGLMTypeObject* const name ## Type = reinterpret_cast(Py_TYPE(name)) +#define GET_PyGLM_ArgSubtype(name) (reinterpret_cast((name ## Type)->subtype)) +#define GET_PyGLM_ARG_SUBTYPE(name) PyGLMTypeObject* const name ## Subtype = GET_PyGLM_ArgSubtype(name) +#define GET_PyGLM_ARG_TYPE_OFFSET(name) const ptrdiff_t name ## TypeOffset = name ## Type - PyGLMTypeObjectArrayStart +#define GET_PyGLMTypeObjectArrayOffsetOfType(t) (reinterpret_cast(t) - PyGLMTypeObjectArrayStart) +#define GET_PyGLMTypeObjectArrayOffsetOf(o) (GET_PyGLMTypeObjectArrayOffsetOfType(Py_TYPE(o))) + +#define PyGLM_Vec_Get(L, T, o) (reinterpret_cast*>(o)->super_type) +#define PyGLM_VecOrMVec_Get(L, T, name) (*(reinterpret_cast*>((name ## Type)->getDataOf(name)))) +#define PyGLM_VecOrMVec_GET(L, T, o) (*(reinterpret_cast*>(reinterpret_cast(Py_TYPE(o))->getDataOf(o)))) +#define PyGLM_Mat_Get(C, R, T, o) (reinterpret_cast*>(o)->super_type) +#define PyGLM_MVec_Get(L, T, o) (*(reinterpret_cast*>(o)->super_type)) +#define PyGLM_Qua_Get(T, o) (reinterpret_cast*>(o)->super_type) + #include "unpackers.h" \ No newline at end of file diff --git a/PyGLM/internal_functions/type_getters/type_checkers.h b/PyGLM/internal_functions/type_getters/type_checkers.h deleted file mode 100644 index aee08fa..0000000 --- a/PyGLM/internal_functions/type_getters/type_checkers.h +++ /dev/null @@ -1,241 +0,0 @@ -#pragma once - -#include "../compiler_setup.h" - -#define _SUB_PyGLM_GET_TYPE(o) ((o->ob_type->tp_dealloc == NULL) ? PyGLM_TYPE_UNKNOWN : (o->ob_type->tp_dealloc == (destructor)vec_dealloc) ? PyGLM_TYPE_VEC : (o->ob_type->tp_dealloc == (destructor)mat_dealloc) ? PyGLM_TYPE_MAT : (o->ob_type->tp_dealloc == (destructor)qua_dealloc) ? PyGLM_TYPE_QUA : (o->ob_type->tp_dealloc == (destructor)mvec_dealloc) ? PyGLM_TYPE_VEC : PyGLM_TYPE_UNKNOWN) -#define PyGLM_GET_TYPE(o) _SUB_PyGLM_GET_TYPE(((PyObject*)o)) - -#define PyGLM_VEC_SHAPE_CHECK(o, L) (((shape_helper*)o)->shape == L) -#define PyGLM_MAT_SHAPE_CHECK(o, C, R) (((shape_helper*)o)->shape == (C + (R << 3))) - -#if !(PyGLM_BUILD & PyGLM_NO_ITER_TYPECHECKING) -bool PyGLM_Vec1i_Check(PyObject* o) { - if (!PyObject_IterCheck(o)) { - return false; - } - if (PyTuple_Check(o)) { - if (Py_SIZE(o) == 1 && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 0))) { - return true; - } - return false; - } - if (PyObject_Length(o) != 1) { - return false; - } - - PyObject* iterator = PyObject_GetIter(o); - - PyObject* value0 = PyIter_Next(iterator); - - Py_DECREF(iterator); - - if (value0 == NULL || !PyGLM_Number_Check(value0)) { - Py_XDECREF(value0); - - return false; - } - Py_DECREF(value0); - - return true; -} - -bool PyGLM_Vec2i_Check(PyObject* o) { - if (!PyObject_IterCheck(o)) { - return false; - } - if (PyTuple_Check(o)) { - if (Py_SIZE(o) == 2 && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 0)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 1))) { - return true; - } - return false; - } - if (PyObject_Length(o) != 2) { - return false; - } - - PyObject* iterator = PyObject_GetIter(o); - - PyObject* value0 = PyIter_Next(iterator); - PyObject* value1 = PyIter_Next(iterator); - - Py_DECREF(iterator); - - if (value0 == NULL || !PyGLM_Number_Check(value0) || value1 == NULL || !PyGLM_Number_Check(value1)) { - Py_XDECREF(value0); - Py_XDECREF(value1); - - return false; - } - Py_DECREF(value0); - Py_DECREF(value1); - - return true; -} - -bool PyGLM_Vec3i_Check(PyObject* o) { - if (!PyObject_IterCheck(o)) { - return false; - } - if (PyTuple_Check(o)) { - if (Py_SIZE(o) == 3 && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 0)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 1)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 2))) { - return true; - } - return false; - } - if (PyObject_Length(o) != 3) { - return false; - } - - PyObject* iterator = PyObject_GetIter(o); - - PyObject* value0 = PyIter_Next(iterator); - PyObject* value1 = PyIter_Next(iterator); - PyObject* value2 = PyIter_Next(iterator); - - - Py_DECREF(iterator); - - - if (value0 == NULL || !PyGLM_Number_Check(value0) || value1 == NULL || !PyGLM_Number_Check(value1) || value2 == NULL || !PyGLM_Number_Check(value2)) { - - Py_XDECREF(value0); - Py_XDECREF(value1); - Py_XDECREF(value2); - - return false; - } - Py_DECREF(value0); - Py_DECREF(value1); - Py_DECREF(value2); - - return true; -} - -bool PyGLM_Vec4i_Check(PyObject* o) { - if (!PyObject_IterCheck(o)) { - return false; - } - if (PyTuple_Check(o)) { - if (Py_SIZE(o) == 4 && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 0)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 1)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 2)) && PyGLM_Number_Check(PyTuple_GET_ITEM(o, 3))) { - return true; - } - return false; - } - if (PyObject_Length(o) != 4) { - return false; - } - - PyObject* iterator = PyObject_GetIter(o); - - PyObject* value0 = PyIter_Next(iterator); - PyObject* value1 = PyIter_Next(iterator); - PyObject* value2 = PyIter_Next(iterator); - PyObject* value3 = PyIter_Next(iterator); - - - Py_DECREF(iterator); - - - if (value0 == NULL || !PyGLM_Number_Check(value0) || value1 == NULL || !PyGLM_Number_Check(value1) || value2 == NULL || !PyGLM_Number_Check(value2) || value3 == NULL || !PyGLM_Number_Check(value3)) { - - Py_XDECREF(value0); - Py_XDECREF(value1); - Py_XDECREF(value2); - Py_XDECREF(value3); - - return false; - } - Py_DECREF(value0); - Py_DECREF(value1); - Py_DECREF(value2); - Py_DECREF(value3); - - return true; -} - -#define PyGLM_Veci_Check(L, o) ((L == 1) ? PyGLM_Vec1i_Check(o) : (L == 2) ? PyGLM_Vec2i_Check(o) : (L == 3) ? PyGLM_Vec3i_Check(o) : PyGLM_Vec4i_Check(o)) - -template -static bool get_view_format_equal(char* value) { - char& v_char = value[0]; - if (v_char == 'f') { - return std::is_same::value; - } - if (v_char == 'd') { - return std::is_same::value; - } - if (v_char == 'c') { - return std::is_same::value; - } - if (v_char == 'b') { - return std::is_same::value; - } - if (v_char == 'h') { - return std::is_same::value; - } - if (v_char == 'H') { - return std::is_same::value; - } - if (v_char == 'i') { - return std::is_same::value; - } - if (v_char == 'I') { - return std::is_same::value; - } - if (v_char == 'L') { - return std::is_same::value; - } - if (v_char == 'K') { - return std::is_same::value; - } - if (v_char == 'p') { - return std::is_same::value; - } - return false; -} - -template -static bool PyGLM_Matb_Check(int C, int R, PyObject* o) { - if (!PyObject_CheckBuffer(o)) { - return false; - } - Py_buffer view; - if (PyObject_GetBuffer(o, &view, PyBUF_RECORDS_RO | PyBUF_C_CONTIGUOUS) == -1 || (((view.ndim != 2 || view.shape[0] != static_cast(C) || view.shape[1] != static_cast(R) || !get_view_format_equal(view.format)) && (view.ndim != 1 || view.shape[0] != static_cast(C * R * sizeof(T)) || view.format[0] != 'B')))) { - PyBuffer_Release(&view); - return false; - } - PyBuffer_Release(&view); - return true; -} - -template -static bool PyGLM_Vecb_Check(int L, PyObject* o) { - if (!PyObject_CheckBuffer(o)) { - return false; - } - Py_buffer view; - if (PyObject_GetBuffer(o, &view, PyBUF_RECORDS_RO | PyBUF_C_CONTIGUOUS) == -1 || (view.ndim != 1 || ((view.shape[0] != static_cast(L) || !get_view_format_equal(view.format)) && (view.shape[0] != static_cast(L * sizeof(T)) || view.format[0] != 'B')))) { - PyBuffer_Release(&view); - return false; - } - PyBuffer_Release(&view); - return true; -} - -#define PyGLM_Vec_Check(L, T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_VEC_TYPE())) || Py_TYPE(o) == PyGLM_MVEC_TYPE() || ((PyGLM_GET_TYPE(o) == PyGLM_TYPE_UNKNOWN) && (PyGLM_Vecb_Check(L, (PyObject*)o)))) - -#define PyGLM_Vec_Check_IgnoreType(L, T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_VEC_TYPE())) || Py_TYPE(o) == PyGLM_MVEC_TYPE() || ((PyGLM_GET_TYPE(o) == PyGLM_TYPE_UNKNOWN || (PyGLM_GET_TYPE(o) == PyGLM_TYPE_VEC && PyGLM_VEC_SHAPE_CHECK(o, L))) && ((PyGLM_Vecb_Check(L, (PyObject*)o)) || (PyGLM_Veci_Check(L, o))))) - -#define PyGLM_Qua_Check(T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_QUA_TYPE())) || ((PyGLM_GET_TYPE(o) == PyGLM_TYPE_UNKNOWN || (PyGLM_GET_TYPE(o) == PyGLM_TYPE_QUA)) && PyGLM_Vecb_Check(4, (PyObject*)o))) - -#define PyGLM_Mat_Check(C, R, T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_MAT_TYPE())) || ((PyGLM_GET_TYPE(o) == PyGLM_TYPE_UNKNOWN || (PyGLM_GET_TYPE(o) == PyGLM_TYPE_MAT && PyGLM_MAT_SHAPE_CHECK(o, C, R))) && PyGLM_Matb_Check(C, R, (PyObject*)o))) - -#else -#define PyGLM_Vec_Check(L, T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_VEC_TYPE())) || Py_TYPE(o) == PyGLM_MVEC_TYPE()) - -#define PyGLM_Vec_Check_IgnoreType PyGLM_Vec_Check - -#define PyGLM_Qua_Check(T, o) (PyObject_TypeCheck(o, UNBRACKET (PyGLM_QUA_TYPE()))) - -#define PyGLM_Mat_Check(C, R, T, o) PyObject_TypeCheck(o, UNBRACKET (PyGLM_MAT_TYPE())) -#endif \ No newline at end of file diff --git a/PyGLM/types/all.h b/PyGLM/types/all.h index ad4892f..9fb201c 100644 --- a/PyGLM/types/all.h +++ b/PyGLM/types/all.h @@ -12,4 +12,6 @@ #include "qua/all.h" -#include "glmArray/glmArray.h" \ No newline at end of file +#include "glmArray/glmArray.h" + +#include "typeobjects.h" diff --git a/PyGLM/types/mat/double/mat2x2.h b/PyGLM/types/mat/double/mat2x2.h index bee12ef..3b86c91 100644 --- a/PyGLM/types/mat/double/mat2x2.h +++ b/PyGLM/types/mat/double/mat2x2.h @@ -114,54 +114,51 @@ static PyTypeObject hdmat2x2IterType = { (newfunc)matIter_new<2, 2, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat2x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat2x2", /* tp_name */ - sizeof(mat<2, 2, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x2_repr, /* tp_repr */ - & hdmat2x2NumMethods, /* tp_as_number */ - & hdmat2x2SeqMethods, /* tp_as_sequence */ - & hdmat2x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 2, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat2x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat2x2( )\n2 columns of 2 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 2, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 2, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat2x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 2, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 2, - sizeof(double), - sizeof(glm::mat<2, 2, double>), +#define DMAT2x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat2x2", /* tp_name */ \ + sizeof(mat<2, 2, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x2_repr, /* tp_repr */ \ + & hdmat2x2NumMethods, /* tp_as_number */ \ + & hdmat2x2SeqMethods, /* tp_as_sequence */ \ + & hdmat2x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 2, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat2x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat2x2( )\n2 columns of 2 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 2, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 2, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat2x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 2, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 2, \ + sizeof(double), \ + sizeof(glm::mat<2, 2, double>), \ PyGLM_FS_DOUBLE -}; -static PyTypeObject& hdmat2x2Type = *((PyTypeObject*)&hdmat2x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat2x3.h b/PyGLM/types/mat/double/mat2x3.h index 3e1e484..8c4d848 100644 --- a/PyGLM/types/mat/double/mat2x3.h +++ b/PyGLM/types/mat/double/mat2x3.h @@ -114,54 +114,51 @@ static PyTypeObject hdmat2x3IterType = { (newfunc)matIter_new<2, 3, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat2x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat2x3", /* tp_name */ - sizeof(mat<2, 3, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x3_repr, /* tp_repr */ - & hdmat2x3NumMethods, /* tp_as_number */ - & hdmat2x3SeqMethods, /* tp_as_sequence */ - & hdmat2x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 3, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat2x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat2x3( )\n2 columns of 3 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 3, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 3, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat2x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 3, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 3, - sizeof(double), - sizeof(glm::mat<2, 3, double>), +#define DMAT2x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat2x3", /* tp_name */ \ + sizeof(mat<2, 3, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x3_repr, /* tp_repr */ \ + & hdmat2x3NumMethods, /* tp_as_number */ \ + & hdmat2x3SeqMethods, /* tp_as_sequence */ \ + & hdmat2x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 3, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat2x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat2x3( )\n2 columns of 3 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 3, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 3, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat2x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 3, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 3, \ + sizeof(double), \ + sizeof(glm::mat<2, 3, double>), \ PyGLM_FS_DOUBLE -}; -static PyTypeObject& hdmat2x3Type = *((PyTypeObject*)&hdmat2x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat2x4.h b/PyGLM/types/mat/double/mat2x4.h index 4681f11..d5a74c4 100644 --- a/PyGLM/types/mat/double/mat2x4.h +++ b/PyGLM/types/mat/double/mat2x4.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat2x4IterType = { (newfunc)matIter_new<2, 4, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat2x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat2x4", /* tp_name */ - sizeof(mat<2, 4, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x4_repr, /* tp_repr */ - & hdmat2x4NumMethods, /* tp_as_number */ - & hdmat2x4SeqMethods, /* tp_as_sequence */ - & hdmat2x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 4, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat2x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat2x4( )\n2 columns of 4 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 4, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 4, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat2x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 4, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 4, - sizeof(double), - sizeof(glm::mat<2, 4, double>), +#define DMAT2x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat2x4", /* tp_name */ \ + sizeof(mat<2, 4, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x4_repr, /* tp_repr */ \ + & hdmat2x4NumMethods, /* tp_as_number */ \ + & hdmat2x4SeqMethods, /* tp_as_sequence */ \ + & hdmat2x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 4, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat2x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat2x4( )\n2 columns of 4 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 4, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 4, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat2x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 4, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 4, \ + sizeof(double), \ + sizeof(glm::mat<2, 4, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat2x4Type = *((PyTypeObject*)&hdmat2x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat3x2.h b/PyGLM/types/mat/double/mat3x2.h index a7ad851..e524995 100644 --- a/PyGLM/types/mat/double/mat3x2.h +++ b/PyGLM/types/mat/double/mat3x2.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat3x2IterType = { (newfunc)matIter_new<3, 2, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat3x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat3x2", /* tp_name */ - sizeof(mat<3, 2, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x2_repr, /* tp_repr */ - & hdmat3x2NumMethods, /* tp_as_number */ - & hdmat3x2SeqMethods, /* tp_as_sequence */ - & hdmat3x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 2, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat3x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat3x2( )\n3 columns of 2 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 2, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 2, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat3x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 2, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 2, - sizeof(double), - sizeof(glm::mat<3, 2, double>), +#define DMAT3x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat3x2", /* tp_name */ \ + sizeof(mat<3, 2, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x2_repr, /* tp_repr */ \ + & hdmat3x2NumMethods, /* tp_as_number */ \ + & hdmat3x2SeqMethods, /* tp_as_sequence */ \ + & hdmat3x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 2, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat3x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat3x2( )\n3 columns of 2 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 2, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 2, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat3x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 2, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 2, \ + sizeof(double), \ + sizeof(glm::mat<3, 2, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat3x2Type = *((PyTypeObject*)&hdmat3x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat3x3.h b/PyGLM/types/mat/double/mat3x3.h index afcf310..97e2f4c 100644 --- a/PyGLM/types/mat/double/mat3x3.h +++ b/PyGLM/types/mat/double/mat3x3.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat3x3IterType = { (newfunc)matIter_new<3, 3, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat3x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat3x3", /* tp_name */ - sizeof(mat<3, 3, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x3_repr, /* tp_repr */ - & hdmat3x3NumMethods, /* tp_as_number */ - & hdmat3x3SeqMethods, /* tp_as_sequence */ - & hdmat3x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 3, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat3x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat3x3( )\n3 columns of 3 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 3, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 3, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat3x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 3, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 3, - sizeof(double), - sizeof(glm::mat<3, 3, double>), +#define DMAT3x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat3x3", /* tp_name */ \ + sizeof(mat<3, 3, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x3_repr, /* tp_repr */ \ + & hdmat3x3NumMethods, /* tp_as_number */ \ + & hdmat3x3SeqMethods, /* tp_as_sequence */ \ + & hdmat3x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 3, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat3x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat3x3( )\n3 columns of 3 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 3, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 3, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat3x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 3, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 3, \ + sizeof(double), \ + sizeof(glm::mat<3, 3, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat3x3Type = *((PyTypeObject*)&hdmat3x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat3x4.h b/PyGLM/types/mat/double/mat3x4.h index 9813ca2..6cfa6b5 100644 --- a/PyGLM/types/mat/double/mat3x4.h +++ b/PyGLM/types/mat/double/mat3x4.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat3x4IterType = { (newfunc)matIter_new<3, 4, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat3x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat3x4", /* tp_name */ - sizeof(mat<3, 4, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x4_repr, /* tp_repr */ - & hdmat3x4NumMethods, /* tp_as_number */ - & hdmat3x4SeqMethods, /* tp_as_sequence */ - & hdmat3x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 4, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat3x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat3x4( )\n3 columns of 4 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 4, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 4, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat3x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 4, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 4, - sizeof(double), - sizeof(glm::mat<3, 4, double>), +#define DMAT3x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat3x4", /* tp_name */ \ + sizeof(mat<3, 4, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x4_repr, /* tp_repr */ \ + & hdmat3x4NumMethods, /* tp_as_number */ \ + & hdmat3x4SeqMethods, /* tp_as_sequence */ \ + & hdmat3x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 4, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat3x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat3x4( )\n3 columns of 4 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 4, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 4, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat3x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 4, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 4, \ + sizeof(double), \ + sizeof(glm::mat<3, 4, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat3x4Type = *((PyTypeObject*)&hdmat3x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat4x2.h b/PyGLM/types/mat/double/mat4x2.h index 639e19e..3657fb3 100644 --- a/PyGLM/types/mat/double/mat4x2.h +++ b/PyGLM/types/mat/double/mat4x2.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat4x2IterType = { (newfunc)matIter_new<4, 2, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat4x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat4x2", /* tp_name */ - sizeof(mat<4, 2, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x2_repr, /* tp_repr */ - & hdmat4x2NumMethods, /* tp_as_number */ - & hdmat4x2SeqMethods, /* tp_as_sequence */ - & hdmat4x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 2, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat4x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat4x2( )\n4 columns of 2 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 2, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 2, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat4x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 2, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 2, - sizeof(double), - sizeof(glm::mat<4, 2, double>), +#define DMAT4x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat4x2", /* tp_name */ \ + sizeof(mat<4, 2, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x2_repr, /* tp_repr */ \ + & hdmat4x2NumMethods, /* tp_as_number */ \ + & hdmat4x2SeqMethods, /* tp_as_sequence */ \ + & hdmat4x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 2, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat4x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat4x2( )\n4 columns of 2 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 2, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 2, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat4x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 2, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 2, \ + sizeof(double), \ + sizeof(glm::mat<4, 2, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat4x2Type = *((PyTypeObject*)&hdmat4x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat4x3.h b/PyGLM/types/mat/double/mat4x3.h index 96864e0..80cd6e4 100644 --- a/PyGLM/types/mat/double/mat4x3.h +++ b/PyGLM/types/mat/double/mat4x3.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat4x3IterType = { (newfunc)matIter_new<4, 3, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat4x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat4x3", /* tp_name */ - sizeof(mat<4, 3, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x3_repr, /* tp_repr */ - & hdmat4x3NumMethods, /* tp_as_number */ - & hdmat4x3SeqMethods, /* tp_as_sequence */ - & hdmat4x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 3, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat4x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat4x3( )\n4 columns of 3 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 3, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 3, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat4x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 3, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 3, - sizeof(double), - sizeof(glm::mat<4, 3, double>), +#define DMAT4x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat4x3", /* tp_name */ \ + sizeof(mat<4, 3, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x3_repr, /* tp_repr */ \ + & hdmat4x3NumMethods, /* tp_as_number */ \ + & hdmat4x3SeqMethods, /* tp_as_sequence */ \ + & hdmat4x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 3, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat4x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat4x3( )\n4 columns of 3 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 3, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 3, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat4x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 3, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 3, \ + sizeof(double), \ + sizeof(glm::mat<4, 3, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat4x3Type = *((PyTypeObject*)&hdmat4x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/double/mat4x4.h b/PyGLM/types/mat/double/mat4x4.h index b5516d9..da50603 100644 --- a/PyGLM/types/mat/double/mat4x4.h +++ b/PyGLM/types/mat/double/mat4x4.h @@ -114,54 +114,50 @@ static PyTypeObject hdmat4x4IterType = { (newfunc)matIter_new<4, 4, double>, /* tp_new */ }; -static PyGLMTypeObject hdmat4x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmat4x4", /* tp_name */ - sizeof(mat<4, 4, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x4_repr, /* tp_repr */ - & hdmat4x4NumMethods, /* tp_as_number */ - & hdmat4x4SeqMethods, /* tp_as_sequence */ - & hdmat4x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 4, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdmat4x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmat4x4( )\n4 columns of 4 components matrix of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 4, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 4, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmat4x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 4, double>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 4, - sizeof(double), - sizeof(glm::mat<4, 4, double>), +#define DMAT4x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmat4x4", /* tp_name */ \ + sizeof(mat<4, 4, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x4_repr, /* tp_repr */ \ + & hdmat4x4NumMethods, /* tp_as_number */ \ + & hdmat4x4SeqMethods, /* tp_as_sequence */ \ + & hdmat4x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 4, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdmat4x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmat4x4( )\n4 columns of 4 components matrix of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 4, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 4, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmat4x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 4, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 4, \ + sizeof(double), \ + sizeof(glm::mat<4, 4, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdmat4x4Type = *((PyTypeObject*)&hdmat4x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat2x2.h b/PyGLM/types/mat/float/mat2x2.h index 233574a..1279aa1 100644 --- a/PyGLM/types/mat/float/mat2x2.h +++ b/PyGLM/types/mat/float/mat2x2.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat2x2IterType = { (newfunc)matIter_new<2, 2, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat2x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat2x2", /* tp_name */ - sizeof(mat<2, 2, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x2_repr, /* tp_repr */ - & hfmat2x2NumMethods, /* tp_as_number */ - & hfmat2x2SeqMethods, /* tp_as_sequence */ - & hfmat2x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 2, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat2x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat2x2( )\n2 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 2, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 2, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat2x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 2, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 2, - sizeof(float), - sizeof(glm::mat<2, 2, float>), +#define FMAT2x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat2x2", /* tp_name */ \ + sizeof(mat<2, 2, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x2_repr, /* tp_repr */ \ + & hfmat2x2NumMethods, /* tp_as_number */ \ + & hfmat2x2SeqMethods, /* tp_as_sequence */ \ + & hfmat2x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 2, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat2x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat2x2( )\n2 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 2, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 2, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat2x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 2, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 2, \ + sizeof(float), \ + sizeof(glm::mat<2, 2, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat2x2Type = *((PyTypeObject*)&hfmat2x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat2x3.h b/PyGLM/types/mat/float/mat2x3.h index 27e2baf..a15b3b5 100644 --- a/PyGLM/types/mat/float/mat2x3.h +++ b/PyGLM/types/mat/float/mat2x3.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat2x3IterType = { (newfunc)matIter_new<2, 3, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat2x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat2x3", /* tp_name */ - sizeof(mat<2, 3, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x3_repr, /* tp_repr */ - & hfmat2x3NumMethods, /* tp_as_number */ - & hfmat2x3SeqMethods, /* tp_as_sequence */ - & hfmat2x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 3, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat2x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat2x3( )\n2 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 3, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 3, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat2x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 3, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 3, - sizeof(float), - sizeof(glm::mat<2, 3, float>), +#define FMAT2x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat2x3", /* tp_name */ \ + sizeof(mat<2, 3, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x3_repr, /* tp_repr */ \ + & hfmat2x3NumMethods, /* tp_as_number */ \ + & hfmat2x3SeqMethods, /* tp_as_sequence */ \ + & hfmat2x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 3, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat2x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat2x3( )\n2 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 3, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 3, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat2x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 3, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 3, \ + sizeof(float), \ + sizeof(glm::mat<2, 3, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat2x3Type = *((PyTypeObject*)&hfmat2x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat2x4.h b/PyGLM/types/mat/float/mat2x4.h index 3002083..6cae732 100644 --- a/PyGLM/types/mat/float/mat2x4.h +++ b/PyGLM/types/mat/float/mat2x4.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat2x4IterType = { (newfunc)matIter_new<2, 4, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat2x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat2x4", /* tp_name */ - sizeof(mat<2, 4, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x4_repr, /* tp_repr */ - & hfmat2x4NumMethods, /* tp_as_number */ - & hfmat2x4SeqMethods, /* tp_as_sequence */ - & hfmat2x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 4, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat2x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat2x4( )\n2 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 4, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 4, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat2x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 4, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 4, - sizeof(float), - sizeof(glm::mat<2, 4, float>), +#define FMAT2x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat2x4", /* tp_name */ \ + sizeof(mat<2, 4, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x4_repr, /* tp_repr */ \ + & hfmat2x4NumMethods, /* tp_as_number */ \ + & hfmat2x4SeqMethods, /* tp_as_sequence */ \ + & hfmat2x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 4, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat2x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat2x4( )\n2 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 4, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 4, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat2x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 4, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 4, \ + sizeof(float), \ + sizeof(glm::mat<2, 4, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat2x4Type = *((PyTypeObject*)&hfmat2x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat3x2.h b/PyGLM/types/mat/float/mat3x2.h index 8c70e64..bb8f3b5 100644 --- a/PyGLM/types/mat/float/mat3x2.h +++ b/PyGLM/types/mat/float/mat3x2.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat3x2IterType = { (newfunc)matIter_new<3, 2, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat3x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat3x2", /* tp_name */ - sizeof(mat<3, 2, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x2_repr, /* tp_repr */ - & hfmat3x2NumMethods, /* tp_as_number */ - & hfmat3x2SeqMethods, /* tp_as_sequence */ - & hfmat3x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 2, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat3x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat3x2( )\n3 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 2, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 2, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat3x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 2, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 2, - sizeof(float), - sizeof(glm::mat<3, 2, float>), +#define FMAT3x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat3x2", /* tp_name */ \ + sizeof(mat<3, 2, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x2_repr, /* tp_repr */ \ + & hfmat3x2NumMethods, /* tp_as_number */ \ + & hfmat3x2SeqMethods, /* tp_as_sequence */ \ + & hfmat3x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 2, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat3x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat3x2( )\n3 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 2, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 2, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat3x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 2, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 2, \ + sizeof(float), \ + sizeof(glm::mat<3, 2, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat3x2Type = *((PyTypeObject*)&hfmat3x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat3x3.h b/PyGLM/types/mat/float/mat3x3.h index f2a5ca9..c82992d 100644 --- a/PyGLM/types/mat/float/mat3x3.h +++ b/PyGLM/types/mat/float/mat3x3.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat3x3IterType = { (newfunc)matIter_new<3, 3, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat3x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat3x3", /* tp_name */ - sizeof(mat<3, 3, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x3_repr, /* tp_repr */ - & hfmat3x3NumMethods, /* tp_as_number */ - & hfmat3x3SeqMethods, /* tp_as_sequence */ - & hfmat3x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 3, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat3x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat3x3( )\n3 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 3, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 3, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat3x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 3, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 3, - sizeof(float), - sizeof(glm::mat<3, 3, float>), +#define FMAT3x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat3x3", /* tp_name */ \ + sizeof(mat<3, 3, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x3_repr, /* tp_repr */ \ + & hfmat3x3NumMethods, /* tp_as_number */ \ + & hfmat3x3SeqMethods, /* tp_as_sequence */ \ + & hfmat3x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 3, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat3x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat3x3( )\n3 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 3, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 3, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat3x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 3, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 3, \ + sizeof(float), \ + sizeof(glm::mat<3, 3, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat3x3Type = *((PyTypeObject*)&hfmat3x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat3x4.h b/PyGLM/types/mat/float/mat3x4.h index 29fcf0f..f57253e 100644 --- a/PyGLM/types/mat/float/mat3x4.h +++ b/PyGLM/types/mat/float/mat3x4.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat3x4IterType = { (newfunc)matIter_new<3, 4, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat3x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat3x4", /* tp_name */ - sizeof(mat<3, 4, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x4_repr, /* tp_repr */ - & hfmat3x4NumMethods, /* tp_as_number */ - & hfmat3x4SeqMethods, /* tp_as_sequence */ - & hfmat3x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 4, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat3x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat3x4( )\n3 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 4, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 4, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat3x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 4, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 4, - sizeof(float), - sizeof(glm::mat<3, 4, float>), +#define FMAT3x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat3x4", /* tp_name */ \ + sizeof(mat<3, 4, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x4_repr, /* tp_repr */ \ + & hfmat3x4NumMethods, /* tp_as_number */ \ + & hfmat3x4SeqMethods, /* tp_as_sequence */ \ + & hfmat3x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 4, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat3x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat3x4( )\n3 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 4, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 4, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat3x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 4, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 4, \ + sizeof(float), \ + sizeof(glm::mat<3, 4, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat3x4Type = *((PyTypeObject*)&hfmat3x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat4x2.h b/PyGLM/types/mat/float/mat4x2.h index 5e5adc8..ec7c320 100644 --- a/PyGLM/types/mat/float/mat4x2.h +++ b/PyGLM/types/mat/float/mat4x2.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat4x2IterType = { (newfunc)matIter_new<4, 2, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat4x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat4x2", /* tp_name */ - sizeof(mat<4, 2, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x2_repr, /* tp_repr */ - & hfmat4x2NumMethods, /* tp_as_number */ - & hfmat4x2SeqMethods, /* tp_as_sequence */ - & hfmat4x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 2, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat4x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat4x2( )\n4 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 2, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 2, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat4x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 2, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 2, - sizeof(float), - sizeof(glm::mat<4, 2, float>), +#define FMAT4x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat4x2", /* tp_name */ \ + sizeof(mat<4, 2, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x2_repr, /* tp_repr */ \ + & hfmat4x2NumMethods, /* tp_as_number */ \ + & hfmat4x2SeqMethods, /* tp_as_sequence */ \ + & hfmat4x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 2, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat4x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat4x2( )\n4 columns of 2 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 2, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 2, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat4x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 2, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 2, \ + sizeof(float), \ + sizeof(glm::mat<4, 2, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat4x2Type = *((PyTypeObject*)&hfmat4x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat4x3.h b/PyGLM/types/mat/float/mat4x3.h index 26591d9..ba56662 100644 --- a/PyGLM/types/mat/float/mat4x3.h +++ b/PyGLM/types/mat/float/mat4x3.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat4x3IterType = { (newfunc)matIter_new<4, 3, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat4x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat4x3", /* tp_name */ - sizeof(mat<4, 3, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x3_repr, /* tp_repr */ - & hfmat4x3NumMethods, /* tp_as_number */ - & hfmat4x3SeqMethods, /* tp_as_sequence */ - & hfmat4x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 3, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat4x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat4x3( )\n4 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 3, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 3, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat4x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 3, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 3, - sizeof(float), - sizeof(glm::mat<4, 3, float>), +#define FMAT4x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat4x3", /* tp_name */ \ + sizeof(mat<4, 3, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x3_repr, /* tp_repr */ \ + & hfmat4x3NumMethods, /* tp_as_number */ \ + & hfmat4x3SeqMethods, /* tp_as_sequence */ \ + & hfmat4x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 3, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat4x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat4x3( )\n4 columns of 3 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 3, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 3, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat4x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 3, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 3, \ + sizeof(float), \ + sizeof(glm::mat<4, 3, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat4x3Type = *((PyTypeObject*)&hfmat4x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/float/mat4x4.h b/PyGLM/types/mat/float/mat4x4.h index ad8368a..3f7ed0c 100644 --- a/PyGLM/types/mat/float/mat4x4.h +++ b/PyGLM/types/mat/float/mat4x4.h @@ -114,54 +114,50 @@ static PyTypeObject hfmat4x4IterType = { (newfunc)matIter_new<4, 4, float>, /* tp_new */ }; -static PyGLMTypeObject hfmat4x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mat4x4", /* tp_name */ - sizeof(mat<4, 4, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x4_repr, /* tp_repr */ - & hfmat4x4NumMethods, /* tp_as_number */ - & hfmat4x4SeqMethods, /* tp_as_sequence */ - & hfmat4x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 4, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfmat4x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mat4x4( )\n4 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 4, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 4, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmat4x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 4, float>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 4, - sizeof(float), - sizeof(glm::mat<4, 4, float>), +#define FMAT4x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mat4x4", /* tp_name */ \ + sizeof(mat<4, 4, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x4_repr, /* tp_repr */ \ + & hfmat4x4NumMethods, /* tp_as_number */ \ + & hfmat4x4SeqMethods, /* tp_as_sequence */ \ + & hfmat4x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 4, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfmat4x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mat4x4( )\n4 columns of 4 components matrix of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 4, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 4, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmat4x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 4, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 4, \ + sizeof(float), \ + sizeof(glm::mat<4, 4, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfmat4x4Type = *((PyTypeObject*)&hfmat4x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat2x2.h b/PyGLM/types/mat/int/mat2x2.h index 699b915..2fb6d39 100644 --- a/PyGLM/types/mat/int/mat2x2.h +++ b/PyGLM/types/mat/int/mat2x2.h @@ -114,54 +114,50 @@ static PyTypeObject himat2x2IterType = { (newfunc)matIter_new<2, 2, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat2x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat2x2", /* tp_name */ - sizeof(mat<2, 2, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x2_repr, /* tp_repr */ - & himat2x2NumMethods, /* tp_as_number */ - & himat2x2SeqMethods, /* tp_as_sequence */ - & himat2x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 2, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat2x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat2x2( )\n2 columns of 2 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 2, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 2, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat2x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 2, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 2, - sizeof(int32), - sizeof(glm::mat<2, 2, int32>), +#define IMAT2x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat2x2", /* tp_name */ \ + sizeof(mat<2, 2, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x2_repr, /* tp_repr */ \ + & himat2x2NumMethods, /* tp_as_number */ \ + & himat2x2SeqMethods, /* tp_as_sequence */ \ + & himat2x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 2, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat2x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat2x2( )\n2 columns of 2 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 2, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 2, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat2x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 2, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 2, \ + sizeof(int32), \ + sizeof(glm::mat<2, 2, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat2x2Type = *((PyTypeObject*)&himat2x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat2x3.h b/PyGLM/types/mat/int/mat2x3.h index 49638d1..c3a700d 100644 --- a/PyGLM/types/mat/int/mat2x3.h +++ b/PyGLM/types/mat/int/mat2x3.h @@ -114,54 +114,50 @@ static PyTypeObject himat2x3IterType = { (newfunc)matIter_new<2, 3, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat2x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat2x3", /* tp_name */ - sizeof(mat<2, 3, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x3_repr, /* tp_repr */ - & himat2x3NumMethods, /* tp_as_number */ - & himat2x3SeqMethods, /* tp_as_sequence */ - & himat2x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 3, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat2x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat2x3( )\n2 columns of 3 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 3, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 3, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat2x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 3, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 3, - sizeof(int32), - sizeof(glm::mat<2, 3, int32>), +#define IMAT2x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat2x3", /* tp_name */ \ + sizeof(mat<2, 3, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x3_repr, /* tp_repr */ \ + & himat2x3NumMethods, /* tp_as_number */ \ + & himat2x3SeqMethods, /* tp_as_sequence */ \ + & himat2x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 3, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat2x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat2x3( )\n2 columns of 3 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 3, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 3, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat2x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 3, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 3, \ + sizeof(int32), \ + sizeof(glm::mat<2, 3, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat2x3Type = *((PyTypeObject*)&himat2x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat2x4.h b/PyGLM/types/mat/int/mat2x4.h index 6f2f96b..8914b88 100644 --- a/PyGLM/types/mat/int/mat2x4.h +++ b/PyGLM/types/mat/int/mat2x4.h @@ -114,54 +114,50 @@ static PyTypeObject himat2x4IterType = { (newfunc)matIter_new<2, 4, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat2x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat2x4", /* tp_name */ - sizeof(mat<2, 4, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x4_repr, /* tp_repr */ - & himat2x4NumMethods, /* tp_as_number */ - & himat2x4SeqMethods, /* tp_as_sequence */ - & himat2x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 4, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat2x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat2x4( )\n2 columns of 4 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 4, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 4, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat2x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 4, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 4, - sizeof(int32), - sizeof(glm::mat<2, 4, int32>), +#define IMAT2x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat2x4", /* tp_name */ \ + sizeof(mat<2, 4, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x4_repr, /* tp_repr */ \ + & himat2x4NumMethods, /* tp_as_number */ \ + & himat2x4SeqMethods, /* tp_as_sequence */ \ + & himat2x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 4, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat2x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat2x4( )\n2 columns of 4 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 4, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 4, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat2x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 4, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 4, \ + sizeof(int32), \ + sizeof(glm::mat<2, 4, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat2x4Type = *((PyTypeObject*)&himat2x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat3x2.h b/PyGLM/types/mat/int/mat3x2.h index 77f316d..af0a59e 100644 --- a/PyGLM/types/mat/int/mat3x2.h +++ b/PyGLM/types/mat/int/mat3x2.h @@ -114,54 +114,50 @@ static PyTypeObject himat3x2IterType = { (newfunc)matIter_new<3, 2, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat3x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat3x2", /* tp_name */ - sizeof(mat<3, 2, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x2_repr, /* tp_repr */ - & himat3x2NumMethods, /* tp_as_number */ - & himat3x2SeqMethods, /* tp_as_sequence */ - & himat3x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 2, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat3x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat3x2( )\n3 columns of 2 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 2, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 2, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat3x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 2, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 2, - sizeof(int32), - sizeof(glm::mat<3, 2, int32>), +#define IMAT3x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat3x2", /* tp_name */ \ + sizeof(mat<3, 2, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x2_repr, /* tp_repr */ \ + & himat3x2NumMethods, /* tp_as_number */ \ + & himat3x2SeqMethods, /* tp_as_sequence */ \ + & himat3x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 2, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat3x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat3x2( )\n3 columns of 2 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 2, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 2, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat3x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 2, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 2, \ + sizeof(int32), \ + sizeof(glm::mat<3, 2, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat3x2Type = *((PyTypeObject*)&himat3x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat3x3.h b/PyGLM/types/mat/int/mat3x3.h index f192ea3..a13bf7b 100644 --- a/PyGLM/types/mat/int/mat3x3.h +++ b/PyGLM/types/mat/int/mat3x3.h @@ -114,54 +114,50 @@ static PyTypeObject himat3x3IterType = { (newfunc)matIter_new<3, 3, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat3x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat3x3", /* tp_name */ - sizeof(mat<3, 3, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x3_repr, /* tp_repr */ - & himat3x3NumMethods, /* tp_as_number */ - & himat3x3SeqMethods, /* tp_as_sequence */ - & himat3x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 3, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat3x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat3x3( )\n3 columns of 3 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 3, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 3, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat3x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 3, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 3, - sizeof(int32), - sizeof(glm::mat<3, 3, int32>), +#define IMAT3x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat3x3", /* tp_name */ \ + sizeof(mat<3, 3, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x3_repr, /* tp_repr */ \ + & himat3x3NumMethods, /* tp_as_number */ \ + & himat3x3SeqMethods, /* tp_as_sequence */ \ + & himat3x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 3, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat3x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat3x3( )\n3 columns of 3 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 3, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 3, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat3x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 3, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 3, \ + sizeof(int32), \ + sizeof(glm::mat<3, 3, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat3x3Type = *((PyTypeObject*)&himat3x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat3x4.h b/PyGLM/types/mat/int/mat3x4.h index 57e4024..ee90367 100644 --- a/PyGLM/types/mat/int/mat3x4.h +++ b/PyGLM/types/mat/int/mat3x4.h @@ -114,54 +114,50 @@ static PyTypeObject himat3x4IterType = { (newfunc)matIter_new<3, 4, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat3x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat3x4", /* tp_name */ - sizeof(mat<3, 4, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x4_repr, /* tp_repr */ - & himat3x4NumMethods, /* tp_as_number */ - & himat3x4SeqMethods, /* tp_as_sequence */ - & himat3x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 4, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat3x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat3x4( )\n3 columns of 4 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 4, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 4, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat3x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 4, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 4, - sizeof(int32), - sizeof(glm::mat<3, 4, int32>), +#define IMAT3x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat3x4", /* tp_name */ \ + sizeof(mat<3, 4, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x4_repr, /* tp_repr */ \ + & himat3x4NumMethods, /* tp_as_number */ \ + & himat3x4SeqMethods, /* tp_as_sequence */ \ + & himat3x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 4, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat3x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat3x4( )\n3 columns of 4 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 4, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 4, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat3x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 4, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 4, \ + sizeof(int32), \ + sizeof(glm::mat<3, 4, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat3x4Type = *((PyTypeObject*)&himat3x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat4x2.h b/PyGLM/types/mat/int/mat4x2.h index 7320e5f..72e74a0 100644 --- a/PyGLM/types/mat/int/mat4x2.h +++ b/PyGLM/types/mat/int/mat4x2.h @@ -114,54 +114,50 @@ static PyTypeObject himat4x2IterType = { (newfunc)matIter_new<4, 2, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat4x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat4x2", /* tp_name */ - sizeof(mat<4, 2, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x2_repr, /* tp_repr */ - & himat4x2NumMethods, /* tp_as_number */ - & himat4x2SeqMethods, /* tp_as_sequence */ - & himat4x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 2, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat4x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat4x2( )\n4 columns of 2 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 2, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 2, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat4x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 2, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 2, - sizeof(int32), - sizeof(glm::mat<4, 2, int32>), +#define IMAT4x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat4x2", /* tp_name */ \ + sizeof(mat<4, 2, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x2_repr, /* tp_repr */ \ + & himat4x2NumMethods, /* tp_as_number */ \ + & himat4x2SeqMethods, /* tp_as_sequence */ \ + & himat4x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 2, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat4x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat4x2( )\n4 columns of 2 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 2, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 2, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat4x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 2, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 2, \ + sizeof(int32), \ + sizeof(glm::mat<4, 2, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat4x2Type = *((PyTypeObject*)&himat4x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat4x3.h b/PyGLM/types/mat/int/mat4x3.h index 36a59ef..80f0053 100644 --- a/PyGLM/types/mat/int/mat4x3.h +++ b/PyGLM/types/mat/int/mat4x3.h @@ -114,54 +114,50 @@ static PyTypeObject himat4x3IterType = { (newfunc)matIter_new<4, 3, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat4x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat4x3", /* tp_name */ - sizeof(mat<4, 3, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x3_repr, /* tp_repr */ - & himat4x3NumMethods, /* tp_as_number */ - & himat4x3SeqMethods, /* tp_as_sequence */ - & himat4x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 3, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat4x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat4x3( )\n4 columns of 3 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 3, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 3, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat4x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 3, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 3, - sizeof(int32), - sizeof(glm::mat<4, 3, int32>), +#define IMAT4x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat4x3", /* tp_name */ \ + sizeof(mat<4, 3, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x3_repr, /* tp_repr */ \ + & himat4x3NumMethods, /* tp_as_number */ \ + & himat4x3SeqMethods, /* tp_as_sequence */ \ + & himat4x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 3, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat4x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat4x3( )\n4 columns of 3 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 3, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 3, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat4x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 3, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 3, \ + sizeof(int32), \ + sizeof(glm::mat<4, 3, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat4x3Type = *((PyTypeObject*)&himat4x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/int/mat4x4.h b/PyGLM/types/mat/int/mat4x4.h index 9fc7bd4..a2c6ec7 100644 --- a/PyGLM/types/mat/int/mat4x4.h +++ b/PyGLM/types/mat/int/mat4x4.h @@ -114,54 +114,50 @@ static PyTypeObject himat4x4IterType = { (newfunc)matIter_new<4, 4, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himat4x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imat4x4", /* tp_name */ - sizeof(mat<4, 4, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x4_repr, /* tp_repr */ - & himat4x4NumMethods, /* tp_as_number */ - & himat4x4SeqMethods, /* tp_as_sequence */ - & himat4x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 4, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & himat4x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imat4x4( )\n4 columns of 4 components matrix of integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 4, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 4, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himat4x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 4, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 4, - sizeof(int32), - sizeof(glm::mat<4, 4, int32>), +#define IMAT4x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imat4x4", /* tp_name */ \ + sizeof(mat<4, 4, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x4_repr, /* tp_repr */ \ + & himat4x4NumMethods, /* tp_as_number */ \ + & himat4x4SeqMethods, /* tp_as_sequence */ \ + & himat4x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 4, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & himat4x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imat4x4( )\n4 columns of 4 components matrix of integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 4, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 4, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himat4x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 4, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 4, \ + sizeof(int32), \ + sizeof(glm::mat<4, 4, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& himat4x4Type = *((PyTypeObject*)&himat4x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat2x2.h b/PyGLM/types/mat/uint/mat2x2.h index 7e8fb82..cf2467a 100644 --- a/PyGLM/types/mat/uint/mat2x2.h +++ b/PyGLM/types/mat/uint/mat2x2.h @@ -114,54 +114,50 @@ static PyTypeObject humat2x2IterType = { (newfunc)matIter_new<2, 2, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat2x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat2x2", /* tp_name */ - sizeof(mat<2, 2, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x2_repr, /* tp_repr */ - & humat2x2NumMethods, /* tp_as_number */ - & humat2x2SeqMethods, /* tp_as_sequence */ - & humat2x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 2, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat2x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat2x2( )\n2 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 2, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 2, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat2x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 2, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 2, - sizeof(uint32), - sizeof(glm::mat<2, 2, uint32>), +#define UMAT2x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat2x2", /* tp_name */ \ + sizeof(mat<2, 2, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x2_repr, /* tp_repr */ \ + & humat2x2NumMethods, /* tp_as_number */ \ + & humat2x2SeqMethods, /* tp_as_sequence */ \ + & humat2x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 2, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat2x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat2x2( )\n2 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 2, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 2, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat2x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 2, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 2, \ + sizeof(uint32), \ + sizeof(glm::mat<2, 2, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat2x2Type = *((PyTypeObject*)&humat2x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat2x3.h b/PyGLM/types/mat/uint/mat2x3.h index 4f6f6ba..f7c5c08 100644 --- a/PyGLM/types/mat/uint/mat2x3.h +++ b/PyGLM/types/mat/uint/mat2x3.h @@ -114,54 +114,50 @@ static PyTypeObject humat2x3IterType = { (newfunc)matIter_new<2, 3, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat2x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat2x3", /* tp_name */ - sizeof(mat<2, 3, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x3_repr, /* tp_repr */ - & humat2x3NumMethods, /* tp_as_number */ - & humat2x3SeqMethods, /* tp_as_sequence */ - & humat2x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 3, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat2x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat2x3( )\n2 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 3, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 3, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat2x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 3, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 3, - sizeof(uint32), - sizeof(glm::mat<2, 3, uint32>), +#define UMAT2x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat2x3", /* tp_name */ \ + sizeof(mat<2, 3, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x3_repr, /* tp_repr */ \ + & humat2x3NumMethods, /* tp_as_number */ \ + & humat2x3SeqMethods, /* tp_as_sequence */ \ + & humat2x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 3, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat2x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat2x3( )\n2 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 3, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 3, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat2x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 3, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 3, \ + sizeof(uint32), \ + sizeof(glm::mat<2, 3, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat2x3Type = *((PyTypeObject*)&humat2x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat2x4.h b/PyGLM/types/mat/uint/mat2x4.h index fec38e0..cc83c0c 100644 --- a/PyGLM/types/mat/uint/mat2x4.h +++ b/PyGLM/types/mat/uint/mat2x4.h @@ -114,54 +114,50 @@ static PyTypeObject humat2x4IterType = { (newfunc)matIter_new<2, 4, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat2x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat2x4", /* tp_name */ - sizeof(mat<2, 4, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat2x4_repr, /* tp_repr */ - & humat2x4NumMethods, /* tp_as_number */ - & humat2x4SeqMethods, /* tp_as_sequence */ - & humat2x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<2, 4, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat2x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat2x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat2x4( )\n2 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<2, 4, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<2, 4, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat2x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat2x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<2, 4, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 2, - 4, - sizeof(uint32), - sizeof(glm::mat<2, 4, uint32>), +#define UMAT2x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat2x4", /* tp_name */ \ + sizeof(mat<2, 4, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat2x4_repr, /* tp_repr */ \ + & humat2x4NumMethods, /* tp_as_number */ \ + & humat2x4SeqMethods, /* tp_as_sequence */ \ + & humat2x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<2, 4, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat2x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat2x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat2x4( )\n2 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<2, 4, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<2, 4, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat2x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat2x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<2, 4, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 2, \ + 4, \ + sizeof(uint32), \ + sizeof(glm::mat<2, 4, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat2x4Type = *((PyTypeObject*)&humat2x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat3x2.h b/PyGLM/types/mat/uint/mat3x2.h index 405effa..cd00270 100644 --- a/PyGLM/types/mat/uint/mat3x2.h +++ b/PyGLM/types/mat/uint/mat3x2.h @@ -114,54 +114,50 @@ static PyTypeObject humat3x2IterType = { (newfunc)matIter_new<3, 2, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat3x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat3x2", /* tp_name */ - sizeof(mat<3, 2, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x2_repr, /* tp_repr */ - & humat3x2NumMethods, /* tp_as_number */ - & humat3x2SeqMethods, /* tp_as_sequence */ - & humat3x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 2, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat3x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat3x2( )\n3 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 2, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 2, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat3x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 2, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 2, - sizeof(uint32), - sizeof(glm::mat<3, 2, uint32>), +#define UMAT3x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat3x2", /* tp_name */ \ + sizeof(mat<3, 2, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x2_repr, /* tp_repr */ \ + & humat3x2NumMethods, /* tp_as_number */ \ + & humat3x2SeqMethods, /* tp_as_sequence */ \ + & humat3x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 2, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat3x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat3x2( )\n3 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 2, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 2, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat3x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 2, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 2, \ + sizeof(uint32), \ + sizeof(glm::mat<3, 2, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat3x2Type = *((PyTypeObject*)&humat3x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat3x3.h b/PyGLM/types/mat/uint/mat3x3.h index 24fa506..cba1c5b 100644 --- a/PyGLM/types/mat/uint/mat3x3.h +++ b/PyGLM/types/mat/uint/mat3x3.h @@ -114,54 +114,50 @@ static PyTypeObject humat3x3IterType = { (newfunc)matIter_new<3, 3, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat3x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat3x3", /* tp_name */ - sizeof(mat<3, 3, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x3_repr, /* tp_repr */ - & humat3x3NumMethods, /* tp_as_number */ - & humat3x3SeqMethods, /* tp_as_sequence */ - & humat3x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 3, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat3x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat3x3( )\n3 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 3, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 3, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat3x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 3, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 3, - sizeof(uint32), - sizeof(glm::mat<3, 3, uint32>), +#define UMAT3x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat3x3", /* tp_name */ \ + sizeof(mat<3, 3, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x3_repr, /* tp_repr */ \ + & humat3x3NumMethods, /* tp_as_number */ \ + & humat3x3SeqMethods, /* tp_as_sequence */ \ + & humat3x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 3, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat3x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat3x3( )\n3 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 3, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 3, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat3x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 3, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 3, \ + sizeof(uint32), \ + sizeof(glm::mat<3, 3, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat3x3Type = *((PyTypeObject*)&humat3x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat3x4.h b/PyGLM/types/mat/uint/mat3x4.h index d7ff7ae..a2a8807 100644 --- a/PyGLM/types/mat/uint/mat3x4.h +++ b/PyGLM/types/mat/uint/mat3x4.h @@ -114,54 +114,50 @@ static PyTypeObject humat3x4IterType = { (newfunc)matIter_new<3, 4, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat3x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat3x4", /* tp_name */ - sizeof(mat<3, 4, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat3x4_repr, /* tp_repr */ - & humat3x4NumMethods, /* tp_as_number */ - & humat3x4SeqMethods, /* tp_as_sequence */ - & humat3x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<3, 4, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat3x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat3x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat3x4( )\n3 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<3, 4, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<3, 4, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat3x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat3x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<3, 4, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 3, - 4, - sizeof(uint32), - sizeof(glm::mat<3, 4, uint32>), +#define UMAT3x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat3x4", /* tp_name */ \ + sizeof(mat<3, 4, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat3x4_repr, /* tp_repr */ \ + & humat3x4NumMethods, /* tp_as_number */ \ + & humat3x4SeqMethods, /* tp_as_sequence */ \ + & humat3x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<3, 4, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat3x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat3x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat3x4( )\n3 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<3, 4, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<3, 4, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat3x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat3x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<3, 4, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 3, \ + 4, \ + sizeof(uint32), \ + sizeof(glm::mat<3, 4, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat3x4Type = *((PyTypeObject*)&humat3x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat4x2.h b/PyGLM/types/mat/uint/mat4x2.h index 48e581c..00f1d1c 100644 --- a/PyGLM/types/mat/uint/mat4x2.h +++ b/PyGLM/types/mat/uint/mat4x2.h @@ -114,54 +114,50 @@ static PyTypeObject humat4x2IterType = { (newfunc)matIter_new<4, 2, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat4x2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat4x2", /* tp_name */ - sizeof(mat<4, 2, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x2_repr, /* tp_repr */ - & humat4x2NumMethods, /* tp_as_number */ - & humat4x2SeqMethods, /* tp_as_sequence */ - & humat4x2MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 2, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x2_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat4x2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat4x2( )\n4 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 2, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 2, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat4x2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 2, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 2, - sizeof(uint32), - sizeof(glm::mat<4, 2, uint32>), +#define UMAT4x2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat4x2", /* tp_name */ \ + sizeof(mat<4, 2, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x2_repr, /* tp_repr */ \ + & humat4x2NumMethods, /* tp_as_number */ \ + & humat4x2SeqMethods, /* tp_as_sequence */ \ + & humat4x2MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 2, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x2_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat4x2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat4x2( )\n4 columns of 2 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 2, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 2, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat4x2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 2, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 2, \ + sizeof(uint32), \ + sizeof(glm::mat<4, 2, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat4x2Type = *((PyTypeObject*)&humat4x2GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat4x3.h b/PyGLM/types/mat/uint/mat4x3.h index f3e84ac..67f2d87 100644 --- a/PyGLM/types/mat/uint/mat4x3.h +++ b/PyGLM/types/mat/uint/mat4x3.h @@ -114,54 +114,50 @@ static PyTypeObject humat4x3IterType = { (newfunc)matIter_new<4, 3, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat4x3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat4x3", /* tp_name */ - sizeof(mat<4, 3, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x3_repr, /* tp_repr */ - & humat4x3NumMethods, /* tp_as_number */ - & humat4x3SeqMethods, /* tp_as_sequence */ - & humat4x3MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 3, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x3_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat4x3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat4x3( )\n4 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 3, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 3, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat4x3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 3, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 3, - sizeof(uint32), - sizeof(glm::mat<4, 3, uint32>), +#define UMAT4x3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat4x3", /* tp_name */ \ + sizeof(mat<4, 3, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x3_repr, /* tp_repr */ \ + & humat4x3NumMethods, /* tp_as_number */ \ + & humat4x3SeqMethods, /* tp_as_sequence */ \ + & humat4x3MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 3, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x3_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat4x3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat4x3( )\n4 columns of 3 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 3, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 3, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat4x3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 3, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 3, \ + sizeof(uint32), \ + sizeof(glm::mat<4, 3, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat4x3Type = *((PyTypeObject*)&humat4x3GLMType); \ No newline at end of file diff --git a/PyGLM/types/mat/uint/mat4x4.h b/PyGLM/types/mat/uint/mat4x4.h index 180be60..182aafe 100644 --- a/PyGLM/types/mat/uint/mat4x4.h +++ b/PyGLM/types/mat/uint/mat4x4.h @@ -114,54 +114,50 @@ static PyTypeObject humat4x4IterType = { (newfunc)matIter_new<4, 4, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humat4x4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umat4x4", /* tp_name */ - sizeof(mat<4, 4, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mat_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mat4x4_repr, /* tp_repr */ - & humat4x4NumMethods, /* tp_as_number */ - & humat4x4SeqMethods, /* tp_as_sequence */ - & humat4x4MapMethods, /* tp_as_mapping */ - (hashfunc)mat_hash<4, 4, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mat4x4_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & humat4x4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umat4x4( )\n4 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mat_richcompare<4, 4, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mat_geniter<4, 4, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humat4x4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mat4x4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mat_new<4, 4, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MAT, - 4, - 4, - sizeof(uint32), - sizeof(glm::mat<4, 4, uint32>), +#define UMAT4x4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umat4x4", /* tp_name */ \ + sizeof(mat<4, 4, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mat_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mat4x4_repr, /* tp_repr */ \ + & humat4x4NumMethods, /* tp_as_number */ \ + & humat4x4SeqMethods, /* tp_as_sequence */ \ + & humat4x4MapMethods, /* tp_as_mapping */ \ + (hashfunc)mat_hash<4, 4, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mat4x4_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & humat4x4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umat4x4( )\n4 columns of 4 components matrix of unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mat_richcompare<4, 4, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mat_geniter<4, 4, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humat4x4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mat4x4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mat_new<4, 4, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MAT, \ + 4, \ + 4, \ + sizeof(uint32), \ + sizeof(glm::mat<4, 4, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& humat4x4Type = *((PyTypeObject*)&humat4x4GLMType); \ No newline at end of file diff --git a/PyGLM/types/mvec/double/mvec2.h b/PyGLM/types/mvec/double/mvec2.h index e72b0ba..8516563 100644 --- a/PyGLM/types/mvec/double/mvec2.h +++ b/PyGLM/types/mvec/double/mvec2.h @@ -109,55 +109,50 @@ static PyTypeObject hdmvec2IterType = { (newfunc)mvecIter_new<2, double>, /* tp_new */ }; -static PyGLMTypeObject hdmvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmvec2", /* tp_name */ - sizeof(mvec<2, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec2_str, /* tp_repr */ - & hdmvec2NumMethods, /* tp_as_number */ - & hdmvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<2, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec2_str, /* tp_str */ - (getattrofunc)mvec_getattr<2, double>, /* tp_getattro */ - (setattrofunc)mvec_setattr<2, double>, /* tp_setattro */ - & hdmvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmvec2( )\n2 components mvector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<2, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<2, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmvec2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<2, double>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<2, double>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 2, - 0, - sizeof(double), - sizeof(glm::vec<2, double>), - PyGLM_FS_DOUBLE, - &hdvec2Type -}; - -static PyTypeObject& hdmvec2Type = *((PyTypeObject*)&hdmvec2GLMType); \ No newline at end of file +#define DMVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmvec2", /* tp_name */ \ + sizeof(mvec<2, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec2_str, /* tp_repr */ \ + & hdmvec2NumMethods, /* tp_as_number */ \ + & hdmvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<2, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec2_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<2, double>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<2, double>, /* tp_setattro */ \ + & hdmvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmvec2( )\n2 components mvector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<2, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<2, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmvec2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<2, double>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<2, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 2, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<2, double>), \ + PyGLM_FS_DOUBLE diff --git a/PyGLM/types/mvec/double/mvec3.h b/PyGLM/types/mvec/double/mvec3.h index 28fe7a3..6f3fbe1 100644 --- a/PyGLM/types/mvec/double/mvec3.h +++ b/PyGLM/types/mvec/double/mvec3.h @@ -109,55 +109,50 @@ static PyTypeObject hdmvec3IterType = { (newfunc)mvecIter_new<3, double>, /* tp_new */ }; -static PyGLMTypeObject hdmvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmvec3", /* tp_name */ - sizeof(mvec<3, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec3_str, /* tp_repr */ - & hdmvec3NumMethods, /* tp_as_number */ - & hdmvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<3, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec3_str, /* tp_str */ - (getattrofunc)mvec_getattr<3, double>, /* tp_getattro */ - (setattrofunc)mvec_setattr<3, double>, /* tp_setattro */ - & hdmvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmvec3( )\n3 components mvector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<3, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<3, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmvec3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<3, double>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<3, double>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 3, - 0, - sizeof(double), - sizeof(glm::vec<3, double>), - PyGLM_FS_DOUBLE, - &hdvec3Type -}; - -static PyTypeObject& hdmvec3Type = *((PyTypeObject*)&hdmvec3GLMType); \ No newline at end of file +#define DMVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmvec3", /* tp_name */ \ + sizeof(mvec<3, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec3_str, /* tp_repr */ \ + & hdmvec3NumMethods, /* tp_as_number */ \ + & hdmvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<3, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec3_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<3, double>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<3, double>, /* tp_setattro */ \ + & hdmvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmvec3( )\n3 components mvector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<3, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<3, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmvec3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<3, double>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<3, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 3, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<3, double>), \ + PyGLM_FS_DOUBLE diff --git a/PyGLM/types/mvec/double/mvec4.h b/PyGLM/types/mvec/double/mvec4.h index 54d020e..059b3bf 100644 --- a/PyGLM/types/mvec/double/mvec4.h +++ b/PyGLM/types/mvec/double/mvec4.h @@ -109,55 +109,50 @@ static PyTypeObject hdmvec4IterType = { (newfunc)mvecIter_new<4, double>, /* tp_new */ }; -static PyGLMTypeObject hdmvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dmvec4", /* tp_name */ - sizeof(mvec<4, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec4_str, /* tp_repr */ - & hdmvec4NumMethods, /* tp_as_number */ - & hdmvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<4, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec4_str, /* tp_str */ - (getattrofunc)mvec_getattr<4, double>, /* tp_getattro */ - (setattrofunc)mvec_setattr<4, double>, /* tp_setattro */ - & hdmvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dmvec4( )\n4 components mvector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<4, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<4, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdmvec4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<4, double>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<4, double>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 4, - 0, - sizeof(double), - sizeof(glm::vec<4, double>), - PyGLM_FS_DOUBLE, - &hdvec4Type -}; - -static PyTypeObject& hdmvec4Type = *((PyTypeObject*)&hdmvec4GLMType); \ No newline at end of file +#define DMVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dmvec4", /* tp_name */ \ + sizeof(mvec<4, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec4_str, /* tp_repr */ \ + & hdmvec4NumMethods, /* tp_as_number */ \ + & hdmvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<4, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec4_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<4, double>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<4, double>, /* tp_setattro */ \ + & hdmvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dmvec4( )\n4 components mvector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<4, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<4, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdmvec4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<4, double>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<4, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 4, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<4, double>), \ + PyGLM_FS_DOUBLE diff --git a/PyGLM/types/mvec/float/mvec2.h b/PyGLM/types/mvec/float/mvec2.h index e65842e..96d93f6 100644 --- a/PyGLM/types/mvec/float/mvec2.h +++ b/PyGLM/types/mvec/float/mvec2.h @@ -109,55 +109,50 @@ static PyTypeObject hfmvec2IterType = { (newfunc)mvecIter_new<2, float>, /* tp_new */ }; -static PyGLMTypeObject hfmvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mvec2", /* tp_name */ - sizeof(mvec<2, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec2_str, /* tp_repr */ - & hfmvec2NumMethods, /* tp_as_number */ - & hfmvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<2, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec2_str, /* tp_str */ - (getattrofunc)mvec_getattr<2, float>, /* tp_getattro */ - (setattrofunc)mvec_setattr<2, float>, /* tp_setattro */ - & hfmvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mvec2( )\n2 components mvector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<2, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<2, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmvec2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<2, float>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<2, float>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 2, - 0, - sizeof(float), - sizeof(glm::vec<2, float>), - PyGLM_FS_FLOAT, - &hfvec2Type -}; - -static PyTypeObject& hfmvec2Type = *((PyTypeObject*)&hfmvec2GLMType); \ No newline at end of file +#define FMVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mvec2", /* tp_name */ \ + sizeof(mvec<2, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec2_str, /* tp_repr */ \ + & hfmvec2NumMethods, /* tp_as_number */ \ + & hfmvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<2, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec2_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<2, float>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<2, float>, /* tp_setattro */ \ + & hfmvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mvec2( )\n2 components mvector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<2, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<2, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmvec2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<2, float>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<2, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 2, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<2, float>), \ + PyGLM_FS_FLOAT diff --git a/PyGLM/types/mvec/float/mvec3.h b/PyGLM/types/mvec/float/mvec3.h index be60912..1760744 100644 --- a/PyGLM/types/mvec/float/mvec3.h +++ b/PyGLM/types/mvec/float/mvec3.h @@ -109,55 +109,50 @@ static PyTypeObject hfmvec3IterType = { (newfunc)mvecIter_new<3, float>, /* tp_new */ }; -static PyGLMTypeObject hfmvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mvec3", /* tp_name */ - sizeof(mvec<3, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec3_str, /* tp_repr */ - & hfmvec3NumMethods, /* tp_as_number */ - & hfmvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<3, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec3_str, /* tp_str */ - (getattrofunc)mvec_getattr<3, float>, /* tp_getattro */ - (setattrofunc)mvec_setattr<3, float>, /* tp_setattro */ - & hfmvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mvec3( )\n3 components mvector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<3, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<3, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmvec3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<3, float>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<3, float>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 3, - 0, - sizeof(float), - sizeof(glm::vec<3, float>), - PyGLM_FS_FLOAT, - &hfvec3Type -}; - -static PyTypeObject& hfmvec3Type = *((PyTypeObject*)&hfmvec3GLMType); \ No newline at end of file +#define FMVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mvec3", /* tp_name */ \ + sizeof(mvec<3, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec3_str, /* tp_repr */ \ + & hfmvec3NumMethods, /* tp_as_number */ \ + & hfmvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<3, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec3_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<3, float>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<3, float>, /* tp_setattro */ \ + & hfmvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mvec3( )\n3 components mvector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<3, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<3, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmvec3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<3, float>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<3, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 3, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<3, float>), \ + PyGLM_FS_FLOAT diff --git a/PyGLM/types/mvec/float/mvec4.h b/PyGLM/types/mvec/float/mvec4.h index 87e998d..8630e3a 100644 --- a/PyGLM/types/mvec/float/mvec4.h +++ b/PyGLM/types/mvec/float/mvec4.h @@ -109,55 +109,50 @@ static PyTypeObject hfmvec4IterType = { (newfunc)mvecIter_new<4, float>, /* tp_new */ }; -static PyGLMTypeObject hfmvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.mvec4", /* tp_name */ - sizeof(mvec<4, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec4_str, /* tp_repr */ - & hfmvec4NumMethods, /* tp_as_number */ - & hfmvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<4, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec4_str, /* tp_str */ - (getattrofunc)mvec_getattr<4, float>, /* tp_getattro */ - (setattrofunc)mvec_setattr<4, float>, /* tp_setattro */ - & hfmvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "mvec4( )\n4 components mvector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<4, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<4, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfmvec4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<4, float>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<4, float>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 4, - 0, - sizeof(float), - sizeof(glm::vec<4, float>), - PyGLM_FS_FLOAT, - &hfvec4Type -}; - -static PyTypeObject& hfmvec4Type = *((PyTypeObject*)&hfmvec4GLMType); \ No newline at end of file +#define FMVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.mvec4", /* tp_name */ \ + sizeof(mvec<4, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec4_str, /* tp_repr */ \ + & hfmvec4NumMethods, /* tp_as_number */ \ + & hfmvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<4, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec4_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<4, float>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<4, float>, /* tp_setattro */ \ + & hfmvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "mvec4( )\n4 components mvector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<4, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<4, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfmvec4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<4, float>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<4, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 4, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<4, float>), \ + PyGLM_FS_FLOAT diff --git a/PyGLM/types/mvec/int/mvec2.h b/PyGLM/types/mvec/int/mvec2.h index b4199d5..9473ede 100644 --- a/PyGLM/types/mvec/int/mvec2.h +++ b/PyGLM/types/mvec/int/mvec2.h @@ -109,55 +109,50 @@ static PyTypeObject himvec2IterType = { (newfunc)mvecIter_new<2, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imvec2", /* tp_name */ - sizeof(mvec<2, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec2_str, /* tp_repr */ - & himvec2NumMethods, /* tp_as_number */ - & himvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<2, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec2_str, /* tp_str */ - (getattrofunc)mvec_getattr<2, glm::i32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<2, glm::i32>, /* tp_setattro */ - & himvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imvec2( )\n2 components mvector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<2, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<2, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himvec2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<2, glm::i32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<2, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 2, - 0, - sizeof(int32), - sizeof(glm::vec<2, int32>), - PyGLM_FS_INT32, - &hivec2Type -}; - -static PyTypeObject& himvec2Type = *((PyTypeObject*)&himvec2GLMType); \ No newline at end of file +#define IMVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imvec2", /* tp_name */ \ + sizeof(mvec<2, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec2_str, /* tp_repr */ \ + & himvec2NumMethods, /* tp_as_number */ \ + & himvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<2, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec2_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<2, glm::i32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<2, glm::i32>, /* tp_setattro */ \ + & himvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imvec2( )\n2 components mvector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<2, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<2, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himvec2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<2, glm::i32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<2, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 2, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<2, int32>), \ + PyGLM_FS_INT32 diff --git a/PyGLM/types/mvec/int/mvec3.h b/PyGLM/types/mvec/int/mvec3.h index 21c8ccc..ac776e2 100644 --- a/PyGLM/types/mvec/int/mvec3.h +++ b/PyGLM/types/mvec/int/mvec3.h @@ -109,55 +109,50 @@ static PyTypeObject himvec3IterType = { (newfunc)mvecIter_new<3, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imvec3", /* tp_name */ - sizeof(mvec<3, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec3_str, /* tp_repr */ - & himvec3NumMethods, /* tp_as_number */ - & himvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<3, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec3_str, /* tp_str */ - (getattrofunc)mvec_getattr<3, glm::i32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<3, glm::i32>, /* tp_setattro */ - & himvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imvec3( )\n3 components mvector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<3, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<3, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himvec3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<3, glm::i32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<3, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 3, - 0, - sizeof(int32), - sizeof(glm::vec<3, int32>), - PyGLM_FS_INT32, - &hivec3Type -}; - -static PyTypeObject& himvec3Type = *((PyTypeObject*)&himvec3GLMType); \ No newline at end of file +#define IMVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imvec3", /* tp_name */ \ + sizeof(mvec<3, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec3_str, /* tp_repr */ \ + & himvec3NumMethods, /* tp_as_number */ \ + & himvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<3, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec3_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<3, glm::i32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<3, glm::i32>, /* tp_setattro */ \ + & himvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imvec3( )\n3 components mvector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<3, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<3, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himvec3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<3, glm::i32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<3, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 3, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<3, int32>), \ + PyGLM_FS_INT32 diff --git a/PyGLM/types/mvec/int/mvec4.h b/PyGLM/types/mvec/int/mvec4.h index 12e7a6f..bb42a57 100644 --- a/PyGLM/types/mvec/int/mvec4.h +++ b/PyGLM/types/mvec/int/mvec4.h @@ -109,55 +109,50 @@ static PyTypeObject himvec4IterType = { (newfunc)mvecIter_new<4, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject himvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.imvec4", /* tp_name */ - sizeof(mvec<4, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec4_str, /* tp_repr */ - & himvec4NumMethods, /* tp_as_number */ - & himvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<4, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec4_str, /* tp_str */ - (getattrofunc)mvec_getattr<4, glm::i32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<4, glm::i32>, /* tp_setattro */ - & himvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "imvec4( )\n4 components mvector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<4, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<4, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - himvec4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<4, glm::i32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<4, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 4, - 0, - sizeof(int32), - sizeof(glm::vec<4, int32>), - PyGLM_FS_INT32, - &hivec4Type -}; - -static PyTypeObject& himvec4Type = *((PyTypeObject*)&himvec4GLMType); \ No newline at end of file +#define IMVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.imvec4", /* tp_name */ \ + sizeof(mvec<4, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec4_str, /* tp_repr */ \ + & himvec4NumMethods, /* tp_as_number */ \ + & himvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<4, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec4_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<4, glm::i32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<4, glm::i32>, /* tp_setattro */ \ + & himvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "imvec4( )\n4 components mvector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<4, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<4, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + himvec4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<4, glm::i32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<4, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 4, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<4, int32>), \ + PyGLM_FS_INT32 diff --git a/PyGLM/types/mvec/uint/mvec2.h b/PyGLM/types/mvec/uint/mvec2.h index 78ea0f8..d12c768 100644 --- a/PyGLM/types/mvec/uint/mvec2.h +++ b/PyGLM/types/mvec/uint/mvec2.h @@ -109,55 +109,50 @@ static PyTypeObject humvec2IterType = { (newfunc)mvecIter_new<2, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umvec2", /* tp_name */ - sizeof(mvec<2, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec2_str, /* tp_repr */ - & humvec2NumMethods, /* tp_as_number */ - & humvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<2, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec2_str, /* tp_str */ - (getattrofunc)mvec_getattr<2, glm::u32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<2, glm::u32>, /* tp_setattro */ - & humvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umvec2( )\n2 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<2, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<2, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humvec2_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<2, glm::u32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<2, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 2, - 0, - sizeof(uint32), - sizeof(glm::vec<2, uint32>), - PyGLM_FS_UINT32, - &huvec2Type -}; - -static PyTypeObject& humvec2Type = *((PyTypeObject*)&humvec2GLMType); \ No newline at end of file +#define UMVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umvec2", /* tp_name */ \ + sizeof(mvec<2, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec2_str, /* tp_repr */ \ + & humvec2NumMethods, /* tp_as_number */ \ + & humvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<2, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec2_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<2, glm::u32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<2, glm::u32>, /* tp_setattro */ \ + & humvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umvec2( )\n2 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<2, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<2, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humvec2_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<2, glm::u32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<2, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 2, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<2, uint32>), \ + PyGLM_FS_UINT32 diff --git a/PyGLM/types/mvec/uint/mvec3.h b/PyGLM/types/mvec/uint/mvec3.h index d5b3364..b8cce30 100644 --- a/PyGLM/types/mvec/uint/mvec3.h +++ b/PyGLM/types/mvec/uint/mvec3.h @@ -109,55 +109,50 @@ static PyTypeObject humvec3IterType = { (newfunc)mvecIter_new<3, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umvec3", /* tp_name */ - sizeof(mvec<3, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec3_str, /* tp_repr */ - & humvec3NumMethods, /* tp_as_number */ - & humvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<3, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec3_str, /* tp_str */ - (getattrofunc)mvec_getattr<3, glm::u32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<3, glm::u32>, /* tp_setattro */ - & humvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umvec3( )\n3 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<3, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<3, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humvec3_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<3, glm::u32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<3, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 3, - 0, - sizeof(uint32), - sizeof(glm::vec<3, uint32>), - PyGLM_FS_UINT32, - &huvec3Type -}; - -static PyTypeObject& humvec3Type = *((PyTypeObject*)&humvec3GLMType); \ No newline at end of file +#define UMVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umvec3", /* tp_name */ \ + sizeof(mvec<3, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec3_str, /* tp_repr */ \ + & humvec3NumMethods, /* tp_as_number */ \ + & humvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<3, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec3_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<3, glm::u32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<3, glm::u32>, /* tp_setattro */ \ + & humvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umvec3( )\n3 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<3, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<3, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humvec3_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<3, glm::u32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<3, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 3, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<3, uint32>), \ + PyGLM_FS_UINT32 diff --git a/PyGLM/types/mvec/uint/mvec4.h b/PyGLM/types/mvec/uint/mvec4.h index 7c7d28c..158dfec 100644 --- a/PyGLM/types/mvec/uint/mvec4.h +++ b/PyGLM/types/mvec/uint/mvec4.h @@ -109,55 +109,50 @@ static PyTypeObject humvec4IterType = { (newfunc)mvecIter_new<4, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject humvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.umvec4", /* tp_name */ - sizeof(mvec<4, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)mvec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)mvec4_str, /* tp_repr */ - & humvec4NumMethods, /* tp_as_number */ - & humvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)mvec_hash<4, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)mvec4_str, /* tp_str */ - (getattrofunc)mvec_getattr<4, glm::u32>, /* tp_getattro */ - (setattrofunc)mvec_setattr<4, glm::u32>, /* tp_setattro */ - & humvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "umvec4( )\n4 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)mvec_richcompare<4, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)mvec_geniter<4, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - humvec4_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)mvec_init<4, glm::u32>, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)mvec_new<4, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_MVEC, - 4, - 0, - sizeof(uint32), - sizeof(glm::vec<4, uint32>), - PyGLM_FS_UINT32, - &huvec4Type -}; - -static PyTypeObject& humvec4Type = *((PyTypeObject*)&humvec4GLMType); \ No newline at end of file +#define UMVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.umvec4", /* tp_name */ \ + sizeof(mvec<4, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)mvec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)mvec4_str, /* tp_repr */ \ + & humvec4NumMethods, /* tp_as_number */ \ + & humvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)mvec_hash<4, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)mvec4_str, /* tp_str */ \ + (getattrofunc)mvec_getattr<4, glm::u32>, /* tp_getattro */ \ + (setattrofunc)mvec_setattr<4, glm::u32>, /* tp_setattro */ \ + & humvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "umvec4( )\n4 components mvector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)mvec_richcompare<4, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)mvec_geniter<4, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + humvec4_methods, /* tp_methods */ \ + 0, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)mvec_init<4, glm::u32>, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)mvec_new<4, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_MVEC, \ + 4, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<4, uint32>), \ + PyGLM_FS_UINT32 diff --git a/PyGLM/types/qua/double/quat.h b/PyGLM/types/qua/double/quat.h index 0885fbc..0d32c77 100644 --- a/PyGLM/types/qua/double/quat.h +++ b/PyGLM/types/qua/double/quat.h @@ -117,54 +117,50 @@ static PyTypeObject hdquaIterType = { (newfunc)quaIter_new, /* tp_new */ }; -static PyGLMTypeObject hdquaGLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dquat", /* tp_name */ - sizeof(qua), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)qua_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)qua_repr, /* tp_repr */ - & hdquaNumMethods, /* tp_as_number */ - & hdquaSeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)qua_hash, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)qua_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hdquaBufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dquat( )\n4 components quaternion of double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)qua_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)qua_geniter, /* tp_iter */ - 0, /* tp_iternext */ - hdqua_methods, /* tp_methods */ - hdqua_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)qua_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)qua_new, /* tp_new */ - }, - PyGLM_TYPE_QUA, - 4, - 0, - sizeof(double), - sizeof(glm::qua), +#define DQUA_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dquat", /* tp_name */ \ + sizeof(qua), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)qua_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)qua_repr, /* tp_repr */ \ + & hdquaNumMethods, /* tp_as_number */ \ + & hdquaSeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)qua_hash, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)qua_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hdquaBufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dquat( )\n4 components quaternion of double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)qua_richcompare, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)qua_geniter, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdqua_methods, /* tp_methods */ \ + hdqua_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)qua_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)qua_new, /* tp_new */ \ + }, \ + PyGLM_TYPE_QUA, \ + 4, \ + 0, \ + sizeof(double), \ + sizeof(glm::qua), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdquaType = *((PyTypeObject*)&hdquaGLMType); \ No newline at end of file diff --git a/PyGLM/types/qua/float/quat.h b/PyGLM/types/qua/float/quat.h index fe1604e..1df44e4 100644 --- a/PyGLM/types/qua/float/quat.h +++ b/PyGLM/types/qua/float/quat.h @@ -117,54 +117,50 @@ static PyTypeObject hfquaIterType = { (newfunc)quaIter_new, /* tp_new */ }; -static PyGLMTypeObject hfquaGLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.quat", /* tp_name */ - sizeof(qua), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)qua_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)qua_repr, /* tp_repr */ - & hfquaNumMethods, /* tp_as_number */ - & hfquaSeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)qua_hash, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)qua_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - & hfquaBufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "quat( )\n4 components quaternion of floating-point numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)qua_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)qua_geniter, /* tp_iter */ - 0, /* tp_iternext */ - hfqua_methods, /* tp_methods */ - hfqua_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)qua_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)qua_new, /* tp_new */ - }, - PyGLM_TYPE_QUA, - 4, - 0, - sizeof(float), - sizeof(glm::qua), +#define FQUA_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.quat", /* tp_name */ \ + sizeof(qua), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)qua_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)qua_repr, /* tp_repr */ \ + & hfquaNumMethods, /* tp_as_number */ \ + & hfquaSeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)qua_hash, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)qua_str, /* tp_str */ \ + 0, /* tp_getattro */ \ + 0, /* tp_setattro */ \ + & hfquaBufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "quat( )\n4 components quaternion of floating-point numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)qua_richcompare, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)qua_geniter, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfqua_methods, /* tp_methods */ \ + hfqua_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)qua_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)qua_new, /* tp_new */ \ + }, \ + PyGLM_TYPE_QUA, \ + 4, \ + 0, \ + sizeof(float), \ + sizeof(glm::qua), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfquaType = *((PyTypeObject*)&hfquaGLMType); \ No newline at end of file diff --git a/PyGLM/types/typeobjects.h b/PyGLM/types/typeobjects.h new file mode 100644 index 0000000..9a398f0 --- /dev/null +++ b/PyGLM/types/typeobjects.h @@ -0,0 +1,317 @@ +#pragma once + +#include "all.h" + +static PyGLMTypeObject PyGLMTypeObjectArray[] = { + { DVEC1_GLM_TYPEOBJECT }, + { DVEC2_GLM_TYPEOBJECT }, + { DVEC3_GLM_TYPEOBJECT }, + { DVEC4_GLM_TYPEOBJECT }, + { FVEC1_GLM_TYPEOBJECT }, + { FVEC2_GLM_TYPEOBJECT }, + { FVEC3_GLM_TYPEOBJECT }, + { FVEC4_GLM_TYPEOBJECT }, + { I64VEC1_GLM_TYPEOBJECT }, + { I64VEC2_GLM_TYPEOBJECT }, + { I64VEC3_GLM_TYPEOBJECT }, + { I64VEC4_GLM_TYPEOBJECT }, + { IVEC1_GLM_TYPEOBJECT }, + { IVEC2_GLM_TYPEOBJECT }, + { IVEC3_GLM_TYPEOBJECT }, + { IVEC4_GLM_TYPEOBJECT }, + { I16VEC1_GLM_TYPEOBJECT }, + { I16VEC2_GLM_TYPEOBJECT }, + { I16VEC3_GLM_TYPEOBJECT }, + { I16VEC4_GLM_TYPEOBJECT }, + { I8VEC1_GLM_TYPEOBJECT }, + { I8VEC2_GLM_TYPEOBJECT }, + { I8VEC3_GLM_TYPEOBJECT }, + { I8VEC4_GLM_TYPEOBJECT }, + { U64VEC1_GLM_TYPEOBJECT }, + { U64VEC2_GLM_TYPEOBJECT }, + { U64VEC3_GLM_TYPEOBJECT }, + { U64VEC4_GLM_TYPEOBJECT }, + { UVEC1_GLM_TYPEOBJECT }, + { UVEC2_GLM_TYPEOBJECT }, + { UVEC3_GLM_TYPEOBJECT }, + { UVEC4_GLM_TYPEOBJECT }, + { U16VEC1_GLM_TYPEOBJECT }, + { U16VEC2_GLM_TYPEOBJECT }, + { U16VEC3_GLM_TYPEOBJECT }, + { U16VEC4_GLM_TYPEOBJECT }, + { U8VEC1_GLM_TYPEOBJECT }, + { U8VEC2_GLM_TYPEOBJECT }, + { U8VEC3_GLM_TYPEOBJECT }, + { U8VEC4_GLM_TYPEOBJECT }, + { BVEC1_GLM_TYPEOBJECT }, + { BVEC2_GLM_TYPEOBJECT }, + { BVEC3_GLM_TYPEOBJECT }, + { BVEC4_GLM_TYPEOBJECT }, + + { DMVEC2_GLM_TYPEOBJECT }, + { DMVEC3_GLM_TYPEOBJECT }, + { DMVEC4_GLM_TYPEOBJECT }, + { FMVEC2_GLM_TYPEOBJECT }, + { FMVEC3_GLM_TYPEOBJECT }, + { FMVEC4_GLM_TYPEOBJECT }, + { IMVEC2_GLM_TYPEOBJECT }, + { IMVEC3_GLM_TYPEOBJECT }, + { IMVEC4_GLM_TYPEOBJECT }, + { UMVEC2_GLM_TYPEOBJECT }, + { UMVEC3_GLM_TYPEOBJECT }, + { UMVEC4_GLM_TYPEOBJECT }, + + { DMAT2x2_GLM_TYPEOBJECT }, + { DMAT2x3_GLM_TYPEOBJECT }, + { DMAT2x4_GLM_TYPEOBJECT }, + { DMAT3x2_GLM_TYPEOBJECT }, + { DMAT3x3_GLM_TYPEOBJECT }, + { DMAT3x4_GLM_TYPEOBJECT }, + { DMAT4x2_GLM_TYPEOBJECT }, + { DMAT4x3_GLM_TYPEOBJECT }, + { DMAT4x4_GLM_TYPEOBJECT }, + { FMAT2x2_GLM_TYPEOBJECT }, + { FMAT2x3_GLM_TYPEOBJECT }, + { FMAT2x4_GLM_TYPEOBJECT }, + { FMAT3x2_GLM_TYPEOBJECT }, + { FMAT3x3_GLM_TYPEOBJECT }, + { FMAT3x4_GLM_TYPEOBJECT }, + { FMAT4x2_GLM_TYPEOBJECT }, + { FMAT4x3_GLM_TYPEOBJECT }, + { FMAT4x4_GLM_TYPEOBJECT }, + { IMAT2x2_GLM_TYPEOBJECT }, + { IMAT2x3_GLM_TYPEOBJECT }, + { IMAT2x4_GLM_TYPEOBJECT }, + { IMAT3x2_GLM_TYPEOBJECT }, + { IMAT3x3_GLM_TYPEOBJECT }, + { IMAT3x4_GLM_TYPEOBJECT }, + { IMAT4x2_GLM_TYPEOBJECT }, + { IMAT4x3_GLM_TYPEOBJECT }, + { IMAT4x4_GLM_TYPEOBJECT }, + { UMAT2x2_GLM_TYPEOBJECT }, + { UMAT2x3_GLM_TYPEOBJECT }, + { UMAT2x4_GLM_TYPEOBJECT }, + { UMAT3x2_GLM_TYPEOBJECT }, + { UMAT3x3_GLM_TYPEOBJECT }, + { UMAT3x4_GLM_TYPEOBJECT }, + { UMAT4x2_GLM_TYPEOBJECT }, + { UMAT4x3_GLM_TYPEOBJECT }, + { UMAT4x4_GLM_TYPEOBJECT }, + + { DQUA_GLM_TYPEOBJECT }, + { FQUA_GLM_TYPEOBJECT } +}; + +#define _VEC_START 0 +#define _MVEC_START 44 +#define _MAT_START 56 +#define _QUA_START 92 + +#define _TOTAL_TYPEOBJECTS 94 + +static PyGLMTypeObject* const PyGLMTypeObjectArrayStart = PyGLMTypeObjectArray; +static PyGLMTypeObject* const PyGLMTypeObjectArrayEnd = reinterpret_cast(reinterpret_cast(PyGLMTypeObjectArray) + sizeof(PyGLMTypeObjectArray)); + +template +static constexpr ptrdiff_t PyGLMTypeObjectArrayOffsetVec() { + if (std::is_same::value) { + return _VEC_START + 0 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 4 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 8 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 12 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 16 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 20 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 24 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 28 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 32 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 36 + L - 1; + } + if (std::is_same::value) { + return _VEC_START + 40 + L - 1; + } +} + +template +static constexpr ptrdiff_t PyGLMTypeObjectArrayOffsetMat() { + if (std::is_same::value) { + return _MAT_START + 0 + R - 2 + 3 * (C - 2); + } + if (std::is_same::value) { + return _MAT_START + 9 + R - 2 + 3 * (C - 2); + } + if (std::is_same::value) { + return _MAT_START + 18 + R - 2 + 3 * (C - 2); + } + if (std::is_same::value) { + return _MAT_START + 27 + R - 2 + 3 * (C - 2); + } +} + +template +static constexpr ptrdiff_t PyGLMTypeObjectArrayOffsetMVec() { + if (2 <= L && L <= 4) { + if (std::is_same::value) { + return _MVEC_START + 0 + L - 2; + } + if (std::is_same::value) { + return _MVEC_START + 3 + L - 2; + } + if (std::is_same::value) { + return _MVEC_START + 6 + L - 2; + } + if (std::is_same::value) { + return _MVEC_START + 9 + L - 2; + } + } +} + +template +static constexpr ptrdiff_t PyGLMTypeObjectArrayOffsetQua() { + if (std::is_same::value) { + return _QUA_START + 0; + } + if (std::is_same::value) { + return _QUA_START + 1; + } +} + +// vec +static PyTypeObject& hdvec1Type = PyGLMTypeObjectArray[_VEC_START + 0].typeObject; +static PyTypeObject& hdvec2Type = PyGLMTypeObjectArray[_VEC_START + 1].typeObject; +static PyTypeObject& hdvec3Type = PyGLMTypeObjectArray[_VEC_START + 2].typeObject; +static PyTypeObject& hdvec4Type = PyGLMTypeObjectArray[_VEC_START + 3].typeObject; + +static PyTypeObject& hfvec1Type = PyGLMTypeObjectArray[_VEC_START + 4].typeObject; +static PyTypeObject& hfvec2Type = PyGLMTypeObjectArray[_VEC_START + 5].typeObject; +static PyTypeObject& hfvec3Type = PyGLMTypeObjectArray[_VEC_START + 6].typeObject; +static PyTypeObject& hfvec4Type = PyGLMTypeObjectArray[_VEC_START + 7].typeObject; + +static PyTypeObject& hi64vec1Type = PyGLMTypeObjectArray[_VEC_START + 8].typeObject; +static PyTypeObject& hi64vec2Type = PyGLMTypeObjectArray[_VEC_START + 9].typeObject; +static PyTypeObject& hi64vec3Type = PyGLMTypeObjectArray[_VEC_START + 10].typeObject; +static PyTypeObject& hi64vec4Type = PyGLMTypeObjectArray[_VEC_START + 11].typeObject; + +static PyTypeObject& hivec1Type = PyGLMTypeObjectArray[_VEC_START + 12].typeObject; +static PyTypeObject& hivec2Type = PyGLMTypeObjectArray[_VEC_START + 13].typeObject; +static PyTypeObject& hivec3Type = PyGLMTypeObjectArray[_VEC_START + 14].typeObject; +static PyTypeObject& hivec4Type = PyGLMTypeObjectArray[_VEC_START + 15].typeObject; + +static PyTypeObject& hi16vec1Type = PyGLMTypeObjectArray[_VEC_START + 16].typeObject; +static PyTypeObject& hi16vec2Type = PyGLMTypeObjectArray[_VEC_START + 17].typeObject; +static PyTypeObject& hi16vec3Type = PyGLMTypeObjectArray[_VEC_START + 18].typeObject; +static PyTypeObject& hi16vec4Type = PyGLMTypeObjectArray[_VEC_START + 19].typeObject; + +static PyTypeObject& hi8vec1Type = PyGLMTypeObjectArray[_VEC_START + 20].typeObject; +static PyTypeObject& hi8vec2Type = PyGLMTypeObjectArray[_VEC_START + 21].typeObject; +static PyTypeObject& hi8vec3Type = PyGLMTypeObjectArray[_VEC_START + 22].typeObject; +static PyTypeObject& hi8vec4Type = PyGLMTypeObjectArray[_VEC_START + 23].typeObject; + +static PyTypeObject& hu64vec1Type = PyGLMTypeObjectArray[_VEC_START + 24].typeObject; +static PyTypeObject& hu64vec2Type = PyGLMTypeObjectArray[_VEC_START + 25].typeObject; +static PyTypeObject& hu64vec3Type = PyGLMTypeObjectArray[_VEC_START + 26].typeObject; +static PyTypeObject& hu64vec4Type = PyGLMTypeObjectArray[_VEC_START + 27].typeObject; + +static PyTypeObject& huvec1Type = PyGLMTypeObjectArray[_VEC_START + 28].typeObject; +static PyTypeObject& huvec2Type = PyGLMTypeObjectArray[_VEC_START + 29].typeObject; +static PyTypeObject& huvec3Type = PyGLMTypeObjectArray[_VEC_START + 30].typeObject; +static PyTypeObject& huvec4Type = PyGLMTypeObjectArray[_VEC_START + 31].typeObject; + +static PyTypeObject& hu16vec1Type = PyGLMTypeObjectArray[_VEC_START + 32].typeObject; +static PyTypeObject& hu16vec2Type = PyGLMTypeObjectArray[_VEC_START + 33].typeObject; +static PyTypeObject& hu16vec3Type = PyGLMTypeObjectArray[_VEC_START + 34].typeObject; +static PyTypeObject& hu16vec4Type = PyGLMTypeObjectArray[_VEC_START + 35].typeObject; + +static PyTypeObject& hu8vec1Type = PyGLMTypeObjectArray[_VEC_START + 36].typeObject; +static PyTypeObject& hu8vec2Type = PyGLMTypeObjectArray[_VEC_START + 37].typeObject; +static PyTypeObject& hu8vec3Type = PyGLMTypeObjectArray[_VEC_START + 38].typeObject; +static PyTypeObject& hu8vec4Type = PyGLMTypeObjectArray[_VEC_START + 39].typeObject; + +static PyTypeObject& hbvec1Type = PyGLMTypeObjectArray[_VEC_START + 40].typeObject; +static PyTypeObject& hbvec2Type = PyGLMTypeObjectArray[_VEC_START + 41].typeObject; +static PyTypeObject& hbvec3Type = PyGLMTypeObjectArray[_VEC_START + 42].typeObject; +static PyTypeObject& hbvec4Type = PyGLMTypeObjectArray[_VEC_START + 43].typeObject; + +// mvec +static PyTypeObject& hdmvec2Type = PyGLMTypeObjectArray[_MVEC_START + 0].typeObject; +static PyTypeObject& hdmvec3Type = PyGLMTypeObjectArray[_MVEC_START + 1].typeObject; +static PyTypeObject& hdmvec4Type = PyGLMTypeObjectArray[_MVEC_START + 2].typeObject; + +static PyTypeObject& hfmvec2Type = PyGLMTypeObjectArray[_MVEC_START + 3].typeObject; +static PyTypeObject& hfmvec3Type = PyGLMTypeObjectArray[_MVEC_START + 4].typeObject; +static PyTypeObject& hfmvec4Type = PyGLMTypeObjectArray[_MVEC_START + 5].typeObject; + +static PyTypeObject& himvec2Type = PyGLMTypeObjectArray[_MVEC_START + 6].typeObject; +static PyTypeObject& himvec3Type = PyGLMTypeObjectArray[_MVEC_START + 7].typeObject; +static PyTypeObject& himvec4Type = PyGLMTypeObjectArray[_MVEC_START + 8].typeObject; + +static PyTypeObject& humvec2Type = PyGLMTypeObjectArray[_MVEC_START + 9].typeObject; +static PyTypeObject& humvec3Type = PyGLMTypeObjectArray[_MVEC_START + 10].typeObject; +static PyTypeObject& humvec4Type = PyGLMTypeObjectArray[_MVEC_START + 11].typeObject; + +// mat +static PyTypeObject& hdmat2x2Type = PyGLMTypeObjectArray[_MAT_START + 0].typeObject; +static PyTypeObject& hdmat2x3Type = PyGLMTypeObjectArray[_MAT_START + 1].typeObject; +static PyTypeObject& hdmat2x4Type = PyGLMTypeObjectArray[_MAT_START + 2].typeObject; +static PyTypeObject& hdmat3x2Type = PyGLMTypeObjectArray[_MAT_START + 3].typeObject; +static PyTypeObject& hdmat3x3Type = PyGLMTypeObjectArray[_MAT_START + 4].typeObject; +static PyTypeObject& hdmat3x4Type = PyGLMTypeObjectArray[_MAT_START + 5].typeObject; +static PyTypeObject& hdmat4x2Type = PyGLMTypeObjectArray[_MAT_START + 6].typeObject; +static PyTypeObject& hdmat4x3Type = PyGLMTypeObjectArray[_MAT_START + 7].typeObject; +static PyTypeObject& hdmat4x4Type = PyGLMTypeObjectArray[_MAT_START + 8].typeObject; + +static PyTypeObject& hfmat2x2Type = PyGLMTypeObjectArray[_MAT_START + 9].typeObject; +static PyTypeObject& hfmat2x3Type = PyGLMTypeObjectArray[_MAT_START + 10].typeObject; +static PyTypeObject& hfmat2x4Type = PyGLMTypeObjectArray[_MAT_START + 11].typeObject; +static PyTypeObject& hfmat3x2Type = PyGLMTypeObjectArray[_MAT_START + 12].typeObject; +static PyTypeObject& hfmat3x3Type = PyGLMTypeObjectArray[_MAT_START + 13].typeObject; +static PyTypeObject& hfmat3x4Type = PyGLMTypeObjectArray[_MAT_START + 14].typeObject; +static PyTypeObject& hfmat4x2Type = PyGLMTypeObjectArray[_MAT_START + 15].typeObject; +static PyTypeObject& hfmat4x3Type = PyGLMTypeObjectArray[_MAT_START + 16].typeObject; +static PyTypeObject& hfmat4x4Type = PyGLMTypeObjectArray[_MAT_START + 17].typeObject; + +static PyTypeObject& himat2x2Type = PyGLMTypeObjectArray[_MAT_START + 18].typeObject; +static PyTypeObject& himat2x3Type = PyGLMTypeObjectArray[_MAT_START + 19].typeObject; +static PyTypeObject& himat2x4Type = PyGLMTypeObjectArray[_MAT_START + 20].typeObject; +static PyTypeObject& himat3x2Type = PyGLMTypeObjectArray[_MAT_START + 21].typeObject; +static PyTypeObject& himat3x3Type = PyGLMTypeObjectArray[_MAT_START + 22].typeObject; +static PyTypeObject& himat3x4Type = PyGLMTypeObjectArray[_MAT_START + 23].typeObject; +static PyTypeObject& himat4x2Type = PyGLMTypeObjectArray[_MAT_START + 24].typeObject; +static PyTypeObject& himat4x3Type = PyGLMTypeObjectArray[_MAT_START + 25].typeObject; +static PyTypeObject& himat4x4Type = PyGLMTypeObjectArray[_MAT_START + 26].typeObject; + +static PyTypeObject& humat2x2Type = PyGLMTypeObjectArray[_MAT_START + 27].typeObject; +static PyTypeObject& humat2x3Type = PyGLMTypeObjectArray[_MAT_START + 28].typeObject; +static PyTypeObject& humat2x4Type = PyGLMTypeObjectArray[_MAT_START + 29].typeObject; +static PyTypeObject& humat3x2Type = PyGLMTypeObjectArray[_MAT_START + 30].typeObject; +static PyTypeObject& humat3x3Type = PyGLMTypeObjectArray[_MAT_START + 31].typeObject; +static PyTypeObject& humat3x4Type = PyGLMTypeObjectArray[_MAT_START + 32].typeObject; +static PyTypeObject& humat4x2Type = PyGLMTypeObjectArray[_MAT_START + 33].typeObject; +static PyTypeObject& humat4x3Type = PyGLMTypeObjectArray[_MAT_START + 34].typeObject; +static PyTypeObject& humat4x4Type = PyGLMTypeObjectArray[_MAT_START + 35].typeObject; + +// qua +static PyTypeObject& hdquaType = PyGLMTypeObjectArray[_QUA_START + 0].typeObject; +static PyTypeObject& hfquaType = PyGLMTypeObjectArray[_QUA_START + 1].typeObject; + +#undef _VEC_START +#undef _MVEC_START +#undef _MAT_START +#undef _QUA_START diff --git a/PyGLM/types/types.h b/PyGLM/types/types.h index 6e3ce35..979e845 100644 --- a/PyGLM/types/types.h +++ b/PyGLM/types/types.h @@ -397,13 +397,13 @@ struct PyGLMTypeObject { } inline char* getDataOf(PyObject* src) { - char* out = reinterpret_cast(src); + char* const out = reinterpret_cast(src) + sizeof(PyObject); if (glmType == PyGLM_TYPE_MVEC) { - return *reinterpret_cast((out + sizeof(PyObject))); + return *reinterpret_cast(out); } - return (out + sizeof(PyObject)); + return out; } //inline PyTypeObject* typeObjectPointer() { diff --git a/PyGLM/types/vec/bool/vec1.h b/PyGLM/types/vec/bool/vec1.h index b019ce6..c626b3a 100644 --- a/PyGLM/types/vec/bool/vec1.h +++ b/PyGLM/types/vec/bool/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hbvec1IterType = { (newfunc)vecIter_new<1, bool>, /* tp_new */ }; -static PyGLMTypeObject hbvec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.bvec1", /* tp_name */ - sizeof(vec<1, bool>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - &hbvec1NumMethods, /* tp_as_number */ - &hbvec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, bool>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, bool>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, bool>, /* tp_setattro */ - &hbvec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "bvec1( )\n1 component vector of high qualifier boolean values.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, bool>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, bool>, /* tp_iter */ - 0, /* tp_iternext */ - hbvec1_methods, /* tp_methods */ - hbvec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, bool>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(bool), - sizeof(glm::vec<1, bool>), +#define BVEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.bvec1", /* tp_name */ \ + sizeof(vec<1, bool>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + &hbvec1NumMethods, /* tp_as_number */ \ + &hbvec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, bool>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, bool>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, bool>, /* tp_setattro */ \ + &hbvec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "bvec1( )\n1 component vector of high qualifier boolean values.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, bool>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, bool>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hbvec1_methods, /* tp_methods */ \ + hbvec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, bool>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(bool), \ + sizeof(glm::vec<1, bool>), \ PyGLM_FS_BOOL -}; - -static PyTypeObject& hbvec1Type = *((PyTypeObject*)&hbvec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/bool/vec2.h b/PyGLM/types/vec/bool/vec2.h index 61aae1d..dc2a8ab 100644 --- a/PyGLM/types/vec/bool/vec2.h +++ b/PyGLM/types/vec/bool/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hbvec2IterType = { (newfunc)vecIter_new<2, bool>, /* tp_new */ }; -static PyGLMTypeObject hbvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.bvec2", /* tp_name */ - sizeof(vec<2, bool>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hbvec2NumMethods, /* tp_as_number */ - & hbvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, bool>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, bool>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, bool>, /* tp_setattro */ - & hbvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "bvec2( )\n2 components vector of high qualifier boolean values.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, bool>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, bool>, /* tp_iter */ - 0, /* tp_iternext */ - hbvec2_methods, /* tp_methods */ - hbvec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, bool>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(bool), - sizeof(glm::vec<2, bool>), +#define BVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.bvec2", /* tp_name */ \ + sizeof(vec<2, bool>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hbvec2NumMethods, /* tp_as_number */ \ + & hbvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, bool>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, bool>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, bool>, /* tp_setattro */ \ + & hbvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "bvec2( )\n2 components vector of high qualifier boolean values.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, bool>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, bool>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hbvec2_methods, /* tp_methods */ \ + hbvec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, bool>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(bool), \ + sizeof(glm::vec<2, bool>), \ PyGLM_FS_BOOL -}; - -static PyTypeObject& hbvec2Type = *((PyTypeObject*)&hbvec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/bool/vec3.h b/PyGLM/types/vec/bool/vec3.h index 1c21c18..6c23422 100644 --- a/PyGLM/types/vec/bool/vec3.h +++ b/PyGLM/types/vec/bool/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hbvec3IterType = { (newfunc)vecIter_new<3, bool>, /* tp_new */ }; -static PyGLMTypeObject hbvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.bvec3", /* tp_name */ - sizeof(vec<3, bool>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hbvec3NumMethods, /* tp_as_number */ - & hbvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, bool>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, bool>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, bool>, /* tp_setattro */ - & hbvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "bvec3( )\n3 components vector of high qualifier boolean values.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, bool>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, bool>, /* tp_iter */ - 0, /* tp_iternext */ - hbvec3_methods, /* tp_methods */ - hbvec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, bool>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(bool), - sizeof(glm::vec<3, bool>), +#define BVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.bvec3", /* tp_name */ \ + sizeof(vec<3, bool>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hbvec3NumMethods, /* tp_as_number */ \ + & hbvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, bool>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, bool>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, bool>, /* tp_setattro */ \ + & hbvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "bvec3( )\n3 components vector of high qualifier boolean values.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, bool>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, bool>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hbvec3_methods, /* tp_methods */ \ + hbvec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, bool>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(bool), \ + sizeof(glm::vec<3, bool>), \ PyGLM_FS_BOOL -}; - -static PyTypeObject& hbvec3Type = *((PyTypeObject*)&hbvec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/bool/vec4.h b/PyGLM/types/vec/bool/vec4.h index 2da0406..904d53b 100644 --- a/PyGLM/types/vec/bool/vec4.h +++ b/PyGLM/types/vec/bool/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hbvec4IterType = { (newfunc)vecIter_new<4, bool>, /* tp_new */ }; -static PyGLMTypeObject hbvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.bvec4", /* tp_name */ - sizeof(vec<4, bool>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - &hbvec4NumMethods, /* tp_as_number */ - &hbvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, bool>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, bool>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, bool>, /* tp_setattro */ - & hbvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "bvec4( )\n4 components vector of high qualifier boolean values.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, bool>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, bool>, /* tp_iter */ - 0, /* tp_iternext */ - hbvec4_methods, /* tp_methods */ - hbvec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, bool>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(bool), - sizeof(glm::vec<4, bool>), +#define BVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.bvec4", /* tp_name */ \ + sizeof(vec<4, bool>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + &hbvec4NumMethods, /* tp_as_number */ \ + &hbvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, bool>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, bool>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, bool>, /* tp_setattro */ \ + & hbvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "bvec4( )\n4 components vector of high qualifier boolean values.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, bool>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, bool>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hbvec4_methods, /* tp_methods */ \ + hbvec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, bool>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(bool), \ + sizeof(glm::vec<4, bool>), \ PyGLM_FS_BOOL -}; - -static PyTypeObject& hbvec4Type = *((PyTypeObject*)&hbvec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/double/vec1.h b/PyGLM/types/vec/double/vec1.h index 1428af1..6b1cffa 100644 --- a/PyGLM/types/vec/double/vec1.h +++ b/PyGLM/types/vec/double/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hdvec1IterType = { (newfunc)vecIter_new<1, double>, /* tp_new */ }; -static PyGLMTypeObject hdvec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dvec1", /* tp_name */ - sizeof(vec<1, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hdvec1NumMethods, /* tp_as_number */ - & hdvec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, double>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, double>, /* tp_setattro */ - & hdvec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dvec1( )\n1 component vector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdvec1_methods, /* tp_methods */ - hdvec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, double>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(double), - sizeof(glm::vec<1, double>), - PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdvec1Type = *((PyTypeObject*)&hdvec1GLMType); \ No newline at end of file +#define DVEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dvec1", /* tp_name */ \ + sizeof(vec<1, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hdvec1NumMethods, /* tp_as_number */ \ + & hdvec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, double>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, double>, /* tp_setattro */ \ + & hdvec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dvec1( )\n1 component vector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdvec1_methods, /* tp_methods */ \ + hdvec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<1, double>), \ + PyGLM_FS_DOUBLE \ No newline at end of file diff --git a/PyGLM/types/vec/double/vec2.h b/PyGLM/types/vec/double/vec2.h index 5ff2682..b445b62 100644 --- a/PyGLM/types/vec/double/vec2.h +++ b/PyGLM/types/vec/double/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hdvec2IterType = { (newfunc)vecIter_new<2, double>, /* tp_new */ }; -static PyGLMTypeObject hdvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dvec2", /* tp_name */ - sizeof(vec<2, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hdvec2NumMethods, /* tp_as_number */ - & hdvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, double>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, double>, /* tp_setattro */ - & hdvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dvec2( )\n2 components vector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdvec2_methods, /* tp_methods */ - hdvec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, double>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(double), - sizeof(glm::vec<2, double>), +#define DVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dvec2", /* tp_name */ \ + sizeof(vec<2, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hdvec2NumMethods, /* tp_as_number */ \ + & hdvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, double>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, double>, /* tp_setattro */ \ + & hdvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dvec2( )\n2 components vector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdvec2_methods, /* tp_methods */ \ + hdvec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<2, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdvec2Type = *((PyTypeObject*)&hdvec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/double/vec3.h b/PyGLM/types/vec/double/vec3.h index 848eb0f..ec1f75c 100644 --- a/PyGLM/types/vec/double/vec3.h +++ b/PyGLM/types/vec/double/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hdvec3IterType = { (newfunc)vecIter_new<3, double>, /* tp_new */ }; -static PyGLMTypeObject hdvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dvec3", /* tp_name */ - sizeof(vec<3, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hdvec3NumMethods, /* tp_as_number */ - & hdvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, double>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, double>, /* tp_setattro */ - & hdvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dvec3( )\n3 components vector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdvec3_methods, /* tp_methods */ - hdvec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, double>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(double), - sizeof(glm::vec<3, double>), +#define DVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dvec3", /* tp_name */ \ + sizeof(vec<3, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hdvec3NumMethods, /* tp_as_number */ \ + & hdvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, double>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, double>, /* tp_setattro */ \ + & hdvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dvec3( )\n3 components vector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdvec3_methods, /* tp_methods */ \ + hdvec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<3, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdvec3Type = *((PyTypeObject*)&hdvec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/double/vec4.h b/PyGLM/types/vec/double/vec4.h index 961da24..3b6944d 100644 --- a/PyGLM/types/vec/double/vec4.h +++ b/PyGLM/types/vec/double/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hdvec4IterType = { (newfunc)vecIter_new<4, double>, /* tp_new */ }; -static PyGLMTypeObject hdvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.dvec4", /* tp_name */ - sizeof(vec<4, double>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hdvec4NumMethods, /* tp_as_number */ - & hdvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, double>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, double>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, double>, /* tp_setattro */ - & hdvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "dvec4( )\n4 components vector of high qualifier double numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, double>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, double>, /* tp_iter */ - 0, /* tp_iternext */ - hdvec4_methods, /* tp_methods */ - hdvec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, double>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(double), - sizeof(glm::vec<4, double>), +#define DVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.dvec4", /* tp_name */ \ + sizeof(vec<4, double>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hdvec4NumMethods, /* tp_as_number */ \ + & hdvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, double>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, double>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, double>, /* tp_setattro */ \ + & hdvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "dvec4( )\n4 components vector of high qualifier double numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, double>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, double>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hdvec4_methods, /* tp_methods */ \ + hdvec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, double>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(double), \ + sizeof(glm::vec<4, double>), \ PyGLM_FS_DOUBLE -}; - -static PyTypeObject& hdvec4Type = *((PyTypeObject*)&hdvec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/float/vec1.h b/PyGLM/types/vec/float/vec1.h index 6d66d8f..ad9e053 100644 --- a/PyGLM/types/vec/float/vec1.h +++ b/PyGLM/types/vec/float/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hfvec1IterType = { (newfunc)vecIter_new<1, float>, /* tp_new */ }; -static PyGLMTypeObject hfvec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.vec1", /* tp_name */ - sizeof(vec<1, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hfvec1NumMethods, /* tp_as_number */ - & hfvec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, float>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, float>, /* tp_setattro */ - & hfvec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "vec1( )\n1 component vector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfvec1_methods, /* tp_methods */ - hfvec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, float>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(float), - sizeof(glm::vec<1, float>), +#define FVEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.vec1", /* tp_name */ \ + sizeof(vec<1, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hfvec1NumMethods, /* tp_as_number */ \ + & hfvec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, float>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, float>, /* tp_setattro */ \ + & hfvec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "vec1( )\n1 component vector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfvec1_methods, /* tp_methods */ \ + hfvec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<1, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfvec1Type = *((PyTypeObject*)&hfvec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/float/vec2.h b/PyGLM/types/vec/float/vec2.h index 9615d5a..dde3039 100644 --- a/PyGLM/types/vec/float/vec2.h +++ b/PyGLM/types/vec/float/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hfvec2IterType = { (newfunc)vecIter_new<2, float>, /* tp_new */ }; -static PyGLMTypeObject hfvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.vec2", /* tp_name */ - sizeof(vec<2, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hfvec2NumMethods, /* tp_as_number */ - & hfvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, float>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, float>, /* tp_setattro */ - & hfvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "vec2( )\n2 components vector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfvec2_methods, /* tp_methods */ - hfvec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, float>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(float), - sizeof(glm::vec<2, float>), +#define FVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.vec2", /* tp_name */ \ + sizeof(vec<2, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hfvec2NumMethods, /* tp_as_number */ \ + & hfvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, float>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, float>, /* tp_setattro */ \ + & hfvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "vec2( )\n2 components vector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfvec2_methods, /* tp_methods */ \ + hfvec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<2, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfvec2Type = *((PyTypeObject*)&hfvec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/float/vec3.h b/PyGLM/types/vec/float/vec3.h index cfc242c..68a088d 100644 --- a/PyGLM/types/vec/float/vec3.h +++ b/PyGLM/types/vec/float/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hfvec3IterType = { (newfunc)vecIter_new<3, float>, /* tp_new */ }; -static PyGLMTypeObject hfvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.vec3", /* tp_name */ - sizeof(vec<3, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hfvec3NumMethods, /* tp_as_number */ - & hfvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, float>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, float>, /* tp_setattro */ - & hfvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "vec3( )\n3 components vector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfvec3_methods, /* tp_methods */ - hfvec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, float>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(float), - sizeof(glm::vec<3, float>), +#define FVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.vec3", /* tp_name */ \ + sizeof(vec<3, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hfvec3NumMethods, /* tp_as_number */ \ + & hfvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, float>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, float>, /* tp_setattro */ \ + & hfvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "vec3( )\n3 components vector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfvec3_methods, /* tp_methods */ \ + hfvec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<3, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfvec3Type = *((PyTypeObject*)&hfvec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/float/vec4.h b/PyGLM/types/vec/float/vec4.h index d204a7c..1a0323e 100644 --- a/PyGLM/types/vec/float/vec4.h +++ b/PyGLM/types/vec/float/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hfvec4IterType = { (newfunc)vecIter_new<4, float>, /* tp_new */ }; -static PyGLMTypeObject hfvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.vec4", /* tp_name */ - sizeof(vec<4, float>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hfvec4NumMethods, /* tp_as_number */ - & hfvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, float>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, float>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, float>, /* tp_setattro */ - & hfvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "vec4( )\n4 components vector of high qualifier float numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, float>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, float>, /* tp_iter */ - 0, /* tp_iternext */ - hfvec4_methods, /* tp_methods */ - hfvec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, float>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(float), - sizeof(glm::vec<4, float>), +#define FVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.vec4", /* tp_name */ \ + sizeof(vec<4, float>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hfvec4NumMethods, /* tp_as_number */ \ + & hfvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, float>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, float>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, float>, /* tp_setattro */ \ + & hfvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "vec4( )\n4 components vector of high qualifier float numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, float>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, float>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hfvec4_methods, /* tp_methods */ \ + hfvec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, float>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(float), \ + sizeof(glm::vec<4, float>), \ PyGLM_FS_FLOAT -}; - -static PyTypeObject& hfvec4Type = *((PyTypeObject*)&hfvec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int16/vec1.h b/PyGLM/types/vec/int16/vec1.h index d5a2558..7e75e09 100644 --- a/PyGLM/types/vec/int16/vec1.h +++ b/PyGLM/types/vec/int16/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hi16vec1IterType = { (newfunc)vecIter_new<1, glm::i16>, /* tp_new */ }; -static PyGLMTypeObject hi16vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i16vec1", /* tp_name */ - sizeof(vec<1, glm::i16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hi16vec1NumMethods, /* tp_as_number */ - & hi16vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::i16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::i16>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::i16>, /* tp_setattro */ - & hi16vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i16vec1( )\n1 component vector of high qualifier 16 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::i16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::i16>, /* tp_iter */ - 0, /* tp_iternext */ - hi16vec1_methods, /* tp_methods */ - hi16vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::i16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(int16), - sizeof(glm::vec<1, int16>), +#define I16VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i16vec1", /* tp_name */ \ + sizeof(vec<1, glm::i16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hi16vec1NumMethods, /* tp_as_number */ \ + & hi16vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::i16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::i16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::i16>, /* tp_setattro */ \ + & hi16vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i16vec1( )\n1 component vector of high qualifier 16 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::i16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::i16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi16vec1_methods, /* tp_methods */ \ + hi16vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::i16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(int16), \ + sizeof(glm::vec<1, int16>), \ PyGLM_FS_INT16 -}; - -static PyTypeObject& hi16vec1Type = *((PyTypeObject*)&hi16vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int16/vec2.h b/PyGLM/types/vec/int16/vec2.h index 2adfe2b..577b943 100644 --- a/PyGLM/types/vec/int16/vec2.h +++ b/PyGLM/types/vec/int16/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hi16vec2IterType = { (newfunc)vecIter_new<2, glm::i16>, /* tp_new */ }; -static PyGLMTypeObject hi16vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i16vec2", /* tp_name */ - sizeof(vec<2, glm::i16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hi16vec2NumMethods, /* tp_as_number */ - & hi16vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::i16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::i16>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::i16>, /* tp_setattro */ - & hi16vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i16vec2( )\n2 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::i16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::i16>, /* tp_iter */ - 0, /* tp_iternext */ - hi16vec2_methods, /* tp_methods */ - hi16vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::i16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(int16), - sizeof(glm::vec<2, int16>), +#define I16VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i16vec2", /* tp_name */ \ + sizeof(vec<2, glm::i16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hi16vec2NumMethods, /* tp_as_number */ \ + & hi16vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::i16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::i16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::i16>, /* tp_setattro */ \ + & hi16vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i16vec2( )\n2 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::i16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::i16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi16vec2_methods, /* tp_methods */ \ + hi16vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::i16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(int16), \ + sizeof(glm::vec<2, int16>), \ PyGLM_FS_INT16 -}; - -static PyTypeObject& hi16vec2Type = *((PyTypeObject*)&hi16vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int16/vec3.h b/PyGLM/types/vec/int16/vec3.h index ffe69e5..7252752 100644 --- a/PyGLM/types/vec/int16/vec3.h +++ b/PyGLM/types/vec/int16/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hi16vec3IterType = { (newfunc)vecIter_new<3, glm::i16>, /* tp_new */ }; -static PyGLMTypeObject hi16vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i16vec3", /* tp_name */ - sizeof(vec<3, glm::i16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hi16vec3NumMethods, /* tp_as_number */ - & hi16vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::i16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::i16>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::i16>, /* tp_setattro */ - & hi16vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i16vec3( )\n3 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::i16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::i16>, /* tp_iter */ - 0, /* tp_iternext */ - hi16vec3_methods, /* tp_methods */ - hi16vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::i16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(int16), - sizeof(glm::vec<3, int16>), +#define I16VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i16vec3", /* tp_name */ \ + sizeof(vec<3, glm::i16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hi16vec3NumMethods, /* tp_as_number */ \ + & hi16vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::i16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::i16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::i16>, /* tp_setattro */ \ + & hi16vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i16vec3( )\n3 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::i16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::i16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi16vec3_methods, /* tp_methods */ \ + hi16vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::i16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(int16), \ + sizeof(glm::vec<3, int16>), \ PyGLM_FS_INT16 -}; - -static PyTypeObject& hi16vec3Type = *((PyTypeObject*)&hi16vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int16/vec4.h b/PyGLM/types/vec/int16/vec4.h index 18de978..d3ae855 100644 --- a/PyGLM/types/vec/int16/vec4.h +++ b/PyGLM/types/vec/int16/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hi16vec4IterType = { (newfunc)vecIter_new<4, glm::i16>, /* tp_new */ }; -static PyGLMTypeObject hi16vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i16vec4", /* tp_name */ - sizeof(vec<4, glm::i16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hi16vec4NumMethods, /* tp_as_number */ - & hi16vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::i16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::i16>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::i16>, /* tp_setattro */ - & hi16vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i16vec4( )\n4 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::i16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::i16>, /* tp_iter */ - 0, /* tp_iternext */ - hi16vec4_methods, /* tp_methods */ - hi16vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::i16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(int16), - sizeof(glm::vec<4, int16>), +#define I16VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i16vec4", /* tp_name */ \ + sizeof(vec<4, glm::i16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hi16vec4NumMethods, /* tp_as_number */ \ + & hi16vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::i16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::i16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::i16>, /* tp_setattro */ \ + & hi16vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i16vec4( )\n4 components vector of high qualifier 16 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::i16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::i16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi16vec4_methods, /* tp_methods */ \ + hi16vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::i16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(int16), \ + sizeof(glm::vec<4, int16>), \ PyGLM_FS_INT16 -}; - -static PyTypeObject& hi16vec4Type = *((PyTypeObject*)&hi16vec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int32/vec1.h b/PyGLM/types/vec/int32/vec1.h index 413ea1b..5378f63 100644 --- a/PyGLM/types/vec/int32/vec1.h +++ b/PyGLM/types/vec/int32/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hivec1IterType = { (newfunc)vecIter_new<1, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject hivec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.ivec1", /* tp_name */ - sizeof(vec<1, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hivec1NumMethods, /* tp_as_number */ - & hivec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::i32>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::i32>, /* tp_setattro */ - & hivec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "ivec1( )\n1 component vector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - hivec1_methods, /* tp_methods */ - hivec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(int32), - sizeof(glm::vec<1, int32>), +#define IVEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.ivec1", /* tp_name */ \ + sizeof(vec<1, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hivec1NumMethods, /* tp_as_number */ \ + & hivec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::i32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::i32>, /* tp_setattro */ \ + & hivec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "ivec1( )\n1 component vector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hivec1_methods, /* tp_methods */ \ + hivec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<1, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& hivec1Type = *((PyTypeObject*)&hivec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int32/vec2.h b/PyGLM/types/vec/int32/vec2.h index b86ea58..789905e 100644 --- a/PyGLM/types/vec/int32/vec2.h +++ b/PyGLM/types/vec/int32/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hivec2IterType = { (newfunc)vecIter_new<2, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject hivec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.ivec2", /* tp_name */ - sizeof(vec<2, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hivec2NumMethods, /* tp_as_number */ - & hivec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::i32>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::i32>, /* tp_setattro */ - & hivec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "ivec2( )\n2 components vector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - hivec2_methods, /* tp_methods */ - hivec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(int32), - sizeof(glm::vec<2, int32>), +#define IVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.ivec2", /* tp_name */ \ + sizeof(vec<2, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hivec2NumMethods, /* tp_as_number */ \ + & hivec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::i32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::i32>, /* tp_setattro */ \ + & hivec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "ivec2( )\n2 components vector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hivec2_methods, /* tp_methods */ \ + hivec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<2, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& hivec2Type = *((PyTypeObject*)&hivec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int32/vec3.h b/PyGLM/types/vec/int32/vec3.h index e897111..0480e45 100644 --- a/PyGLM/types/vec/int32/vec3.h +++ b/PyGLM/types/vec/int32/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hivec3IterType = { (newfunc)vecIter_new<3, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject hivec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.ivec3", /* tp_name */ - sizeof(vec<3, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hivec3NumMethods, /* tp_as_number */ - & hivec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::i32>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::i32>, /* tp_setattro */ - & hivec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "ivec3( )\n3 components vector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - hivec3_methods, /* tp_methods */ - hivec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(int32), - sizeof(glm::vec<3, int32>), +#define IVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.ivec3", /* tp_name */ \ + sizeof(vec<3, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hivec3NumMethods, /* tp_as_number */ \ + & hivec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::i32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::i32>, /* tp_setattro */ \ + & hivec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "ivec3( )\n3 components vector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hivec3_methods, /* tp_methods */ \ + hivec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<3, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& hivec3Type = *((PyTypeObject*)&hivec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int32/vec4.h b/PyGLM/types/vec/int32/vec4.h index 39a2868..cf06f96 100644 --- a/PyGLM/types/vec/int32/vec4.h +++ b/PyGLM/types/vec/int32/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hivec4IterType = { (newfunc)vecIter_new<4, glm::i32>, /* tp_new */ }; -static PyGLMTypeObject hivec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.ivec4", /* tp_name */ - sizeof(vec<4, glm::i32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hivec4NumMethods, /* tp_as_number */ - & hivec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::i32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::i32>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::i32>, /* tp_setattro */ - & hivec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "ivec4( )\n4 components vector of high qualifier integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::i32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::i32>, /* tp_iter */ - 0, /* tp_iternext */ - hivec4_methods, /* tp_methods */ - hivec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::i32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(int32), - sizeof(glm::vec<4, int32>), +#define IVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.ivec4", /* tp_name */ \ + sizeof(vec<4, glm::i32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hivec4NumMethods, /* tp_as_number */ \ + & hivec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::i32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::i32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::i32>, /* tp_setattro */ \ + & hivec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "ivec4( )\n4 components vector of high qualifier integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::i32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::i32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hivec4_methods, /* tp_methods */ \ + hivec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::i32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(int32), \ + sizeof(glm::vec<4, int32>), \ PyGLM_FS_INT32 -}; - -static PyTypeObject& hivec4Type = *((PyTypeObject*)&hivec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int64/vec1.h b/PyGLM/types/vec/int64/vec1.h index b211ae0..316e247 100644 --- a/PyGLM/types/vec/int64/vec1.h +++ b/PyGLM/types/vec/int64/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hi64vec1IterType = { (newfunc)vecIter_new<1, glm::i64>, /* tp_new */ }; -static PyGLMTypeObject hi64vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i64vec1", /* tp_name */ - sizeof(vec<1, glm::i64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hi64vec1NumMethods, /* tp_as_number */ - & hi64vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::i64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::i64>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::i64>, /* tp_setattro */ - & hi64vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i64vec1( )\n1 component vector of high qualifier 64 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::i64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::i64>, /* tp_iter */ - 0, /* tp_iternext */ - hi64vec1_methods, /* tp_methods */ - hi64vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::i64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(int64), - sizeof(glm::vec<1, int64>), +#define I64VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i64vec1", /* tp_name */ \ + sizeof(vec<1, glm::i64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hi64vec1NumMethods, /* tp_as_number */ \ + & hi64vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::i64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::i64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::i64>, /* tp_setattro */ \ + & hi64vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i64vec1( )\n1 component vector of high qualifier 64 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::i64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::i64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi64vec1_methods, /* tp_methods */ \ + hi64vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::i64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(int64), \ + sizeof(glm::vec<1, int64>), \ PyGLM_FS_INT64 -}; - -static PyTypeObject& hi64vec1Type = *((PyTypeObject*)&hi64vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int64/vec2.h b/PyGLM/types/vec/int64/vec2.h index c2f8a99..e9e5e3b 100644 --- a/PyGLM/types/vec/int64/vec2.h +++ b/PyGLM/types/vec/int64/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hi64vec2IterType = { (newfunc)vecIter_new<2, glm::i64>, /* tp_new */ }; -static PyGLMTypeObject hi64vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i64vec2", /* tp_name */ - sizeof(vec<2, glm::i64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hi64vec2NumMethods, /* tp_as_number */ - & hi64vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::i64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::i64>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::i64>, /* tp_setattro */ - & hi64vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i64vec2( )\n2 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::i64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::i64>, /* tp_iter */ - 0, /* tp_iternext */ - hi64vec2_methods, /* tp_methods */ - hi64vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::i64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(int64), - sizeof(glm::vec<2, int64>), +#define I64VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i64vec2", /* tp_name */ \ + sizeof(vec<2, glm::i64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hi64vec2NumMethods, /* tp_as_number */ \ + & hi64vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::i64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::i64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::i64>, /* tp_setattro */ \ + & hi64vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i64vec2( )\n2 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::i64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::i64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi64vec2_methods, /* tp_methods */ \ + hi64vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::i64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(int64), \ + sizeof(glm::vec<2, int64>), \ PyGLM_FS_INT64 -}; - -static PyTypeObject& hi64vec2Type = *((PyTypeObject*)&hi64vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int64/vec3.h b/PyGLM/types/vec/int64/vec3.h index 1fa1eaf..ef62eff 100644 --- a/PyGLM/types/vec/int64/vec3.h +++ b/PyGLM/types/vec/int64/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hi64vec3IterType = { (newfunc)vecIter_new<3, glm::i64>, /* tp_new */ }; -static PyGLMTypeObject hi64vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i64vec3", /* tp_name */ - sizeof(vec<3, glm::i64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hi64vec3NumMethods, /* tp_as_number */ - & hi64vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::i64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::i64>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::i64>, /* tp_setattro */ - & hi64vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i64vec3( )\n3 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::i64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::i64>, /* tp_iter */ - 0, /* tp_iternext */ - hi64vec3_methods, /* tp_methods */ - hi64vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::i64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(int64), - sizeof(glm::vec<3, int64>), +#define I64VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i64vec3", /* tp_name */ \ + sizeof(vec<3, glm::i64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hi64vec3NumMethods, /* tp_as_number */ \ + & hi64vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::i64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::i64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::i64>, /* tp_setattro */ \ + & hi64vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i64vec3( )\n3 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::i64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::i64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi64vec3_methods, /* tp_methods */ \ + hi64vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::i64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(int64), \ + sizeof(glm::vec<3, int64>), \ PyGLM_FS_INT64 -}; - -static PyTypeObject& hi64vec3Type = *((PyTypeObject*)&hi64vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int64/vec4.h b/PyGLM/types/vec/int64/vec4.h index 85bc3f6..41020b7 100644 --- a/PyGLM/types/vec/int64/vec4.h +++ b/PyGLM/types/vec/int64/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hi64vec4IterType = { (newfunc)vecIter_new<4, glm::i64>, /* tp_new */ }; -static PyGLMTypeObject hi64vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i64vec4", /* tp_name */ - sizeof(vec<4, glm::i64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hi64vec4NumMethods, /* tp_as_number */ - & hi64vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::i64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::i64>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::i64>, /* tp_setattro */ - & hi64vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i64vec4( )\n4 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::i64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::i64>, /* tp_iter */ - 0, /* tp_iternext */ - hi64vec4_methods, /* tp_methods */ - hi64vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::i64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(int64), - sizeof(glm::vec<4, int64>), +#define I64VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i64vec4", /* tp_name */ \ + sizeof(vec<4, glm::i64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hi64vec4NumMethods, /* tp_as_number */ \ + & hi64vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::i64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::i64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::i64>, /* tp_setattro */ \ + & hi64vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i64vec4( )\n4 components vector of high qualifier 64 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::i64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::i64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi64vec4_methods, /* tp_methods */ \ + hi64vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::i64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(int64), \ + sizeof(glm::vec<4, int64>), \ PyGLM_FS_INT64 -}; - -static PyTypeObject& hi64vec4Type = *((PyTypeObject*)&hi64vec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int8/vec1.h b/PyGLM/types/vec/int8/vec1.h index 1368f0a..685f978 100644 --- a/PyGLM/types/vec/int8/vec1.h +++ b/PyGLM/types/vec/int8/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hi8vec1IterType = { (newfunc)vecIter_new<1, glm::i8>, /* tp_new */ }; -static PyGLMTypeObject hi8vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i8vec1", /* tp_name */ - sizeof(vec<1, glm::i8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hi8vec1NumMethods, /* tp_as_number */ - & hi8vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::i8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::i8>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::i8>, /* tp_setattro */ - & hi8vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i8vec1( )\n1 component vector of high qualifier 8 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::i8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::i8>, /* tp_iter */ - 0, /* tp_iternext */ - hi8vec1_methods, /* tp_methods */ - hi8vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::i8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(int8), - sizeof(glm::vec<1, int8>), +#define I8VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i8vec1", /* tp_name */ \ + sizeof(vec<1, glm::i8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hi8vec1NumMethods, /* tp_as_number */ \ + & hi8vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::i8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::i8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::i8>, /* tp_setattro */ \ + & hi8vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i8vec1( )\n1 component vector of high qualifier 8 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::i8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::i8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi8vec1_methods, /* tp_methods */ \ + hi8vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::i8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(int8), \ + sizeof(glm::vec<1, int8>), \ PyGLM_FS_INT8 -}; - -static PyTypeObject& hi8vec1Type = *((PyTypeObject*)&hi8vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int8/vec2.h b/PyGLM/types/vec/int8/vec2.h index fcc01e4..d4330a4 100644 --- a/PyGLM/types/vec/int8/vec2.h +++ b/PyGLM/types/vec/int8/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hi8vec2IterType = { (newfunc)vecIter_new<2, glm::i8>, /* tp_new */ }; -static PyGLMTypeObject hi8vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i8vec2", /* tp_name */ - sizeof(vec<2, glm::i8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hi8vec2NumMethods, /* tp_as_number */ - & hi8vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::i8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::i8>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::i8>, /* tp_setattro */ - & hi8vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i8vec2( )\n2 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::i8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::i8>, /* tp_iter */ - 0, /* tp_iternext */ - hi8vec2_methods, /* tp_methods */ - hi8vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::i8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(int8), - sizeof(glm::vec<2, int8>), +#define I8VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i8vec2", /* tp_name */ \ + sizeof(vec<2, glm::i8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hi8vec2NumMethods, /* tp_as_number */ \ + & hi8vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::i8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::i8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::i8>, /* tp_setattro */ \ + & hi8vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i8vec2( )\n2 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::i8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::i8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi8vec2_methods, /* tp_methods */ \ + hi8vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::i8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(int8), \ + sizeof(glm::vec<2, int8>), \ PyGLM_FS_INT8 -}; - -static PyTypeObject& hi8vec2Type = *((PyTypeObject*)&hi8vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int8/vec3.h b/PyGLM/types/vec/int8/vec3.h index e0d748f..75e4ecf 100644 --- a/PyGLM/types/vec/int8/vec3.h +++ b/PyGLM/types/vec/int8/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hi8vec3IterType = { (newfunc)vecIter_new<3, glm::i8>, /* tp_new */ }; -static PyGLMTypeObject hi8vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i8vec3", /* tp_name */ - sizeof(vec<3, glm::i8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hi8vec3NumMethods, /* tp_as_number */ - & hi8vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::i8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::i8>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::i8>, /* tp_setattro */ - & hi8vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i8vec3( )\n3 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::i8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::i8>, /* tp_iter */ - 0, /* tp_iternext */ - hi8vec3_methods, /* tp_methods */ - hi8vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::i8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(int8), - sizeof(glm::vec<3, int8>), +#define I8VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i8vec3", /* tp_name */ \ + sizeof(vec<3, glm::i8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hi8vec3NumMethods, /* tp_as_number */ \ + & hi8vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::i8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::i8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::i8>, /* tp_setattro */ \ + & hi8vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i8vec3( )\n3 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::i8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::i8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi8vec3_methods, /* tp_methods */ \ + hi8vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::i8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(int8), \ + sizeof(glm::vec<3, int8>), \ PyGLM_FS_INT8 -}; - -static PyTypeObject& hi8vec3Type = *((PyTypeObject*)&hi8vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/int8/vec4.h b/PyGLM/types/vec/int8/vec4.h index 06c25cd..06e3a39 100644 --- a/PyGLM/types/vec/int8/vec4.h +++ b/PyGLM/types/vec/int8/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hi8vec4IterType = { (newfunc)vecIter_new<4, glm::i8>, /* tp_new */ }; -static PyGLMTypeObject hi8vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.i8vec4", /* tp_name */ - sizeof(vec<4, glm::i8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hi8vec4NumMethods, /* tp_as_number */ - & hi8vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::i8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::i8>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::i8>, /* tp_setattro */ - & hi8vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "i8vec4( )\n4 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::i8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::i8>, /* tp_iter */ - 0, /* tp_iternext */ - hi8vec4_methods, /* tp_methods */ - hi8vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::i8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(int8), - sizeof(glm::vec<4, int8>), +#define I8VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.i8vec4", /* tp_name */ \ + sizeof(vec<4, glm::i8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hi8vec4NumMethods, /* tp_as_number */ \ + & hi8vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::i8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::i8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::i8>, /* tp_setattro */ \ + & hi8vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "i8vec4( )\n4 components vector of high qualifier 8 bit integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::i8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::i8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hi8vec4_methods, /* tp_methods */ \ + hi8vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::i8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(int8), \ + sizeof(glm::vec<4, int8>), \ PyGLM_FS_INT8 -}; - -static PyTypeObject& hi8vec4Type = *((PyTypeObject*)&hi8vec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint16/vec1.h b/PyGLM/types/vec/uint16/vec1.h index aa7030d..dbd89d2 100644 --- a/PyGLM/types/vec/uint16/vec1.h +++ b/PyGLM/types/vec/uint16/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hu16vec1IterType = { (newfunc)vecIter_new<1, glm::u16>, /* tp_new */ }; -static PyGLMTypeObject hu16vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u16vec1", /* tp_name */ - sizeof(vec<1, glm::u16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hu16vec1NumMethods, /* tp_as_number */ - & hu16vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::u16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::u16>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::u16>, /* tp_setattro */ - & hu16vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u16vec1( )\n1 component vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::u16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::u16>, /* tp_iter */ - 0, /* tp_iternext */ - hu16vec1_methods, /* tp_methods */ - hu16vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::u16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(uint16), - sizeof(glm::vec<1, uint16>), +#define U16VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u16vec1", /* tp_name */ \ + sizeof(vec<1, glm::u16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hu16vec1NumMethods, /* tp_as_number */ \ + & hu16vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::u16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::u16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::u16>, /* tp_setattro */ \ + & hu16vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u16vec1( )\n1 component vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::u16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::u16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu16vec1_methods, /* tp_methods */ \ + hu16vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::u16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(uint16), \ + sizeof(glm::vec<1, uint16>), \ PyGLM_FS_UINT16 -}; - -static PyTypeObject& hu16vec1Type = *((PyTypeObject*)&hu16vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint16/vec2.h b/PyGLM/types/vec/uint16/vec2.h index 7e183f2..9d2fb44 100644 --- a/PyGLM/types/vec/uint16/vec2.h +++ b/PyGLM/types/vec/uint16/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hu16vec2IterType = { (newfunc)vecIter_new<2, glm::u16>, /* tp_new */ }; -static PyGLMTypeObject hu16vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u16vec2", /* tp_name */ - sizeof(vec<2, glm::u16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hu16vec2NumMethods, /* tp_as_number */ - & hu16vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::u16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::u16>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::u16>, /* tp_setattro */ - & hu16vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u16vec2( )\n2 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::u16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::u16>, /* tp_iter */ - 0, /* tp_iternext */ - hu16vec2_methods, /* tp_methods */ - hu16vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::u16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(uint16), - sizeof(glm::vec<2, uint16>), +#define U16VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u16vec2", /* tp_name */ \ + sizeof(vec<2, glm::u16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hu16vec2NumMethods, /* tp_as_number */ \ + & hu16vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::u16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::u16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::u16>, /* tp_setattro */ \ + & hu16vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u16vec2( )\n2 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::u16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::u16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu16vec2_methods, /* tp_methods */ \ + hu16vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::u16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(uint16), \ + sizeof(glm::vec<2, uint16>), \ PyGLM_FS_UINT16 -}; - -static PyTypeObject& hu16vec2Type = *((PyTypeObject*)&hu16vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint16/vec3.h b/PyGLM/types/vec/uint16/vec3.h index 0b8b0be..e2fe385 100644 --- a/PyGLM/types/vec/uint16/vec3.h +++ b/PyGLM/types/vec/uint16/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hu16vec3IterType = { (newfunc)vecIter_new<3, glm::u16>, /* tp_new */ }; -static PyGLMTypeObject hu16vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u16vec3", /* tp_name */ - sizeof(vec<3, glm::u16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hu16vec3NumMethods, /* tp_as_number */ - & hu16vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::u16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::u16>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::u16>, /* tp_setattro */ - & hu16vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u16vec3( )\n3 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::u16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::u16>, /* tp_iter */ - 0, /* tp_iternext */ - hu16vec3_methods, /* tp_methods */ - hu16vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::u16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(uint16), - sizeof(glm::vec<3, uint16>), +#define U16VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u16vec3", /* tp_name */ \ + sizeof(vec<3, glm::u16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hu16vec3NumMethods, /* tp_as_number */ \ + & hu16vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::u16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::u16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::u16>, /* tp_setattro */ \ + & hu16vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u16vec3( )\n3 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::u16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::u16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu16vec3_methods, /* tp_methods */ \ + hu16vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::u16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(uint16), \ + sizeof(glm::vec<3, uint16>), \ PyGLM_FS_UINT16 -}; - -static PyTypeObject& hu16vec3Type = *((PyTypeObject*)&hu16vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint16/vec4.h b/PyGLM/types/vec/uint16/vec4.h index ce7e0a1..17e9821 100644 --- a/PyGLM/types/vec/uint16/vec4.h +++ b/PyGLM/types/vec/uint16/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hu16vec4IterType = { (newfunc)vecIter_new<4, glm::u16>, /* tp_new */ }; -static PyGLMTypeObject hu16vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u16vec4", /* tp_name */ - sizeof(vec<4, glm::u16>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hu16vec4NumMethods, /* tp_as_number */ - & hu16vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::u16>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::u16>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::u16>, /* tp_setattro */ - & hu16vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u16vec4( )\n4 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::u16>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::u16>, /* tp_iter */ - 0, /* tp_iternext */ - hu16vec4_methods, /* tp_methods */ - hu16vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::u16>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(uint16), - sizeof(glm::vec<4, uint16>), +#define U16VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u16vec4", /* tp_name */ \ + sizeof(vec<4, glm::u16>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hu16vec4NumMethods, /* tp_as_number */ \ + & hu16vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::u16>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::u16>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::u16>, /* tp_setattro */ \ + & hu16vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u16vec4( )\n4 components vector of high qualifier 16 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::u16>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::u16>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu16vec4_methods, /* tp_methods */ \ + hu16vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::u16>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(uint16), \ + sizeof(glm::vec<4, uint16>), \ PyGLM_FS_UINT16 -}; - -static PyTypeObject& hu16vec4Type = *((PyTypeObject*)&hu16vec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint32/vec1.h b/PyGLM/types/vec/uint32/vec1.h index ad8bff7..a157aba 100644 --- a/PyGLM/types/vec/uint32/vec1.h +++ b/PyGLM/types/vec/uint32/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject huvec1IterType = { (newfunc)vecIter_new<1, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject huvec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.uvec1", /* tp_name */ - sizeof(vec<1, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & huvec1NumMethods, /* tp_as_number */ - & huvec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::u32>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::u32>, /* tp_setattro */ - & huvec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "uvec1( )\n1 component vector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - huvec1_methods, /* tp_methods */ - huvec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(uint32), - sizeof(glm::vec<1, uint32>), +#define UVEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.uvec1", /* tp_name */ \ + sizeof(vec<1, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & huvec1NumMethods, /* tp_as_number */ \ + & huvec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::u32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::u32>, /* tp_setattro */ \ + & huvec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "uvec1( )\n1 component vector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + huvec1_methods, /* tp_methods */ \ + huvec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<1, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& huvec1Type = *((PyTypeObject*)&huvec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint32/vec2.h b/PyGLM/types/vec/uint32/vec2.h index 5448913..319f48a 100644 --- a/PyGLM/types/vec/uint32/vec2.h +++ b/PyGLM/types/vec/uint32/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject huvec2IterType = { (newfunc)vecIter_new<2, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject huvec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.uvec2", /* tp_name */ - sizeof(vec<2, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & huvec2NumMethods, /* tp_as_number */ - & huvec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::u32>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::u32>, /* tp_setattro */ - & huvec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "uvec2( )\n2 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - huvec2_methods, /* tp_methods */ - huvec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(uint32), - sizeof(glm::vec<2, uint32>), +#define UVEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.uvec2", /* tp_name */ \ + sizeof(vec<2, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & huvec2NumMethods, /* tp_as_number */ \ + & huvec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::u32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::u32>, /* tp_setattro */ \ + & huvec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "uvec2( )\n2 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + huvec2_methods, /* tp_methods */ \ + huvec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<2, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& huvec2Type = *((PyTypeObject*)&huvec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint32/vec3.h b/PyGLM/types/vec/uint32/vec3.h index 93f4974..d96b466 100644 --- a/PyGLM/types/vec/uint32/vec3.h +++ b/PyGLM/types/vec/uint32/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject huvec3IterType = { (newfunc)vecIter_new<3, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject huvec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.uvec3", /* tp_name */ - sizeof(vec<3, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & huvec3NumMethods, /* tp_as_number */ - & huvec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::u32>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::u32>, /* tp_setattro */ - & huvec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "uvec3( )\n3 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - huvec3_methods, /* tp_methods */ - huvec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(uint32), - sizeof(glm::vec<3, uint32>), +#define UVEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.uvec3", /* tp_name */ \ + sizeof(vec<3, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & huvec3NumMethods, /* tp_as_number */ \ + & huvec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::u32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::u32>, /* tp_setattro */ \ + & huvec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "uvec3( )\n3 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + huvec3_methods, /* tp_methods */ \ + huvec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<3, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& huvec3Type = *((PyTypeObject*)&huvec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint32/vec4.h b/PyGLM/types/vec/uint32/vec4.h index dfec837..789446f 100644 --- a/PyGLM/types/vec/uint32/vec4.h +++ b/PyGLM/types/vec/uint32/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject huvec4IterType = { (newfunc)vecIter_new<4, glm::u32>, /* tp_new */ }; -static PyGLMTypeObject huvec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.uvec4", /* tp_name */ - sizeof(vec<4, glm::u32>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & huvec4NumMethods, /* tp_as_number */ - & huvec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::u32>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::u32>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::u32>, /* tp_setattro */ - & huvec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "uvec4( )\n4 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::u32>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::u32>, /* tp_iter */ - 0, /* tp_iternext */ - huvec4_methods, /* tp_methods */ - huvec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::u32>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(uint32), - sizeof(glm::vec<4, uint32>), +#define UVEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.uvec4", /* tp_name */ \ + sizeof(vec<4, glm::u32>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & huvec4NumMethods, /* tp_as_number */ \ + & huvec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::u32>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::u32>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::u32>, /* tp_setattro */ \ + & huvec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "uvec4( )\n4 components vector of high qualifier unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::u32>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::u32>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + huvec4_methods, /* tp_methods */ \ + huvec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::u32>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(uint32), \ + sizeof(glm::vec<4, uint32>), \ PyGLM_FS_UINT32 -}; - -static PyTypeObject& huvec4Type = *((PyTypeObject*)&huvec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint64/vec1.h b/PyGLM/types/vec/uint64/vec1.h index 6f0140a..a5958e6 100644 --- a/PyGLM/types/vec/uint64/vec1.h +++ b/PyGLM/types/vec/uint64/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hu64vec1IterType = { (newfunc)vecIter_new<1, glm::u64>, /* tp_new */ }; -static PyGLMTypeObject hu64vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u64vec1", /* tp_name */ - sizeof(vec<1, glm::u64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hu64vec1NumMethods, /* tp_as_number */ - & hu64vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::u64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::u64>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::u64>, /* tp_setattro */ - & hu64vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u64vec1( )\n1 component vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::u64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::u64>, /* tp_iter */ - 0, /* tp_iternext */ - hu64vec1_methods, /* tp_methods */ - hu64vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::u64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(uint64), - sizeof(glm::vec<1, uint64>), +#define U64VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u64vec1", /* tp_name */ \ + sizeof(vec<1, glm::u64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hu64vec1NumMethods, /* tp_as_number */ \ + & hu64vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::u64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::u64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::u64>, /* tp_setattro */ \ + & hu64vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u64vec1( )\n1 component vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::u64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::u64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu64vec1_methods, /* tp_methods */ \ + hu64vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::u64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(uint64), \ + sizeof(glm::vec<1, uint64>), \ PyGLM_FS_UINT64 -}; - -static PyTypeObject& hu64vec1Type = *((PyTypeObject*)&hu64vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint64/vec2.h b/PyGLM/types/vec/uint64/vec2.h index 564a2ed..abd9ca5 100644 --- a/PyGLM/types/vec/uint64/vec2.h +++ b/PyGLM/types/vec/uint64/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hu64vec2IterType = { (newfunc)vecIter_new<2, glm::u64>, /* tp_new */ }; -static PyGLMTypeObject hu64vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u64vec2", /* tp_name */ - sizeof(vec<2, glm::u64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hu64vec2NumMethods, /* tp_as_number */ - & hu64vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::u64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::u64>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::u64>, /* tp_setattro */ - & hu64vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u64vec2( )\n2 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::u64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::u64>, /* tp_iter */ - 0, /* tp_iternext */ - hu64vec2_methods, /* tp_methods */ - hu64vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::u64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(uint64), - sizeof(glm::vec<2, uint64>), +#define U64VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u64vec2", /* tp_name */ \ + sizeof(vec<2, glm::u64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hu64vec2NumMethods, /* tp_as_number */ \ + & hu64vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::u64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::u64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::u64>, /* tp_setattro */ \ + & hu64vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u64vec2( )\n2 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::u64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::u64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu64vec2_methods, /* tp_methods */ \ + hu64vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::u64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(uint64), \ + sizeof(glm::vec<2, uint64>), \ PyGLM_FS_UINT64 -}; - -static PyTypeObject& hu64vec2Type = *((PyTypeObject*)&hu64vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint64/vec3.h b/PyGLM/types/vec/uint64/vec3.h index ba8a0da..b42065c 100644 --- a/PyGLM/types/vec/uint64/vec3.h +++ b/PyGLM/types/vec/uint64/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hu64vec3IterType = { (newfunc)vecIter_new<3, glm::u64>, /* tp_new */ }; -static PyGLMTypeObject hu64vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u64vec3", /* tp_name */ - sizeof(vec<3, glm::u64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hu64vec3NumMethods, /* tp_as_number */ - & hu64vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::u64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::u64>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::u64>, /* tp_setattro */ - & hu64vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u64vec3( )\n3 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::u64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::u64>, /* tp_iter */ - 0, /* tp_iternext */ - hu64vec3_methods, /* tp_methods */ - hu64vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::u64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(uint64), - sizeof(glm::vec<3, uint64>), +#define U64VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u64vec3", /* tp_name */ \ + sizeof(vec<3, glm::u64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hu64vec3NumMethods, /* tp_as_number */ \ + & hu64vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::u64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::u64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::u64>, /* tp_setattro */ \ + & hu64vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u64vec3( )\n3 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::u64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::u64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu64vec3_methods, /* tp_methods */ \ + hu64vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::u64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(uint64), \ + sizeof(glm::vec<3, uint64>), \ PyGLM_FS_UINT64 -}; - -static PyTypeObject& hu64vec3Type = *((PyTypeObject*)&hu64vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint64/vec4.h b/PyGLM/types/vec/uint64/vec4.h index fd657d3..746768f 100644 --- a/PyGLM/types/vec/uint64/vec4.h +++ b/PyGLM/types/vec/uint64/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hu64vec4IterType = { (newfunc)vecIter_new<4, glm::u64>, /* tp_new */ }; -static PyGLMTypeObject hu64vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u64vec4", /* tp_name */ - sizeof(vec<4, glm::u64>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hu64vec4NumMethods, /* tp_as_number */ - & hu64vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::u64>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::u64>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::u64>, /* tp_setattro */ - & hu64vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u64vec4( )\n4 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::u64>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::u64>, /* tp_iter */ - 0, /* tp_iternext */ - hu64vec4_methods, /* tp_methods */ - hu64vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::u64>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(uint64), - sizeof(glm::vec<4, uint64>), +#define U64VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u64vec4", /* tp_name */ \ + sizeof(vec<4, glm::u64>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hu64vec4NumMethods, /* tp_as_number */ \ + & hu64vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::u64>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::u64>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::u64>, /* tp_setattro */ \ + & hu64vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u64vec4( )\n4 components vector of high qualifier 64 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::u64>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::u64>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu64vec4_methods, /* tp_methods */ \ + hu64vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::u64>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(uint64), \ + sizeof(glm::vec<4, uint64>), \ PyGLM_FS_UINT64 -}; - -static PyTypeObject& hu64vec4Type = *((PyTypeObject*)&hu64vec4GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint8/vec1.h b/PyGLM/types/vec/uint8/vec1.h index cbe53bb..9e4d1a3 100644 --- a/PyGLM/types/vec/uint8/vec1.h +++ b/PyGLM/types/vec/uint8/vec1.h @@ -114,54 +114,50 @@ static PyTypeObject hu8vec1IterType = { (newfunc)vecIter_new<1, glm::u8>, /* tp_new */ }; -static PyGLMTypeObject hu8vec1GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u8vec1", /* tp_name */ - sizeof(vec<1, glm::u8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec1_repr, /* tp_repr */ - & hu8vec1NumMethods, /* tp_as_number */ - & hu8vec1SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<1, glm::u8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec1_str, /* tp_str */ - (getattrofunc)vec_getattr<1, glm::u8>, /* tp_getattro */ - (setattrofunc)vec_setattr<1, glm::u8>, /* tp_setattro */ - & hu8vec1BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u8vec1( )\n1 component vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<1, glm::u8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<1, glm::u8>, /* tp_iter */ - 0, /* tp_iternext */ - hu8vec1_methods, /* tp_methods */ - hu8vec1_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec1_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<1, glm::u8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 1, - 0, - sizeof(uint8), - sizeof(glm::vec<1, uint8>), +#define U8VEC1_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u8vec1", /* tp_name */ \ + sizeof(vec<1, glm::u8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec1_repr, /* tp_repr */ \ + & hu8vec1NumMethods, /* tp_as_number */ \ + & hu8vec1SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<1, glm::u8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec1_str, /* tp_str */ \ + (getattrofunc)vec_getattr<1, glm::u8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<1, glm::u8>, /* tp_setattro */ \ + & hu8vec1BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u8vec1( )\n1 component vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<1, glm::u8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<1, glm::u8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu8vec1_methods, /* tp_methods */ \ + hu8vec1_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec1_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<1, glm::u8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 1, \ + 0, \ + sizeof(uint8), \ + sizeof(glm::vec<1, uint8>), \ PyGLM_FS_UINT8 -}; - -static PyTypeObject& hu8vec1Type = *((PyTypeObject*)&hu8vec1GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint8/vec2.h b/PyGLM/types/vec/uint8/vec2.h index 5d3dd15..c039955 100644 --- a/PyGLM/types/vec/uint8/vec2.h +++ b/PyGLM/types/vec/uint8/vec2.h @@ -115,54 +115,50 @@ static PyTypeObject hu8vec2IterType = { (newfunc)vecIter_new<2, glm::u8>, /* tp_new */ }; -static PyGLMTypeObject hu8vec2GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u8vec2", /* tp_name */ - sizeof(vec<2, glm::u8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec2_repr, /* tp_repr */ - & hu8vec2NumMethods, /* tp_as_number */ - & hu8vec2SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<2, glm::u8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec2_str, /* tp_str */ - (getattrofunc)vec_getattr<2, glm::u8>, /* tp_getattro */ - (setattrofunc)vec_setattr<2, glm::u8>, /* tp_setattro */ - & hu8vec2BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u8vec2( )\n2 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<2, glm::u8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<2, glm::u8>, /* tp_iter */ - 0, /* tp_iternext */ - hu8vec2_methods, /* tp_methods */ - hu8vec2_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec2_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<2, glm::u8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 2, - 0, - sizeof(uint8), - sizeof(glm::vec<2, uint8>), +#define U8VEC2_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u8vec2", /* tp_name */ \ + sizeof(vec<2, glm::u8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec2_repr, /* tp_repr */ \ + & hu8vec2NumMethods, /* tp_as_number */ \ + & hu8vec2SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<2, glm::u8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec2_str, /* tp_str */ \ + (getattrofunc)vec_getattr<2, glm::u8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<2, glm::u8>, /* tp_setattro */ \ + & hu8vec2BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u8vec2( )\n2 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<2, glm::u8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<2, glm::u8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu8vec2_methods, /* tp_methods */ \ + hu8vec2_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec2_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<2, glm::u8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 2, \ + 0, \ + sizeof(uint8), \ + sizeof(glm::vec<2, uint8>), \ PyGLM_FS_UINT8 -}; - -static PyTypeObject& hu8vec2Type = *((PyTypeObject*)&hu8vec2GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint8/vec3.h b/PyGLM/types/vec/uint8/vec3.h index 90b1eb9..436aaa3 100644 --- a/PyGLM/types/vec/uint8/vec3.h +++ b/PyGLM/types/vec/uint8/vec3.h @@ -116,54 +116,50 @@ static PyTypeObject hu8vec3IterType = { (newfunc)vecIter_new<3, glm::u8>, /* tp_new */ }; -static PyGLMTypeObject hu8vec3GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u8vec3", /* tp_name */ - sizeof(vec<3, glm::u8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec3_repr, /* tp_repr */ - & hu8vec3NumMethods, /* tp_as_number */ - & hu8vec3SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<3, glm::u8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec3_str, /* tp_str */ - (getattrofunc)vec_getattr<3, glm::u8>, /* tp_getattro */ - (setattrofunc)vec_setattr<3, glm::u8>, /* tp_setattro */ - & hu8vec3BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u8vec3( )\n3 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<3, glm::u8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<3, glm::u8>, /* tp_iter */ - 0, /* tp_iternext */ - hu8vec3_methods, /* tp_methods */ - hu8vec3_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec3_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<3, glm::u8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 3, - 0, - sizeof(uint8), - sizeof(glm::vec<3, uint8>), +#define U8VEC3_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u8vec3", /* tp_name */ \ + sizeof(vec<3, glm::u8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec3_repr, /* tp_repr */ \ + & hu8vec3NumMethods, /* tp_as_number */ \ + & hu8vec3SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<3, glm::u8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec3_str, /* tp_str */ \ + (getattrofunc)vec_getattr<3, glm::u8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<3, glm::u8>, /* tp_setattro */ \ + & hu8vec3BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u8vec3( )\n3 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<3, glm::u8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<3, glm::u8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu8vec3_methods, /* tp_methods */ \ + hu8vec3_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec3_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<3, glm::u8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 3, \ + 0, \ + sizeof(uint8), \ + sizeof(glm::vec<3, uint8>), \ PyGLM_FS_UINT8 -}; - -static PyTypeObject& hu8vec3Type = *((PyTypeObject*)&hu8vec3GLMType); \ No newline at end of file diff --git a/PyGLM/types/vec/uint8/vec4.h b/PyGLM/types/vec/uint8/vec4.h index 0375498..cd474b2 100644 --- a/PyGLM/types/vec/uint8/vec4.h +++ b/PyGLM/types/vec/uint8/vec4.h @@ -117,54 +117,50 @@ static PyTypeObject hu8vec4IterType = { (newfunc)vecIter_new<4, glm::u8>, /* tp_new */ }; -static PyGLMTypeObject hu8vec4GLMType = { - { - PyObject_HEAD_INIT(NULL) - "glm.u8vec4", /* tp_name */ - sizeof(vec<4, glm::u8>), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)vec_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc)vec4_repr, /* tp_repr */ - & hu8vec4NumMethods, /* tp_as_number */ - & hu8vec4SeqMethods, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)vec_hash<4, glm::u8>, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)vec4_str, /* tp_str */ - (getattrofunc)vec_getattr<4, glm::u8>, /* tp_getattro */ - (setattrofunc)vec_setattr<4, glm::u8>, /* tp_setattro */ - & hu8vec4BufferMethods, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE, /* tp_flags */ - "u8vec4( )\n4 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)vec_richcompare<4, glm::u8>, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)vec_geniter<4, glm::u8>, /* tp_iter */ - 0, /* tp_iternext */ - hu8vec4_methods, /* tp_methods */ - hu8vec4_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)vec4_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)vec_new<4, glm::u8>, /* tp_new */ - }, - PyGLM_TYPE_VEC, - 4, - 0, - sizeof(uint8), - sizeof(glm::vec<4, uint8>), +#define U8VEC4_GLM_TYPEOBJECT { \ + PyObject_HEAD_INIT(NULL) \ + "glm.u8vec4", /* tp_name */ \ + sizeof(vec<4, glm::u8>), /* tp_basicsize */ \ + 0, /* tp_itemsize */ \ + (destructor)vec_dealloc, /* tp_dealloc */ \ + 0, /* tp_print */ \ + 0, /* tp_getattr */ \ + 0, /* tp_setattr */ \ + 0, /* tp_reserved */ \ + (reprfunc)vec4_repr, /* tp_repr */ \ + & hu8vec4NumMethods, /* tp_as_number */ \ + & hu8vec4SeqMethods, /* tp_as_sequence */ \ + 0, /* tp_as_mapping */ \ + (hashfunc)vec_hash<4, glm::u8>, /* tp_hash */ \ + 0, /* tp_call */ \ + (reprfunc)vec4_str, /* tp_str */ \ + (getattrofunc)vec_getattr<4, glm::u8>, /* tp_getattro */ \ + (setattrofunc)vec_setattr<4, glm::u8>, /* tp_setattro */ \ + & hu8vec4BufferMethods, /* tp_as_buffer */ \ + Py_TPFLAGS_DEFAULT | \ + Py_TPFLAGS_BASETYPE, /* tp_flags */ \ + "u8vec4( )\n4 components vector of high qualifier 8 bit unsigned integer numbers.", /* tp_doc */ \ + 0, /* tp_traverse */ \ + 0, /* tp_clear */ \ + (richcmpfunc)vec_richcompare<4, glm::u8>, /* tp_richcompare */ \ + 0, /* tp_weaklistoffset */ \ + (getiterfunc)vec_geniter<4, glm::u8>, /* tp_iter */ \ + 0, /* tp_iternext */ \ + hu8vec4_methods, /* tp_methods */ \ + hu8vec4_members, /* tp_members */ \ + 0, /* tp_getset */ \ + 0, /* tp_base */ \ + 0, /* tp_dict */ \ + 0, /* tp_descr_get */ \ + 0, /* tp_descr_set */ \ + 0, /* tp_dictoffset */ \ + (initproc)vec4_init, /* tp_init */ \ + 0, /* tp_alloc */ \ + (newfunc)vec_new<4, glm::u8>, /* tp_new */ \ + }, \ + PyGLM_TYPE_VEC, \ + 4, \ + 0, \ + sizeof(uint8), \ + sizeof(glm::vec<4, uint8>), \ PyGLM_FS_UINT8 -}; - -static PyTypeObject& hu8vec4Type = *((PyTypeObject*)&hu8vec4GLMType); \ No newline at end of file diff --git a/test/PyGLM_test.py b/test/PyGLM_test.py index 1d4b403..0b6f502 100644 --- a/test/PyGLM_test.py +++ b/test/PyGLM_test.py @@ -1,4 +1,4 @@ -import glm, sys, random, time, copy, re, math, ctypes +import glm, sys, random, time, copy, re, math from collections import OrderedDict @@ -701,7 +701,7 @@ def test_pos(): # abs # def test_abs(): - for obj in gen_obj("#MV__fFiqsuIQSU"): + for obj in gen_obj("#MV_M__fFiqsuIQSU"): fassert(obj.__abs__, ()) assert (abs(glm.array(obj)))[0] == abs(obj), obj #/abs # @@ -780,36 +780,6 @@ def test_div(): pass #/div # -# floordiv # -def test_int_floordiv(): - for obj in gen_obj("#MV__iqsuIQSU"): - fassert(obj.__floordiv__, (1,)) - fassert(obj.__floordiv__, (obj * 0 + 1,)) - - for obj in gen_obj("V__iqsuIQSU"): - fassert(obj.__floordiv__, (type(obj)(1),)) - - for obj in gen_obj("V__iqsuIQSU"): - try: - obj.__floordiv__(type(obj)(0)) - fail(obj) - except ZeroDivisionError: - pass - for obj in gen_obj("P__iI"): - try: - obj.__floordiv__(obj) - fail(obj) - except ZeroDivisionError: - pass - - for obj in gen_obj("#MV__iqsuIQSU"): - try: - obj.__floordiv__(0) - fail(obj) - except ZeroDivisionError: - pass -#/floordiv # - # mod # def test_mod(): for obj in gen_obj("#MV__fF"): @@ -849,21 +819,21 @@ def test_rshift(): # and # def test_and(): - for obj in gen_obj("#MV__iqsuIQSUB"): + for obj in gen_obj("#MV__iqsuIQSU"): fassert(obj.__and__, (1,)) fassert(obj.__and__, (obj,)) #/and # # or # def test_or(): - for obj in gen_obj("#MV__iqsuIQSUB"): + for obj in gen_obj("#MV__iqsuIQSU"): fassert(obj.__or__, (1,)) fassert(obj.__or__, (obj,)) #/or # # xor # def test_xor(): - for obj in gen_obj("#MV__iqsuIQSUB"): + for obj in gen_obj("#MV__iqsuIQSU"): fassert(obj.__xor__, (1,)) fassert(obj.__xor__, (obj,)) #/xor # @@ -928,7 +898,7 @@ def test_imod(): # ifloordiv # def test_ifloordiv(): - for obj in gen_obj("#MV__fFiqsuIQSU"): + for obj in gen_obj("#MV__fF"): fassert(obj.__ifloordiv__, (1,)) #/ifloordiv # @@ -1085,8 +1055,8 @@ def test_hash(): def check_buffer_protocol(type_, shape, format): obj = type_() memview = memoryview(obj) - assert shape == memview.shape - assert format == memview.format + assert shape == memview.shape, type_ + assert format == memview.format, type_ def test_buffer_protocol(): for t, s, f in ( @@ -1197,24 +1167,6 @@ def test_buffer_protocol(): arr = glm.array(glm.mat4(), glm.mat4(2)) mv = memoryview(arr) assert glm.array(mv) == arr, arr - - for T in (ctypes.c_float, - ctypes.c_double, - ctypes.c_char, - ctypes.c_byte, - ctypes.c_ubyte, - ctypes.c_short, - ctypes.c_ushort, - ctypes.c_int, - ctypes.c_uint, - ctypes.c_long, - ctypes.c_ulong, - ctypes.c_longlong, - ctypes.c_ulonglong, - ctypes.c_size_t, - ctypes.c_ssize_t, - ctypes.c_void_p): - assert glm.vec1((T*1)()) == glm.vec1() #/buffer protocol # # lists and tuples # @@ -2604,8 +2556,8 @@ def test_spec_common_floor(): assert all([a == math.floor(x) for a in glm.floor(vecT(x))]) def test_spec_common_fma(): - assert glm.fma(1, 2, 3) == 1 * 2 + 3 - assert glm.fma(4, 5, 6) == 4 * 5 + 6 + assert glm.fma(1., 2., 3.) == 1 * 2 + 3 + assert glm.fma(4., 5., 6.) == 4 * 5 + 6 def test_spec_common_fmax(): for a in range(-2, 2): @@ -2701,12 +2653,13 @@ def test_spec_common_mix(): assert glm.mix(a, b, False) == a for vecT in vector_type_dict[datatypes.index("float")] + vector_type_dict[datatypes.index("double")]: - assert glm.mix(vecT(a), vecT(b), [0.] * len(vecT(a))) == vecT(a) - assert glm.mix(vecT(a), vecT(b), [1.] * len(vecT(a))) == vecT(b) - assert glm.mix(vecT(a), vecT(b), [0.5] * len(vecT(a))) == vecT((a + b) / 2) + assert glm.mix(vecT(a), vecT(b), vecT(0.)) == vecT(a) + assert glm.mix(vecT(a), vecT(b), vecT(1.)) == vecT(b) + assert glm.mix(vecT(a), vecT(b), vecT(0.5)) == vecT((a + b) / 2) - assert glm.mix(vecT(a), vecT(b), [True] * len(vecT(a))) == vecT(b) - assert glm.mix(vecT(a), vecT(b), [False] * len(vecT(a))) == vecT(a) + bvecT = getattr(glm, f"bvec{len(vecT(a))}") + assert glm.mix(vecT(a), vecT(b), bvecT(True)) == vecT(b) + assert glm.mix(vecT(a), vecT(b), bvecT(False)) == vecT(a) def test_spec_common_round(): for i in range(-10, 10): @@ -3114,7 +3067,7 @@ def test_normalize(): glm.all(glm.lessThan(glm.abs(Normalize1 - glm.vec3(1, 0, 0)), glm.vec3(0.0001))) glm.all(glm.lessThan(glm.abs(Normalize2 - glm.vec3(1, 0, 0)), glm.vec3(0.0001))) - glm.all(glm.lessThan(glm.abs(Normalize3 - glm.normalize((-1.2,1.4,-1))), glm.vec3(0.0001))) + glm.all(glm.lessThan(glm.abs(Normalize3 - glm.normalize(glm.vec3(-1.2,1.4,-1))), glm.vec3(0.0001))) def test_faceforward(): N = glm.vec3(0.0, 0.0, 1.0) @@ -3122,7 +3075,7 @@ def test_faceforward(): Nref = glm.vec3(0.0, 0.0, 1.0) F = glm.faceforward(N, I, Nref) - assert glm.equal(F, (0,0,-1), 0.0001) + assert glm.equal(F, glm.vec3(0,0,-1), 0.0001) def test_reflect(): A = glm.vec2(1.0,-1.0) @@ -3454,9 +3407,9 @@ def test_matrixCompMult(): assert n == T(((0, 1, 4, 9), (16, 25, 36, 49), (64, 81, 100, 121), (144, 169, 196, 225))) def test_outerProduct(): - for c in (range(2), range(3), range(4)): - for r in (range(4,6), range(4,7), range(4,8)): - result = glm.outerProduct(tuple(c), tuple(r)) + for c in (glm.vec2(*range(2)), glm.vec3(*range(3)), glm.vec4(*range(4))): + for r in (glm.vec2(*range(4,6)), glm.vec3(*range(4,7)), glm.vec4(*range(4,8))): + result = glm.outerProduct(c, r) l = [e for l in result for e in l] for i in range(len(l)): assert l[i] == (c[i % len(c)]) * (r[i // len(c)]), (l, c, r, i) @@ -3624,55 +3577,9 @@ def test_equal(): assert glm.all(glm.equal(T(0), T(0))) assert not glm.any(glm.notEqual(T(0), T(0))) ##/core_func_vector_relational ## - -## core_type_mat2x2 ## -def test_mat2x2(): - l = glm.mat2x2(1) - m = glm.mat2x2(1) - u = glm.vec2(1) - v = glm.vec2(1) - x = 1 - a = m * u - b = v * m - n = x / m - o = m / x - p = x * m - q = m * x - assert not glm.any(glm.notEqual(m, q, 0.00001)) - assert glm.all(glm.equal(m, l, 0.00001)); -##/core_type_mat2x2 ## ###/GLM TESTS ### -def test_array_matmul(): - hitbox = glm.array( - glm.vec2(0., 1.), - glm.vec2(1., 1.), - glm.vec2(1., 0.), - glm.vec2(0., 0.), - ) - rotation = glm.radians(90) - scale_x = 1. - scale_y = 2. - - cos_rotation = glm.cos(rotation) - sin_rotation = glm.sin(rotation) - - rotation_scale_matrix = glm.mat2x2( - scale_x * cos_rotation, -scale_y * sin_rotation, - scale_x * sin_rotation, scale_y * cos_rotation - ) - hitbox_rotated = hitbox * rotation_scale_matrix - - # I expect to see the points rotated 90 degrees, approximately: - # array(vec2(-2, 0), vec2(-2, 1), vec2(0, 1), vec2(0, 0)) - assert glm.equal(hitbox_rotated[0].x, -2, 0.00001) - assert glm.equal(hitbox_rotated[0].y, 0, 0.00001) - assert glm.equal(hitbox_rotated[1].x, -2, 0.00001) - assert glm.equal(hitbox_rotated[1].y, 1, 0.00001) - assert glm.equal(hitbox_rotated[2].x, 0, 0.00001) - assert glm.equal(hitbox_rotated[2].y, 1, 0.00001) - assert glm.equal(hitbox_rotated[3].x, 0, 0.00001) - assert glm.equal(hitbox_rotated[3].y, 0, 0.00001) + ### TEST TEST ### @@ -3690,4 +3597,4 @@ def test_everything_tested(): if (raw.startswith("__") and raw.endswith("__") or not isinstance(func, builtin_function_or_method)): continue if not raw in content and not any((re.fullmatch(ex, raw) for ex in excluded)): - print("{} has no test.".format(raw)) \ No newline at end of file + print("{} has no test.".format(raw)) diff --git a/wiki/function-reference/detail/func_common.md b/wiki/function-reference/detail/func_common.md index b300a68..82418b9 100644 --- a/wiki/function-reference/detail/func_common.md +++ b/wiki/function-reference/detail/func_common.md @@ -265,6 +265,10 @@ It contains common GLSL functions\. #### glm.**mix**(**x**: *number*, **y**: *number*, **a**: *bool*) -\> *number*   Returns ``` y ``` if ``` a ``` is ``` True ``` and ``` x ``` otherwise\. +#### glm.**mix**(**x**: *vecN*, **y**: *vecN*, **a**: *float*) -\> *vecN* +  Returns ``` x * (1.0 - a) + y * a ```, i\.e\., the linear blend of ``` x ``` and ``` y ``` using the floating\-point +  value ``` a ```\. The value for ``` a ``` is not restricted to the range ``` [0, 1] ```\. + #### glm.**mix**(**x**: *vecN*, **y**: *vecN*, **a**: *fvecN*) -\> *vecN*   Returns ``` x * (1.0 - a) + y * a ```, i\.e\., the linear blend of ``` x ``` and ``` y ``` using the floating\-point   value ``` a ```\. The value for ``` a ``` is not restricted to the range ``` [0, 1] ```\. diff --git a/wiki/function-reference/detail/func_common.sb b/wiki/function-reference/detail/func_common.sb index 351a8d3..9005361 100644 --- a/wiki/function-reference/detail/func_common.sb +++ b/wiki/function-reference/detail/func_common.sb @@ -263,6 +263,10 @@ It contains common GLSL functions. \raw\#### glm.**mix**(**x**: *number*, **y**: *number*, **a**: *bool*) -\\> *number*\raw\ \raw\  \raw\Returns \code\y\code\ if \code\a\code\ is \code\True\code\ and \code\x\code\ otherwise. +\raw\#### glm.**mix**(**x**: *vecN*, **y**: *vecN*, **a**: *float*) -\\> *vecN*\raw\ +\raw\  \raw\Returns \code\x * (1.0 - a) + y * a\code\, i.e., the linear blend of \code\x\code\ and \code\y\code\ using the floating-point +\raw\  \raw\value \code\a\code\. The value for \code\a\code\ is not restricted to the range \code\[0, 1]\code\. + \raw\#### glm.**mix**(**x**: *vecN*, **y**: *vecN*, **a**: *fvecN*) -\\> *vecN*\raw\ \raw\  \raw\Returns \code\x * (1.0 - a) + y * a\code\, i.e., the linear blend of \code\x\code\ and \code\y\code\ using the floating-point \raw\  \raw\value \code\a\code\. The value for \code\a\code\ is not restricted to the range \code\[0, 1]\code\.