diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-19 18:56:05 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-19 18:58:35 +0300 |
commit | 2ddfd3a1235a50906d55f2b978f0ba03547d24e3 (patch) | |
tree | 089354c9a426183bb4e66180fbb9428cc334c8bb /source | |
parent | f56fd1c47acc0a9b9e80e504ca727beffde6dc24 (diff) |
Skip flip check in cases where it's not needed.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index feeac2a2af7..cd72849cc12 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -2044,8 +2044,7 @@ static void project_bucket_clip_face( { int inside_bucket_flag = 0; int inside_face_flag = 0; - const int flip = ((line_point_side_v2(v1coSS, v2coSS, v3coSS) > 0.0f) != - (line_point_side_v2(uv1co, uv2co, uv3co) > 0.0f)); + int flip; bool colinear = false; float bucket_bounds_ss[4][2]; @@ -2062,6 +2061,9 @@ static void project_bucket_clip_face( inside_bucket_flag |= BLI_rctf_isect_pt_v(bucket_bounds, v3coSS) << 2; if (inside_bucket_flag == ISECT_ALL3) { + flip = ((line_point_side_v2(v1coSS, v2coSS, v3coSS) > 0.0f) != + (line_point_side_v2(uv1co, uv2co, uv3co) > 0.0f)); + /* all screenspace points are inside the bucket bounding box, * this means we don't need to clip and can simply return the UVs */ if (flip) { /* facing the back? */ @@ -2143,6 +2145,9 @@ static void project_bucket_clip_face( bucket_bounds_ss[3][1] = bucket_bounds->ymin; inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[3], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_4 : 0); + flip = ((line_point_side_v2(v1coSS, v2coSS, v3coSS) > 0.0f) != + (line_point_side_v2(uv1co, uv2co, uv3co) > 0.0f)); + if (inside_face_flag == ISECT_ALL4) { /* bucket is totally inside the screenspace face, we can safely use weights */ |