diff options
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 52 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 9 |
5 files changed, 35 insertions, 36 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index f780a6c31ee..01a8ba4797c 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -87,7 +87,7 @@ /* Envelope -------------- */ // TODO: draw a shaded poly showing the region of influence too!!! -static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm, View2D *v2d) +static void draw_fcurve_modifier_controls_envelope (FModifier *fcm, View2D *v2d) { FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; @@ -137,7 +137,7 @@ static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm, /* Points ---------------- */ /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_vertices_keyframes (bAnimContext *ac, FCurve *fcu, View2D *v2d, short edit, short sel) +static void draw_fcurve_vertices_keyframes (FCurve *fcu, View2D *v2d, short edit, short sel) { BezTriple *bezt= fcu->bezt; const float fac= 0.05f * (v2d->cur.xmax - v2d->cur.xmin); @@ -209,7 +209,7 @@ static void draw_fcurve_handle_control (float x, float y, float xscale, float ys } /* helper func - draw handle vertices only for an F-Curve (if it is not protected) */ -static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCurve *fcu, View2D *v2d, short sel) +static void draw_fcurve_vertices_handles (FCurve *fcu, View2D *v2d, short sel, short sel_handle_only) { BezTriple *bezt= fcu->bezt; BezTriple *prevbezt = NULL; @@ -237,7 +237,7 @@ static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCur * Also, need to take into account whether the keyframe was selected * if a Graph Editor option to only show handles of selected keys is on. */ - if ( !(sipo->flag & SIPO_SELVHANDLESONLY) || BEZSELECTED(bezt) ) { + if ( !sel_handle_only || BEZSELECTED(bezt) ) { if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { if ((bezt->f1 & SELECT) == sel)/* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/ draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize); @@ -255,7 +255,7 @@ static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCur } /* helper func - set color to draw F-Curve data with */ -static void set_fcurve_vertex_color (SpaceIpo *sipo, FCurve *fcu, short sel) +static void set_fcurve_vertex_color (FCurve *fcu, short sel) { /* Fade the 'intensity' of the vertices based on the selection of the curves too */ int alphaOffset= (int)((drawFCurveFade(fcu) - 1.0f) * 255); @@ -274,7 +274,7 @@ static void set_fcurve_vertex_color (SpaceIpo *sipo, FCurve *fcu, short sel) } -static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu, int do_handles) +static void draw_fcurve_vertices (ARegion *ar, FCurve *fcu, short do_handles, short sel_handle_only) { View2D *v2d= &ar->v2d; @@ -290,19 +290,19 @@ static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, /* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */ if (do_handles) { - set_fcurve_vertex_color(sipo, fcu, 0); - draw_fcurve_vertices_handles(ac, sipo, fcu, v2d, 0); + set_fcurve_vertex_color(fcu, 0); + draw_fcurve_vertices_handles(fcu, v2d, 0, sel_handle_only); - set_fcurve_vertex_color(sipo, fcu, 1); - draw_fcurve_vertices_handles(ac, sipo, fcu, v2d, 1); + set_fcurve_vertex_color(fcu, 1); + draw_fcurve_vertices_handles(fcu, v2d, 1, sel_handle_only); } /* draw keyframes over the handles */ - set_fcurve_vertex_color(sipo, fcu, 0); - draw_fcurve_vertices_keyframes(ac, fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 0); + set_fcurve_vertex_color(fcu, 0); + draw_fcurve_vertices_keyframes(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 0); - set_fcurve_vertex_color(sipo, fcu, 1); - draw_fcurve_vertices_keyframes(ac, fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); + set_fcurve_vertex_color(fcu, 1); + draw_fcurve_vertices_keyframes(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); glPointSize(1.0f); } @@ -329,7 +329,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) /* draw lines for F-Curve handles only (this is only done in EditMode) * note: draw_fcurve_handles_check must be checked before running this. */ -static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) +static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu) { int sel, b; @@ -455,7 +455,7 @@ static void draw_fcurve_sample_control (float x, float y, float xscale, float ys } /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_samples (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) +static void draw_fcurve_samples (ARegion *ar, FCurve *fcu) { FPoint *first, *last; float hsize, xscale, yscale; @@ -489,7 +489,7 @@ static void draw_fcurve_samples (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, /* Curve ---------------- */ /* helper func - just draw the F-Curve by sampling the visible region (for drawing curves with modifiers) */ -static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *sipo, View2D *v2d, View2DGrid *grid) +static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, View2DGrid *grid) { ChannelDriver *driver; float samplefreq, ctime; @@ -627,7 +627,7 @@ static void draw_fcurve_curve_samples (bAnimContext *ac, ID *id, FCurve *fcu, Vi } /* helper func - draw one repeat of an F-Curve */ -static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, View2DGrid *grid) +static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d) { BezTriple *prevbezt= fcu->bezt; BezTriple *bezt= prevbezt+1; @@ -784,7 +784,7 @@ static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View /* Draw the 'ghost' F-Curves (i.e. snapshots of the curve) * NOTE: unit mapping has already been applied to the values, so do not try and apply again */ -void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid *grid) +void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) { FCurve *fcu; @@ -878,12 +878,12 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri /* draw a curve affected by modifiers or only allowed to have integer values * by sampling it at various small-intervals over the visible region */ - draw_fcurve_curve(ac, ale->id, fcu, sipo, &ar->v2d, grid); + draw_fcurve_curve(ac, ale->id, fcu, &ar->v2d, grid); } else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) { /* just draw curve based on defined data (i.e. no modifiers) */ if (fcu->bezt) - draw_fcurve_curve_bezts(ac, ale->id, fcu, &ar->v2d, grid); + draw_fcurve_curve_bezts(ac, ale->id, fcu, &ar->v2d); else if (fcu->fpt) draw_fcurve_curve_samples(ac, ale->id, fcu, &ar->v2d); } @@ -904,7 +904,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) { switch (fcm->type) { case FMODIFIER_TYPE_ENVELOPE: /* envelope */ - draw_fcurve_modifier_controls_envelope(fcu, fcm, &ar->v2d); + draw_fcurve_modifier_controls_envelope(fcm, &ar->v2d); break; } } @@ -919,15 +919,15 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if (do_handles) { /* only draw handles/vertices on keyframes */ glEnable(GL_BLEND); - draw_fcurve_handles(ac, sipo, ar, fcu); + draw_fcurve_handles(sipo, fcu); glDisable(GL_BLEND); } - draw_fcurve_vertices(ac, sipo, ar, fcu, do_handles); + draw_fcurve_vertices(ar, fcu, do_handles, sipo->flag&SIPO_SELVHANDLESONLY); } else { /* samples: only draw two indicators at either end as indicators */ - draw_fcurve_samples(ac, sipo, ar, fcu); + draw_fcurve_samples(ar, fcu); } /* unapply unit mapping */ @@ -948,7 +948,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri /* Channel List */ /* left hand part */ -void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) +void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 46e7840cec8..e1d1e4194d5 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1001,7 +1001,7 @@ typedef struct tSoundBakeInfo { /* Sampling callback used to determine the value from the sound to * save in the F-Curve at the specified frame */ -static float fcurve_samplingcb_sound (FCurve *fcu, void *data, float evaltime) +static float fcurve_samplingcb_sound (FCurve *UNUSED(fcu), void *data, float evaltime) { tSoundBakeInfo *sbi= (tSoundBakeInfo *)data; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index a637ed15fcd..560dabbb634 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -48,10 +48,10 @@ struct ARegion *graph_has_buttons_region(struct ScrArea *sa); /* ***************************************** */ /* graph_draw.c */ -void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar); +void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct ARegion *ar); void graph_draw_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid, short sel); -void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid); +void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar); /* ***************************************** */ /* graph_header.c */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 9dd499a2cbf..0aa0a87dbac 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -886,7 +886,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa } /* helper for find_nearest_fcurve_vert() - get the best match to use */ -static tNearestVertInfo *get_best_nearest_fcurve_vert (bAnimContext *ac, ListBase *matches) +static tNearestVertInfo *get_best_nearest_fcurve_vert (ListBase *matches) { tNearestVertInfo *nvi = NULL; short found = 0; @@ -941,7 +941,7 @@ static tNearestVertInfo *find_nearest_fcurve_vert (bAnimContext *ac, int mval[2] get_nearest_fcurve_verts_list(ac, mval, &matches); /* step 2: find the best vert */ - nvi= get_best_nearest_fcurve_vert(ac, &matches); + nvi= get_best_nearest_fcurve_vert(&matches); BLI_freelistN(&matches); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 994d9725762..ff2d233ccdb 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -175,7 +175,7 @@ static void graph_free(SpaceLink *sl) /* spacetype; init callback */ -static void graph_init(struct wmWindowManager *wm, ScrArea *sa) +static void graph_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceIpo *sipo= (SpaceIpo *)sa->spacedata.first; @@ -239,7 +239,7 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* draw data */ if (ANIM_animdata_get_context(C, &ac)) { /* draw ghost curves */ - graph_draw_ghost_curves(&ac, sipo, ar, grid); + graph_draw_ghost_curves(&ac, sipo, ar); /* draw curves twice - unselected, then selected, so that the are fewer occlusion problems */ graph_draw_curves(&ac, sipo, ar, grid, 0); @@ -314,7 +314,6 @@ static void graph_channel_area_init(wmWindowManager *wm, ARegion *ar) static void graph_channel_area_draw(const bContext *C, ARegion *ar) { - SpaceIpo *sipo= CTX_wm_space_graph(C); bAnimContext ac; View2D *v2d= &ar->v2d; View2DScrollers *scrollers; @@ -329,7 +328,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar) /* draw channels */ if (ANIM_animdata_get_context(C, &ac)) { - graph_draw_channel_names((bContext*)C, &ac, sipo, ar); + graph_draw_channel_names((bContext*)C, &ac, ar); } /* reset view matrix */ @@ -342,7 +341,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar) } /* add handlers, stuff you only do once or on area/region changes */ -static void graph_header_area_init(wmWindowManager *wm, ARegion *ar) +static void graph_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } |