Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-08-18 13:53:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-08-18 15:37:48 +0300
commit7b78532950f69f82058d462e786e77128744c589 (patch)
treee187f50442bf8b4e0387e563e38820b7f242681f /source/blender/freestyle
parent26f4f7edcab2896c8afec30d0431044b237c8ed6 (diff)
Freestyle: fix wrong arg order, and cleanup confusing loop (both reported by coverity).
Error: `origin` and `edge` args were swapped in final `FindOccludee()` call of `ViewMapBuilder::ComputeRayCastingVisibility()` Cleanup: main for loop in `Strip::createStrip()` was really confusing (though correct), generated a false positive in coverity scan, now should be cleaner how it loops over its vprev/v/v2 triplet of consecutive items.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.cpp14
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp2
2 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
index ab06e207331..028127897ff 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
@@ -135,11 +135,11 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
int orientationErrors = 0;
//special case of first vertex
- v = iStrokeVertices.begin();
+ v2 = v = iStrokeVertices.begin();
+ ++v2;
sv = *v;
vPrev = v; //in case the stroke has only 2 vertices;
- ++v;
- sv2 = *v;
+ sv2 = *v2;
Vec2r dir(sv2->getPoint() - sv->getPoint());
Vec2r orthDir(-dir[1], dir[0]);
if (orthDir.norm() > ZERO)
@@ -189,11 +189,7 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
int i = 2; // 2 because we have already processed the first vertex
- for (vend = iStrokeVertices.end(); v != vend; ++v) {
- v2 = v;
- ++v2;
- if (v2 == vend)
- break;
+ for (vend = iStrokeVertices.end(), ++v, ++v2; v2 != vend; vPrev = v++, ++v2) {
sv = (*v);
sv2 = (*v2);
svPrev = (*vPrev);
@@ -289,8 +285,6 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
{
_vertices[i - 1]->setPoint2d(p - thickness[0] * stripDir);
}
-
- vPrev = v;
} // end of for
//special case of last vertex
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index 77beb1d97d9..380bb0dd3ca 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -2099,7 +2099,7 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
}
// Find occludee
- FindOccludee(fe, iGrid, epsilon, oaPolygon, timestamp, u, center, edge, origin, faceVertices);
+ FindOccludee(fe, iGrid, epsilon, oaPolygon, timestamp, u, center, origin, edge, faceVertices);
return qi;
}