diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-11 10:56:51 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-11 10:56:51 +0400 |
commit | 2d801f2bec3c4de663f33b0f0f198a12f09ef989 (patch) | |
tree | dfe16a3ca2213bd5b6579ed3bc2ac2902b678067 /source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp | |
parent | 4a92d82626980d6d1690113b9d27aae282fd48eb (diff) |
Another big code clean-up patch from Bastien Montagne, thanks again!
Diffstat (limited to 'source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp')
-rw-r--r-- | source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp index a083c6b2f1b..7aa66841859 100644 --- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp +++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp @@ -79,7 +79,7 @@ static void convert(ImBuf *imBuf, float **oArray, unsigned &oSize) char *pix; for (unsigned int i = 0; i < oSize; ++i) { - pix = (char*) imBuf->rect + i * 4; + pix = (char *) imBuf->rect + i * 4; (*oArray)[i] = ((float) pix[2]) / 255.0f; } } @@ -146,7 +146,7 @@ int IncreasingThicknessShader::shade(Stroke& stroke) const int ConstrainedIncreasingThicknessShader::shade(Stroke& stroke) const { float slength = stroke.getLength2D(); - float maxT = min(_ratio*slength,_ThicknessMax); + float maxT = min(_ratio * slength, _ThicknessMax); int n = stroke.strokeVerticesSize() - 1, i; StrokeInternal::StrokeVertexIterator v, vend; for (i = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); @@ -233,7 +233,7 @@ int ThicknessVariationPatternShader::shade(Stroke& stroke) const int vert_size = stroke.strokeVerticesSize(); int sig = 0; unsigned index; - const float* originalThickness; + const float *originalThickness; for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) { originalThickness = v->attribute().getThickness(); if (_stretch) { @@ -248,13 +248,13 @@ int ThicknessVariationPatternShader::shade(Stroke& stroke) const index %= _size; float thicknessR = array[index] * originalThickness[0]; float thicknessL = array[index] * originalThickness[1]; - if (thicknessR+thicknessL < _minThickness) { - thicknessL = _minThickness/2.0f; - thicknessR = _minThickness/2.0f; + if (thicknessR + thicknessL < _minThickness) { + thicknessL = _minThickness / 2.0f; + thicknessR = _minThickness / 2.0f; } - if (thicknessR+thicknessL > _maxThickness) { - thicknessL = _maxThickness/2.0f; - thicknessR = _maxThickness/2.0f; + if (thicknessR + thicknessL > _maxThickness) { + thicknessL = _maxThickness / 2.0f; + thicknessR = _maxThickness / 2.0f; } if ((sig == 0) || (sig == vert_size - 1)) v->attribute().setThickness(1, 1); @@ -564,9 +564,9 @@ int BackboneStretcherShader::shade(Stroke& stroke) const Vec2d first((v0)->x(), (v0)->y()); Vec2d last((vn)->x(), (vn)->y()); - Vec2d d1(first-Vec2d((v1)->x(), (v1)->y())); + Vec2d d1(first - Vec2d((v1)->x(), (v1)->y())); d1.normalize(); - Vec2d dn(last-Vec2d((vn_1)->x(), (vn_1)->y())); + Vec2d dn(last - Vec2d((vn_1)->x(), (vn_1)->y())); dn.normalize(); Vec2d newFirst(first + _amount * d1); @@ -590,7 +590,7 @@ int ExternalContourStretcherShader::shade(Stroke& stroke) const //float l = stroke.getLength2D(); Interface0DIterator it; Functions0D::Normal2DF0D fun; - StrokeVertex* sv; + StrokeVertex *sv; for (it = stroke.verticesBegin(); !it.isEnd(); ++it) { if (fun(it) < 0) return -1; @@ -900,7 +900,7 @@ int InflateShader::shade(Stroke& stroke) const if (norm_fun(stroke) < 0) return -1; Vec2f strokeN(norm_fun.result); - if (n*strokeN < 0) { + if (n * strokeN < 0) { n[0] = -n[0]; n[1] = -n[1]; } |