diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-14 04:30:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-14 04:30:56 +0400 |
commit | 157656593206647499d0dedb66b2a483a5900a3b (patch) | |
tree | ab16bdcff9493a53e94491ad6630bc60811040a3 /source/blender/python | |
parent | b1179c4752395b5b3247e5a22587f4b65e45d72d (diff) |
minor changes needed for building standalone mathutils.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/mathutils/mathutils.c | 2 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Vector.c | 8 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_geometry.c | 14 |
3 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index 90e9565f05f..8f94fc8b467 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -510,10 +510,12 @@ PyMODINIT_FUNC PyInit_mathutils(void) PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule); Py_INCREF(submodule); +#ifndef MATH_STANDALONE /* Noise submodule */ PyModule_AddObject(mod, "noise", (submodule = PyInit_mathutils_noise())); PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule); Py_INCREF(submodule); +#endif mathutils_matrix_row_cb_index = Mathutils_RegisterCallback(&mathutils_matrix_row_cb); mathutils_matrix_col_cb_index = Mathutils_RegisterCallback(&mathutils_matrix_col_cb); diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 19ffc7f06ef..8a5a8446ac6 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -1286,7 +1286,7 @@ static PyObject *vector_item_internal(VectorObject *self, int i, const int is_at static PyObject *Vector_item(VectorObject *self, int i) { - return vector_item_internal(self, i, FALSE); + return vector_item_internal(self, i, false); } /* sequence accessor (set): vector[index] = value */ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr) @@ -1323,7 +1323,7 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, static int Vector_ass_item(VectorObject *self, int i, PyObject *value) { - return vector_ass_item_internal(self, i, value, FALSE); + return vector_ass_item_internal(self, i, value, false); } /* sequence slice (get): vector[a:b] */ @@ -2086,12 +2086,12 @@ PyDoc_STRVAR(Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: floa static PyObject *Vector_axis_get(VectorObject *self, void *type) { - return vector_item_internal(self, GET_INT_FROM_POINTER(type), TRUE); + return vector_item_internal(self, GET_INT_FROM_POINTER(type), true); } static int Vector_axis_set(VectorObject *self, PyObject *value, void *type) { - return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, TRUE); + return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, true); } /* vector.length */ diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 6052d5cb992..8b5b74c480a 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -690,7 +690,7 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje { VectorObject *line_a, *line_b, *sphere_co; float sphere_radius; - int clip = TRUE; + int clip = true; float isect_a[3]; float isect_b[3]; @@ -726,12 +726,12 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje switch (isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) { case 1: - if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE; + if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = false; use_b = false; break; case 2: - if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE; - if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE; + if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = false; + if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = false; break; default: use_a = false; @@ -771,7 +771,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO { VectorObject *line_a, *line_b, *sphere_co; float sphere_radius; - int clip = TRUE; + int clip = true; float isect_a[2]; float isect_b[2]; @@ -801,7 +801,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO switch (isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) { case 1: if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = false; - use_b = FALSE; + use_b = false; break; case 2: if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = false; @@ -1155,7 +1155,7 @@ static PyObject *M_Geometry_points_in_planes(PyObject *UNUSED(self), PyObject *a PyList_Append(py_verts, item); Py_DECREF(item); - planes_used[i] = planes_used[j] = planes_used[k] = TRUE; + planes_used[i] = planes_used[j] = planes_used[k] = true; } } } |