diff options
Diffstat (limited to 'source/blender/freestyle/intern/view_map/BoxGrid.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/BoxGrid.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.cpp b/source/blender/freestyle/intern/view_map/BoxGrid.cpp index c8a6f0a0a3e..4464aab6419 100644 --- a/source/blender/freestyle/intern/view_map/BoxGrid.cpp +++ b/source/blender/freestyle/intern/view_map/BoxGrid.cpp @@ -10,6 +10,8 @@ #include "BoxGrid.h" +#include "BLI_sys_types.h" + #include "BKE_global.h" using namespace std; @@ -127,7 +129,7 @@ void BoxGrid::assignCells(OccluderSource & /*source*/, ++f) { if ((*f)->isInImage()) { Vec3r point = transform((*f)->center3d()); - unsigned int i, j; + uint i, j; getCellCoordinates(point, i, j); if (_cells[i * _cellsY + j] == nullptr) { // This is an uninitialized cell @@ -149,8 +151,8 @@ void BoxGrid::assignCells(OccluderSource & /*source*/, void BoxGrid::distributePolygons(OccluderSource &source) { - unsigned long nFaces = 0; - unsigned long nKeptFaces = 0; + ulong nFaces = 0; + ulong nKeptFaces = 0; for (source.begin(); source.isValid(); source.next()) { OccluderData *occluder = nullptr; @@ -186,15 +188,15 @@ void BoxGrid::reorganizeCells() } } -void BoxGrid::getCellCoordinates(const Vec3r &point, unsigned &x, unsigned &y) +void BoxGrid::getCellCoordinates(const Vec3r &point, uint &x, uint &y) { - x = min(_cellsX - 1, (unsigned)floor(max((double)0.0f, point[0] - _cellOrigin[0]) / _cellSize)); - y = min(_cellsY - 1, (unsigned)floor(max((double)0.0f, point[1] - _cellOrigin[1]) / _cellSize)); + x = min(_cellsX - 1, uint(floor(max(double(0.0f), point[0] - _cellOrigin[0]) / _cellSize))); + y = min(_cellsY - 1, uint(floor(max(double(0.0f), point[1] - _cellOrigin[1]) / _cellSize))); } BoxGrid::Cell *BoxGrid::findCell(const Vec3r &point) { - unsigned int x, y; + uint x, y; getCellCoordinates(point, x, y); return _cells[x * _cellsY + y]; } |