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>2020-03-25 09:58:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-25 09:58:58 +0300
commit2bc791437e3b8e42c1369daf15c72934474b1e73 (patch)
treef2202c3753c8288bea47d3c0edd10bcf01cdf339 /source/blender/editors/mask
parentc3764fe1e80670cd578df7bbc5c37c267e81013a (diff)
Cleanup: use 'r_' prefix for output arguments
Also pass some args as 'const'.
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_add.c42
-rw-r--r--source/blender/editors/mask/mask_intern.h28
-rw-r--r--source/blender/editors/mask/mask_ops.c90
3 files changed, 80 insertions, 80 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index 80716195121..a190b048ee3 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -55,11 +55,11 @@ bool ED_mask_find_nearest_diff_point(const bContext *C,
float tangent[2],
const bool use_deform,
const bool use_project,
- MaskLayer **mask_layer_r,
- MaskSpline **spline_r,
- MaskSplinePoint **point_r,
- float *u_r,
- float *score_r)
+ MaskLayer **r_mask_layer,
+ MaskSpline **r_spline,
+ MaskSplinePoint **r_point,
+ float *r_u,
+ float *r_score)
{
ScrArea *sa = CTX_wm_area(C);
ARegion *region = CTX_wm_region(C);
@@ -156,44 +156,44 @@ bool ED_mask_find_nearest_diff_point(const bContext *C,
}
if (point && dist_best_sq < threshold) {
- if (mask_layer_r) {
- *mask_layer_r = point_mask_layer;
+ if (r_mask_layer) {
+ *r_mask_layer = point_mask_layer;
}
- if (spline_r) {
- *spline_r = point_spline;
+ if (r_spline) {
+ *r_spline = point_spline;
}
- if (point_r) {
- *point_r = point;
+ if (r_point) {
+ *r_point = point;
}
- if (u_r) {
+ if (r_u) {
/* TODO(sergey): Projection fails in some weirdo cases.. */
if (use_project) {
u = BKE_mask_spline_project_co(point_spline, point, u, normal_co, MASK_PROJ_ANY);
}
- *u_r = u;
+ *r_u = u;
}
- if (score_r) {
- *score_r = dist_best_sq;
+ if (r_score) {
+ *r_score = dist_best_sq;
}
return true;
}
- if (mask_layer_r) {
- *mask_layer_r = NULL;
+ if (r_mask_layer) {
+ *r_mask_layer = NULL;
}
- if (spline_r) {
- *spline_r = NULL;
+ if (r_spline) {
+ *r_spline = NULL;
}
- if (point_r) {
- *point_r = NULL;
+ if (r_point) {
+ *r_point = NULL;
}
return false;
diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h
index 091cf4937ae..e194a68c45d 100644
--- a/source/blender/editors/mask/mask_intern.h
+++ b/source/blender/editors/mask/mask_intern.h
@@ -39,11 +39,11 @@ bool ED_mask_find_nearest_diff_point(const struct bContext *C,
float tangent[2],
const bool use_deform,
const bool use_project,
- struct MaskLayer **mask_layer_r,
- struct MaskSpline **spline_r,
- struct MaskSplinePoint **point_r,
- float *u_r,
- float *score_r);
+ struct MaskLayer **r_mask_layer,
+ struct MaskSpline **r_spline,
+ struct MaskSplinePoint **r_point,
+ float *r_u,
+ float *r_score);
void MASK_OT_add_vertex(struct wmOperatorType *ot);
void MASK_OT_add_feather_vertex(struct wmOperatorType *ot);
@@ -76,20 +76,20 @@ bool ED_mask_feather_find_nearest(const struct bContext *C,
struct Mask *mask,
const float normal_co[2],
const float threshold,
- struct MaskLayer **mask_layer_r,
- struct MaskSpline **spline_r,
- struct MaskSplinePoint **point_r,
- struct MaskSplinePointUW **uw_r,
- float *score);
+ struct MaskLayer **r_mask_layer,
+ struct MaskSpline **r_spline,
+ struct MaskSplinePoint **r_point,
+ struct MaskSplinePointUW **r_uw,
+ float *r_score);
struct MaskSplinePoint *ED_mask_point_find_nearest(const struct bContext *C,
struct Mask *mask,
const float normal_co[2],
const float threshold,
- struct MaskLayer **mask_layer_r,
- struct MaskSpline **spline_r,
- eMaskWhichHandle *which_handle_r,
- float *score);
+ struct MaskLayer **r_mask_layer,
+ struct MaskSpline **r_spline,
+ eMaskWhichHandle *r_which_handle,
+ float *r_score);
void MASK_OT_layer_move(struct wmOperatorType *ot);
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 5e7d94dd567..79999bcebca 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -69,10 +69,10 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C,
Mask *mask_orig,
const float normal_co[2],
const float threshold,
- MaskLayer **mask_layer_r,
- MaskSpline **spline_r,
- eMaskWhichHandle *which_handle_r,
- float *score)
+ MaskLayer **r_mask_layer,
+ MaskSpline **r_spline,
+ eMaskWhichHandle *r_which_handle,
+ float *r_score)
{
ScrArea *sa = CTX_wm_area(C);
ARegion *region = CTX_wm_region(C);
@@ -185,35 +185,35 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C,
}
if (len_sq < threshold_sq) {
- if (mask_layer_r) {
- *mask_layer_r = point_mask_layer;
+ if (r_mask_layer) {
+ *r_mask_layer = point_mask_layer;
}
- if (spline_r) {
- *spline_r = point_spline;
+ if (r_spline) {
+ *r_spline = point_spline;
}
- if (which_handle_r) {
- *which_handle_r = which_handle;
+ if (r_which_handle) {
+ *r_which_handle = which_handle;
}
- if (score) {
- *score = sqrtf(len_sq);
+ if (r_score) {
+ *r_score = sqrtf(len_sq);
}
return point;
}
- if (mask_layer_r) {
- *mask_layer_r = NULL;
+ if (r_mask_layer) {
+ *r_mask_layer = NULL;
}
- if (spline_r) {
- *spline_r = NULL;
+ if (r_spline) {
+ *r_spline = NULL;
}
- if (which_handle_r) {
- *which_handle_r = MASK_WHICH_HANDLE_NONE;
+ if (r_which_handle) {
+ *r_which_handle = MASK_WHICH_HANDLE_NONE;
}
return NULL;
@@ -223,11 +223,11 @@ bool ED_mask_feather_find_nearest(const bContext *C,
Mask *mask_orig,
const float normal_co[2],
const float threshold,
- MaskLayer **mask_layer_r,
- MaskSpline **spline_r,
- MaskSplinePoint **point_r,
- MaskSplinePointUW **uw_r,
- float *score)
+ MaskLayer **r_mask_layer,
+ MaskSpline **r_spline,
+ MaskSplinePoint **r_point,
+ MaskSplinePointUW **r_uw,
+ float *r_score)
{
ScrArea *sa = CTX_wm_area(C);
ARegion *region = CTX_wm_region(C);
@@ -306,39 +306,39 @@ bool ED_mask_feather_find_nearest(const bContext *C,
}
if (len < threshold_sq) {
- if (mask_layer_r) {
- *mask_layer_r = point_mask_layer;
+ if (r_mask_layer) {
+ *r_mask_layer = point_mask_layer;
}
- if (spline_r) {
- *spline_r = point_spline;
+ if (r_spline) {
+ *r_spline = point_spline;
}
- if (point_r) {
- *point_r = point;
+ if (r_point) {
+ *r_point = point;
}
- if (uw_r) {
- *uw_r = uw;
+ if (r_uw) {
+ *r_uw = uw;
}
- if (score) {
- *score = sqrtf(len);
+ if (r_score) {
+ *r_score = sqrtf(len);
}
return true;
}
- if (mask_layer_r) {
- *mask_layer_r = NULL;
+ if (r_mask_layer) {
+ *r_mask_layer = NULL;
}
- if (spline_r) {
- *spline_r = NULL;
+ if (r_spline) {
+ *r_spline = NULL;
}
- if (point_r) {
- *point_r = NULL;
+ if (r_point) {
+ *r_point = NULL;
}
return false;
@@ -549,8 +549,8 @@ static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float c
static bool spline_under_mouse_get(const bContext *C,
Mask *mask,
const float co[2],
- MaskLayer **mask_layer_r,
- MaskSpline **mask_spline_r)
+ MaskLayer **r_mask_layer,
+ MaskSpline **r_mask_spline)
{
const float threshold = 19.0f;
ScrArea *sa = CTX_wm_area(C);
@@ -561,8 +561,8 @@ static bool spline_under_mouse_get(const bContext *C,
MaskLayer *closest_layer = NULL;
MaskSpline *closest_spline = NULL;
bool undistort = false;
- *mask_layer_r = NULL;
- *mask_spline_r = NULL;
+ *r_mask_layer = NULL;
+ *r_mask_spline = NULL;
ED_mask_get_size(sa, &width, &height);
pixel_co[0] = co[0] * width;
pixel_co[1] = co[1] * height;
@@ -634,8 +634,8 @@ static bool spline_under_mouse_get(const bContext *C,
}
}
- *mask_layer_r = closest_layer;
- *mask_spline_r = closest_spline;
+ *r_mask_layer = closest_layer;
+ *r_mask_spline = closest_spline;
return true;
}
return false;