diff options
-rw-r--r-- | source/blender/editors/include/ED_clip.h | 6 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 10 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 5 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_intern.h | 16 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 2 |
8 files changed, 28 insertions, 31 deletions
diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 649266beec7..9284f547047 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -70,9 +70,9 @@ void ED_clip_update_frame(const struct Main *mainp, int cfra); int ED_clip_view_selection(struct SpaceClip *sc, struct ARegion *ar, int fit); void ED_clip_point_undistorted_pos(SpaceClip * sc, const float co[2], float r_co[2]); -void ED_clip_point_stable_pos(struct bContext *C, float x, float y, float *xr, float *yr); -void ED_clip_point_stable_pos__reverse(SpaceClip * sc, ARegion *ar, const float co[2], float r_co[2]); -void ED_clip_mouse_pos(struct bContext *C, struct wmEvent *event, float co[2]); +void ED_clip_point_stable_pos(const struct bContext *C, float x, float y, float *xr, float *yr); +void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float co[2], float r_co[2]); +void ED_clip_mouse_pos(const struct bContext *C, struct wmEvent *event, float co[2]); int ED_space_clip_texture_buffer_supported(struct SpaceClip *sc); int ED_space_clip_load_movieclip_buffer(struct SpaceClip *sc, struct ImBuf *ibuf); diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 0bc9adb6577..c9f6dc0c5fb 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -52,7 +52,7 @@ #include "mask_intern.h" /* own include */ -static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_co[2], int threshold, int feather, +static int find_nearest_diff_point(const bContext *C, Mask *mask, const float normal_co[2], int threshold, int feather, MaskLayer **masklay_r, MaskSpline **spline_r, MaskSplinePoint **point_r, float *u_r, float tangent[2], const short use_deform) @@ -176,7 +176,7 @@ static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_c /******************** add vertex *********************/ -static void setup_vertex_point(bContext *C, Mask *mask, MaskSpline *spline, MaskSplinePoint *new_point, +static void setup_vertex_point(const bContext *C, Mask *mask, MaskSpline *spline, MaskSplinePoint *new_point, const float point_co[2], const float tangent[2], const float u, MaskSplinePoint *reference_point, const short reference_adjacent) { @@ -365,7 +365,7 @@ static void mask_spline_add_point_at_index(MaskSpline *spline, int point_index) spline->tot_point++; } -static int add_vertex_subdivide(bContext *C, Mask *mask, const float co[2]) +static int add_vertex_subdivide(const bContext *C, Mask *mask, const float co[2]) { MaskLayer *masklay; MaskSpline *spline; @@ -399,7 +399,7 @@ static int add_vertex_subdivide(bContext *C, Mask *mask, const float co[2]) return FALSE; } -static int add_vertex_extrude(bContext *C, Mask *mask, MaskLayer *masklay, const float co[2]) +static int add_vertex_extrude(const bContext *C, Mask *mask, MaskLayer *masklay, const float co[2]) { MaskSpline *spline; MaskSplinePoint *point; @@ -500,7 +500,7 @@ static int add_vertex_extrude(bContext *C, Mask *mask, MaskLayer *masklay, const return TRUE; } -static int add_vertex_new(bContext *C, Mask *mask, MaskLayer *masklay, const float co[2]) +static int add_vertex_new(const bContext *C, Mask *mask, MaskLayer *masklay, const float co[2]) { MaskSpline *spline; MaskSplinePoint *point; diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 678186f0e8c..71d3caf74c5 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -441,10 +441,7 @@ void ED_mask_draw(const bContext *C, if (!mask) return; - /* TODO: for now, in the future better to make sure all utility functions - * are using const specifier for non-changing pointers - */ - ED_mask_size((bContext *)C, &width, &height); + ED_mask_size(C, &width, &height); draw_masklays(mask, draw_flag, draw_type, width, height); } diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 52711c8da55..3396f664820 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -76,7 +76,7 @@ int ED_maskedit_mask_poll(bContext *C) /********************** registration *********************/ -void ED_mask_mouse_pos(bContext *C, wmEvent *event, float co[2]) +void ED_mask_mouse_pos(const bContext *C, wmEvent *event, float co[2]) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -92,7 +92,7 @@ void ED_mask_mouse_pos(bContext *C, wmEvent *event, float co[2]) /* input: x/y - mval space * output: xr/yr - mask point space */ -void ED_mask_point_pos(bContext *C, float x, float y, float *xr, float *yr) +void ED_mask_point_pos(const bContext *C, float x, float y, float *xr, float *yr) { SpaceClip *sc = CTX_wm_space_clip(C); float co[2]; @@ -110,7 +110,7 @@ void ED_mask_point_pos(bContext *C, float x, float y, float *xr, float *yr) *yr = co[1]; } -void ED_mask_point_pos__reverse(bContext *C, float x, float y, float *xr, float *yr) +void ED_mask_point_pos__reverse(const bContext *C, float x, float y, float *xr, float *yr) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -132,7 +132,7 @@ void ED_mask_point_pos__reverse(bContext *C, float x, float y, float *xr, float *yr = co[1]; } -void ED_mask_size(bContext *C, int *width, int *height) +void ED_mask_size(const bContext *C, int *width, int *height) { ScrArea *sa = CTX_wm_area(C); if (sa && sa->spacedata.first) { @@ -154,7 +154,7 @@ void ED_mask_size(bContext *C, int *width, int *height) *height = 0; } -void ED_mask_aspect(bContext *C, float *aspx, float *aspy) +void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -168,7 +168,7 @@ void ED_mask_aspect(bContext *C, float *aspx, float *aspy) } } -void ED_mask_pixelspace_factor(bContext *C, float *scalex, float *scaley) +void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) { SpaceClip *sc = CTX_wm_space_clip(C); diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h index c34558d2a01..408b585bf4c 100644 --- a/source/blender/editors/mask/mask_intern.h +++ b/source/blender/editors/mask/mask_intern.h @@ -61,12 +61,12 @@ void MASK_OT_normals_make_consistent(struct wmOperatorType *ot); void MASK_OT_handle_type_set(struct wmOperatorType *ot); int ED_mask_feather_find_nearest( - struct bContext *C, struct Mask *mask, float normal_co[2], int threshold, + const struct bContext *C, struct Mask *mask, float normal_co[2], int threshold, struct MaskLayer **masklay_r, struct MaskSpline **spline_r, struct MaskSplinePoint **point_r, struct MaskSplinePointUW **uw_r, float *score); struct MaskSplinePoint *ED_mask_point_find_nearest( - struct bContext *C, struct Mask *mask, float normal_co[2], int threshold, + const struct bContext *C, struct Mask *mask, float normal_co[2], int threshold, struct MaskLayer **masklay_r, struct MaskSpline **spline_r, int *is_handle_r, float *score); @@ -97,14 +97,14 @@ void ED_mask_select_flush_all(struct Mask *mask); int ED_maskedit_poll(struct bContext *C); int ED_maskedit_mask_poll(struct bContext *C); -void ED_mask_size(struct bContext *C, int *width, int *height); -void ED_mask_aspect(struct bContext *C, float *aspx, float *aspy); +void ED_mask_size(const struct bContext *C, int *width, int *height); +void ED_mask_aspect(const struct bContext *C, float *aspx, float *aspy); -void ED_mask_pixelspace_factor(struct bContext *C, float *scalex, float *scaley); -void ED_mask_mouse_pos(struct bContext *C, struct wmEvent *event, float co[2]); +void ED_mask_pixelspace_factor(const struct bContext *C, float *scalex, float *scaley); +void ED_mask_mouse_pos(const struct bContext *C, struct wmEvent *event, float co[2]); -void ED_mask_point_pos(struct bContext *C, float x, float y, float *xr, float *yr); -void ED_mask_point_pos__reverse(struct bContext *C, float x, float y, float *xr, float *yr); +void ED_mask_point_pos(const struct bContext *C, float x, float y, float *xr, float *yr); +void ED_mask_point_pos__reverse(const struct bContext *C, float x, float y, float *xr, float *yr); /* mask_shapekey.c */ void MASK_OT_shape_key_insert(struct wmOperatorType *ot); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index b770e5e9dba..91ba05c1ab2 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -57,7 +57,7 @@ /******************** utility functions *********************/ -MaskSplinePoint *ED_mask_point_find_nearest(bContext *C, Mask *mask, float normal_co[2], int threshold, +MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, Mask *mask, float normal_co[2], int threshold, MaskLayer **masklay_r, MaskSpline **spline_r, int *is_handle_r, float *score) { @@ -153,7 +153,7 @@ MaskSplinePoint *ED_mask_point_find_nearest(bContext *C, Mask *mask, float norma return NULL; } -int ED_mask_feather_find_nearest(bContext *C, Mask *mask, float normal_co[2], int threshold, +int ED_mask_feather_find_nearest(const bContext *C, Mask *mask, float normal_co[2], int threshold, MaskLayer **masklay_r, MaskSpline **spline_r, MaskSplinePoint **point_r, MaskSplinePointUW **uw_r, float *score) { diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 0bad9f86ea1..aeddb24d84d 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -446,7 +446,7 @@ void ED_clip_point_undistorted_pos(SpaceClip *sc, const float co[2], float r_co[ } } -void ED_clip_point_stable_pos(bContext *C, float x, float y, float *xr, float *yr) +void ED_clip_point_stable_pos(const bContext *C, float x, float y, float *xr, float *yr) { ARegion *ar = CTX_wm_region(C); SpaceClip *sc = CTX_wm_space_clip(C); @@ -506,7 +506,7 @@ void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float c r_co[1] = (pos[1] * height * zoomy) + (float)sy; } -void ED_clip_mouse_pos(bContext *C, wmEvent *event, float co[2]) +void ED_clip_mouse_pos(const bContext *C, wmEvent *event, float co[2]) { ED_clip_point_stable_pos(C, event->mval[0], event->mval[1], &co[0], &co[1]); } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 174b7fcb373..bca0b2a476d 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1147,7 +1147,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) glScalef(maxdim * zoomx, maxdim * zoomy, 0); glMultMatrixf(sc->stabmat); - ED_mask_draw((bContext *)C, sc->mask_draw_flag, sc->mask_draw_type); + ED_mask_draw(C, sc->mask_draw_flag, sc->mask_draw_type); ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); |