diff options
Diffstat (limited to 'source/blender/freestyle/intern/geometry')
-rw-r--r-- | source/blender/freestyle/intern/geometry/FastGrid.cpp | 21 | ||||
-rw-r--r-- | source/blender/freestyle/intern/geometry/FastGrid.h | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/geometry/Grid.cpp | 5 |
3 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/freestyle/intern/geometry/FastGrid.cpp b/source/blender/freestyle/intern/geometry/FastGrid.cpp index 438cac3c209..ddfc8bdd20c 100644 --- a/source/blender/freestyle/intern/geometry/FastGrid.cpp +++ b/source/blender/freestyle/intern/geometry/FastGrid.cpp @@ -28,6 +28,7 @@ #include "FastGrid.h" #include "BKE_global.h" +#include "BLI_utildefines.h" namespace Freestyle { @@ -63,21 +64,21 @@ Cell *FastGrid::getCell(const Vec3u& p) << " " << _cells_size << endl; } #endif - assert(_cells || ("_cells is a null pointer")); - assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); - assert(p[0] < _cells_nb[0]); - assert(p[1] < _cells_nb[1]); - assert(p[2] < _cells_nb[2]); + BLI_assert(_cells || ("_cells is a null pointer")); + BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); + BLI_assert(p[0] < _cells_nb[0]); + BLI_assert(p[1] < _cells_nb[1]); + BLI_assert(p[2] < _cells_nb[2]); return _cells[_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]]; } void FastGrid::fillCell(const Vec3u& p, Cell& cell) { - assert(_cells || ("_cells is a null pointer")); - assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); - assert(p[0] < _cells_nb[0]); - assert(p[1] < _cells_nb[1]); - assert(p[2] < _cells_nb[2]); + BLI_assert(_cells || ("_cells is a null pointer")); + BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); + BLI_assert(p[0] < _cells_nb[0]); + BLI_assert(p[1] < _cells_nb[1]); + BLI_assert(p[2] < _cells_nb[2]); _cells[_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]] = &cell; } diff --git a/source/blender/freestyle/intern/geometry/FastGrid.h b/source/blender/freestyle/intern/geometry/FastGrid.h index e292589b7cf..0982c1a7d7c 100644 --- a/source/blender/freestyle/intern/geometry/FastGrid.h +++ b/source/blender/freestyle/intern/geometry/FastGrid.h @@ -28,8 +28,6 @@ * \date 30/07/2002 */ -#include <cassert> - #include "Grid.h" namespace Freestyle { diff --git a/source/blender/freestyle/intern/geometry/Grid.cpp b/source/blender/freestyle/intern/geometry/Grid.cpp index 49e115b4333..371c63318de 100644 --- a/source/blender/freestyle/intern/geometry/Grid.cpp +++ b/source/blender/freestyle/intern/geometry/Grid.cpp @@ -25,12 +25,13 @@ * \date 30/07/2002 */ -#include <cassert> #include <stdexcept> #include "BBox.h" #include "Grid.h" +#include "BLI_utildefines.h" + namespace Freestyle { // Grid Visitors @@ -366,7 +367,7 @@ bool Grid::initInfiniteRay (const Vec3r &orig, const Vec3r& dir, unsigned timest // is the ray intersecting the box? real tmin(-1.0), tmax(-1.0); if (GeomUtils::intersectRayBBox(orig, _ray_dir, boxMin, boxMax, 0, _t_end, tmin, tmax)) { - assert(tmin != -1.0); + BLI_assert(tmin != -1.0); Vec3r newOrig = orig + tmin * _ray_dir; for (unsigned int i = 0; i < 3; i++) { _current_cell[i] = (unsigned)floor((newOrig[i] - _orig[i]) / _cell_size[i]); |