diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 10:50:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 10:50:15 +0400 |
commit | dfdb2eb9a88b14c0aade5e7e503a160e521f7c63 (patch) | |
tree | 0e5926b9738c1c95c2d11b31dab0248645085f39 /source | |
parent | 8e6ce736c4fcdd83344b0b6e0ba65cec340eec21 (diff) |
fix own error in r56649, caused normal calculation to fail, reported as [#35448], also quiet float/double warning.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 7 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 4bf0ed5737e..db0fee54d39 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1951,9 +1951,9 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml, /* Polygon Normal and edge-vector */ /* inline version of #BKE_mesh_calc_poly_normal, also does edge-vectors */ { - float const *v_prev = mvert[ml[nverts - 1].v].co; - float const *v_curr; int i_prev = nverts - 1; + float const *v_prev = mvert[ml[i_prev].v].co; + float const *v_curr; zero_v3(polyno); /* Newell's Method */ @@ -1979,14 +1979,13 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml, for (i = 0; i < nverts; i++) { const float *cur_edge = edgevecbuf[i]; - unsigned int vindex = ml[i].v; /* calculate angle between the two poly edges incident on * this vertex */ const float fac = saacos(-dot_v3v3(cur_edge, prev_edge)); /* accumulate */ - madd_v3_v3fl(tnorms[vindex], polyno, fac); + madd_v3_v3fl(tnorms[ml[i].v], polyno, fac); prev_edge = cur_edge; } } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 604151b1e1e..d205b3ff4f9 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3844,7 +3844,7 @@ static void *do_projectpaint_thread(void *ph_v) if (ps->is_maskbrush) { float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool); - CLAMP(texmask, 0.0, 1.0); + CLAMP(texmask, 0.0f, 1.0f); mask = mask_accum + (brush_alpha * texmask * 65535.0f - mask_accum) * mask; } else { @@ -3865,7 +3865,7 @@ static void *do_projectpaint_thread(void *ph_v) mask *= brush_alpha; if (ps->is_maskbrush) { float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool); - CLAMP(texmask, 0.0, 1.0); + CLAMP(texmask, 0.0f, 1.0f); mask *= texmask; } } |