diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_draw.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 24 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 4 |
4 files changed, 28 insertions, 16 deletions
diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 173d65ee4fc..22b70b82902 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -163,19 +163,25 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc) userdata.sel = false; userdata.act_track = act_track; UI_view2d_getscale(v2d, &userdata.xscale, &userdata.yscale); - clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, sc->flag & SC_SHOW_GRAPH_HIDDEN, + clip_graph_tracking_values_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, tracking_segment_knot_cb, NULL, NULL); /* draw graph lines */ glEnable(GL_BLEND); - clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, sc->flag & SC_SHOW_GRAPH_HIDDEN, + clip_graph_tracking_values_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, act_track, tracking_segment_point_cb, tracking_segment_start_cb, tracking_segment_end_cb); glDisable(GL_BLEND); /* selected knot handles on top of curves */ userdata.sel = TRUE; - clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, sc->flag & SC_SHOW_GRAPH_HIDDEN, + clip_graph_tracking_values_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) !=0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, tracking_segment_knot_cb, NULL, NULL); } diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 393f92f5af5..d1c44693995 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -190,8 +190,10 @@ static bool mouse_select_knot(bContext *C, float co[2], bool extend) if (!extend) { SelectUserData selectdata = {SEL_DESELECT}; - clip_graph_tracking_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, - sc->flag & SC_SHOW_GRAPH_HIDDEN, &selectdata, + clip_graph_tracking_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, + &selectdata, toggle_selection_cb); } @@ -217,7 +219,9 @@ static bool mouse_select_curve(bContext *C, float co[2], bool extend) MouseSelectUserData userdata; mouse_select_init_data(&userdata, co); - clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, sc->flag & SC_SHOW_GRAPH_HIDDEN, + clip_graph_tracking_values_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, find_nearest_tracking_segment_cb, NULL, find_nearest_tracking_segment_end_cb); @@ -237,9 +241,10 @@ static bool mouse_select_curve(bContext *C, float co[2], bool extend) BKE_tracking_track_select(tracksbase, userdata.track, TRACK_AREA_ALL, TRUE); /* deselect all knots on newly selected curve */ - clip_graph_tracking_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, - sc->flag & SC_SHOW_GRAPH_HIDDEN, &selectdata, - toggle_selection_cb); + clip_graph_tracking_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, + &selectdata, toggle_selection_cb); } return true; @@ -565,9 +570,10 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op)) userdata.max = -FLT_MAX; userdata.min = FLT_MAX; - clip_graph_tracking_values_iterate(sc, sc->flag & SC_SHOW_GRAPH_SEL_ONLY, - sc->flag & SC_SHOW_GRAPH_HIDDEN, &userdata, - view_all_cb, NULL, NULL); + clip_graph_tracking_values_iterate(sc, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, + (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, + &userdata, view_all_cb, NULL, NULL); /* set extents of view to start/end frames */ v2d->cur.xmin = (float) SFRA; diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 39af856d280..513014a2d0d 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -126,12 +126,12 @@ void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct Movie void (*segment_start)(void *userdata, struct MovieTrackingTrack *track, int coord), void (*segment_end)(void *userdata)); -void clip_graph_tracking_values_iterate(struct SpaceClip *sc, int selected_only, int include_hidden, void *userdata, +void clip_graph_tracking_values_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void (*func)(void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val), void (*segment_start)(void *userdata, struct MovieTrackingTrack *track, int coord), void (*segment_end)(void *userdata)); -void clip_graph_tracking_iterate(struct SpaceClip *sc, int selected_only, int include_hidden, void *userdata, +void clip_graph_tracking_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void (*func)(void *userdata, struct MovieTrackingMarker *marker)); void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track); diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 635aa388541..dfd2b6e259d 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -125,7 +125,7 @@ void clip_graph_tracking_values_iterate_track( } void clip_graph_tracking_values_iterate( - SpaceClip *sc, int selected_only, int include_hidden, void *userdata, + SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void (*func)(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val), void (*segment_start)(void *userdata, MovieTrackingTrack *track, int coord), @@ -147,7 +147,7 @@ void clip_graph_tracking_values_iterate( } } -void clip_graph_tracking_iterate(SpaceClip *sc, int selected_only, int include_hidden, void *userdata, +void clip_graph_tracking_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void (*func)(void *userdata, MovieTrackingMarker *marker)) { MovieClip *clip = ED_space_clip_get_clip(sc); |