diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-15 16:57:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-15 16:57:11 +0400 |
commit | 7fa256815f2aeebf9afd9b00859dcf2fa5716e2f (patch) | |
tree | fcca1bee4e26626095529cde8e907018c0a667c4 | |
parent | 964c35771ce3a4a15dfb96d6185b31457e1d29b3 (diff) |
skip fix from r54579 when holes aren't used (keeps bmesh ngon filling fast)
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 13 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_brightness.c | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index ef55734d936..298e37137ce 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -682,7 +682,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag) ScanFillVertLink *best_sc = NULL; float best_angle = 3.14f; float miny; - int firsttime = 0; + bool firsttime = false; v1 = ed1->v2; v2 = ed1->v1; @@ -706,15 +706,20 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag) /* because multiple points can be inside triangle (concave holes) */ /* we continue searching and pick the one with sharpest corner */ - if (best_sc == NULL) + if (best_sc == NULL) { best_sc = sc1; + /* only need to continue checking with holes */ + if ((flag & BLI_SCANFILL_CALC_HOLES) == 0) { + break; + } + } else { float angle; /* prevent angle calc for the simple cases only 1 vertex is found */ - if (firsttime == 0) { + if (firsttime == false) { best_angle = angle_v2v2v2(v2->co, v1->co, best_sc->vert->co); - firsttime = 1; + firsttime = true; } angle = angle_v2v2v2(v2->co, v1->co, sc1->vert->co); diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.c b/source/blender/nodes/shader/nodes/node_shader_brightness.c index 2b86fa60328..fa77fce4c88 100644 --- a/source/blender/nodes/shader/nodes/node_shader_brightness.c +++ b/source/blender/nodes/shader/nodes/node_shader_brightness.c @@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_brightcontrast_out[] = { { -1, 0, "" } }; -static int gpu_shader_brightcontrast(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_brightcontrast(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "brightness_contrast", in, out); } |