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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-02 19:46:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-02 19:46:45 +0400
commitfed1b8b16d2d6a56aeea496677f24b286672bb74 (patch)
tree542e5f6bcfef3491e61f745b4aa1cee769dff63c /source/blender/editors/sculpt_paint/paint_vertex_proj.c
parentdda63375b2fa581197e909c45116ac17b5f8782c (diff)
Code cleanup: suffix vars to make obvious they are squared
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_proj.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c
index 4c06cb8ea0d..cf15fc3b2db 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c
@@ -56,7 +56,7 @@ struct VertProjHandle {
bool use_update;
/* use for update */
- float *dists;
+ float *dists_sq;
Object *ob;
Scene *scene;
@@ -144,13 +144,13 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index,
co, co_ss,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
{
- const float dist = len_squared_v2v2(vp_update->mval_fl, co_ss);
- if (dist > vp_handle->dists[index]) {
+ const float dist_sq = len_squared_v2v2(vp_update->mval_fl, co_ss);
+ if (dist_sq > vp_handle->dists_sq[index]) {
/* bail out! */
return;
}
- vp_handle->dists[index] = dist;
+ vp_handle->dists_sq[index] = dist_sq;
}
}
/* continue with regular functionality */
@@ -181,7 +181,7 @@ static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
/* highly unlikely this will become unavailable once painting starts (perhaps with animated modifiers) */
if (LIKELY(dm->foreachMappedVert)) {
- fill_vn_fl(vp_handle->dists, me->totvert, FLT_MAX);
+ fill_vn_fl(vp_handle->dists_sq, me->totvert, FLT_MAX);
dm->foreachMappedVert(dm, vpaint_proj_dm_map_cosnos_update__map_cb, &vp_update, DM_FOREACH_USE_NORMAL);
}
@@ -207,13 +207,13 @@ struct VertProjHandle *ED_vpaint_proj_handle_create(Scene *scene, Object *ob,
vpaint_proj_dm_map_cosnos_init(scene, ob, vp_handle);
if (vp_handle->use_update) {
- vp_handle->dists = MEM_mallocN(sizeof(float) * me->totvert, __func__);
+ vp_handle->dists_sq = MEM_mallocN(sizeof(float) * me->totvert, __func__);
vp_handle->ob = ob;
vp_handle->scene = scene;
}
else {
- vp_handle->dists = NULL;
+ vp_handle->dists_sq = NULL;
vp_handle->ob = NULL;
vp_handle->scene = NULL;
@@ -234,7 +234,7 @@ void ED_vpaint_proj_handle_update(struct VertProjHandle *vp_handle,
void ED_vpaint_proj_handle_free(struct VertProjHandle *vp_handle)
{
if (vp_handle->use_update) {
- MEM_freeN(vp_handle->dists);
+ MEM_freeN(vp_handle->dists_sq);
}
MEM_freeN(vp_handle->vcosnos);