diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 556888c63c2..ffcb4329726 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -125,12 +125,12 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3]) case SEQ_TYPE_SCENE: UI_GetThemeColor3ubv(TH_SEQ_SCENE, col); - + if (seq->scene == curscene) { UI_GetColorPtrShade3ubv(col, col, 20); } break; - + /* transitions */ case SEQ_TYPE_CROSS: case SEQ_TYPE_GAMCROSS: @@ -216,7 +216,7 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s float startsample, endsample; float value1, value2; bSound *sound = seq->sound; - + SoundWaveform *waveform; if (length < 2) { @@ -227,7 +227,7 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock"); BLI_spin_init(sound->spinlock); } - + BLI_spin_lock(sound->spinlock); if (!sound->waveform) { if (!(sound->flags & SOUND_FLAGS_WAVEFORM_LOADING)) { @@ -242,7 +242,7 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s return; /* nothing to draw */ } BLI_spin_unlock(sound->spinlock); - + waveform = sound->waveform; if (waveform->length == 0) { @@ -365,7 +365,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, } immUniformColor4ubv(col); - + /* clamp within parent sequence strip bounds */ if (x1_chan < x1) x1_chan = x1; if (x2_chan > x2) x2_chan = x2; @@ -399,10 +399,10 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla float v1[2], v2[2], v3[2], rx1 = 0, rx2 = 0; //for triangles and rect float x1, x2, y1, y2; unsigned int whichsel = 0; - + x1 = seq->startdisp; x2 = seq->enddisp; - + y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; y2 = seq->machine + SEQ_STRIP_OFSTOP; @@ -410,32 +410,32 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla if (direction == SEQ_LEFTHANDLE) { rx1 = x1; rx2 = x1 + handsize_clamped * 0.75f; - + v1[0] = x1 + handsize_clamped / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2); v2[0] = x1 + handsize_clamped / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2); v3[0] = v2[0] + handsize_clamped / 4; v3[1] = (y1 + y2) / 2.0f; - + whichsel = SEQ_LEFTSEL; } else if (direction == SEQ_RIGHTHANDLE) { rx1 = x2 - handsize_clamped * 0.75f; rx2 = x2; - + v1[0] = x2 - handsize_clamped / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2); v2[0] = x2 - handsize_clamped / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2); v3[0] = v2[0] - handsize_clamped / 4; v3[1] = (y1 + y2) / 2.0f; - + whichsel = SEQ_RIGHTSEL; } - + /* draw! */ if (!(seq->type & SEQ_TYPE_EFFECT) || BKE_sequence_effect_get_num_inputs(seq->type) == 0) { glEnable(GL_BLEND); - + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - + if (seq->flag & whichsel) { immUniformColor4ub(0, 0, 0, 80); } @@ -445,9 +445,9 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla else { immUniformColor4ub(0, 0, 0, 22); } - + immRectf(pos, rx1, y1, rx2, y2); - + if (seq->flag & whichsel) { immUniformColor4ub(255, 255, 255, 200); } @@ -463,7 +463,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla glDisable(GL_BLEND); } - + if ((G.moving & G_TRANSFORM_SEQ) || (seq->flag & whichsel)) { const char col[4] = {255, 255, 255, 255}; char numstr[32]; @@ -579,7 +579,7 @@ static void draw_seq_text(View2D *v2d, SpaceSeq *sseq, Sequence *seq, float x1, str_len = BLI_snprintf(str, sizeof(str), "%s | %d", name, seq->len); } - + if (seq->flag & SELECT) { col[0] = col[1] = col[2] = 255; } @@ -604,23 +604,23 @@ static void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq, u float x1, x2, y1, y2, pixely; unsigned char col[4], blendcol[3]; View2D *v2d = &ar->v2d; - + x1 = seq->startdisp; x2 = seq->enddisp; - + y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; y2 = seq->machine + SEQ_STRIP_OFSTOP; - + pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask); - + if (pixely <= 0) return; /* can happen when the view is split/resized */ - + blendcol[0] = blendcol[1] = blendcol[2] = 120; if (seq->startofs || seq->endofs) { glEnable(GL_BLEND); glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - + color3ubv_from_seq(scene, seq, col); if (seq->flag & SELECT) { @@ -710,7 +710,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg /* we need to know if this is a single image/color or not for drawing */ is_single_image = (char)BKE_sequence_single_check(seq); - + /* body */ x1 = (seq->startstill) ? seq->start : seq->startdisp; y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; @@ -765,7 +765,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg x1 = seq->startdisp; x2 = seq->enddisp; - + /* draw sound wave */ if (seq->type == SEQ_TYPE_SOUND_RAM) { if (!(sseq->flag & SEQ_NO_WAVEFORMS)) { @@ -825,7 +825,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg } else UI_GetColorPtrShade3ubv(col, col, outline_tint); - + if ((seq->type == SEQ_TYPE_META) || ((seq->type == SEQ_TYPE_SCENE) && (seq->flag & SEQ_SCENE_STRIPS))) { @@ -978,7 +978,7 @@ static ImBuf *sequencer_make_scope(Scene *scene, ImBuf *ibuf, ImBuf *(*make_scop { ImBuf *display_ibuf = IMB_dupImBuf(ibuf); ImBuf *scope; - + IMB_colormanagement_imbuf_make_display_space(display_ibuf, &scene->view_settings, &scene->display_settings); @@ -1485,7 +1485,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq) { int rectx, recty; int render_size = sseq->render_size; - int proxy_size = 100.0; + int proxy_size = 100.0; if (render_size == 0) { render_size = scene->r.size; } @@ -1558,12 +1558,12 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) Sequence *last_seq = BKE_sequencer_active_get(scene); int sel = 0, j; float pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); - + /* loop through twice, first unselected, then selected */ for (j = 0; j < 2; j++) { Sequence *seq; int outline_tint = (j) ? 40 : -40; /* highlighting around strip edges indicating selection */ - + /* loop through strips, checking for those that are visible */ for (seq = ed->seqbasep->first; seq; seq = seq->next) { /* boundbox and selection tests for NOT drawing the strip... */ @@ -1573,15 +1573,15 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) else if (max_ii(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) continue; else if (seq->machine + 1.0f < v2d->cur.ymin) continue; else if (seq->machine > v2d->cur.ymax) continue; - + /* strip passed all tests unscathed... so draw it now */ draw_seq_strip(C, sseq, scene, ar, seq, outline_tint, pixelx); } - + /* draw selected next time round */ sel = SELECT; } - + /* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */ if (last_seq) draw_seq_strip(C, sseq, scene, ar, last_seq, 120, pixelx); @@ -1614,7 +1614,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - /* draw darkened area outside of active timeline + /* draw darkened area outside of active timeline * frame range used is preview range or scene range */ immUniformThemeColorShadeAlpha(TH_BACK, -25, -100); @@ -1673,27 +1673,27 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) View2DScrollers *scrollers; short unit = 0, cfra_flag = 0; float col[3]; - + /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); - if (ed && ed->metastack.first) + if (ed && ed->metastack.first) glClearColor(col[0], col[1], col[2] - 0.1f, 0.0f); - else + else glClearColor(col[0], col[1], col[2], 0.0f); glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(v2d); - - - /* calculate extents of sequencer strips/data + + + /* calculate extents of sequencer strips/data * NOTE: needed for the scrollers later */ boundbox_seq(scene, &v2d->tot); - - + + /* draw backdrop */ draw_seq_backdrop(v2d); - + /* regular grid-pattern over the rest of the view (i.e. 1-second grid lines) */ UI_view2d_constant_grid_draw(v2d, FPS); @@ -1702,29 +1702,29 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0, false, true); UI_view2d_view_ortho(v2d); } - + ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); - + seq_draw_sfra_efra(scene, v2d); /* sequence strips (if there is data available to be drawn) */ if (ed) { /* draw the data */ draw_seq_strips(C, ed, ar); - + /* text draw cached (for sequence names), in pixelspace now */ UI_view2d_text_cache_draw(ar); } - + /* current frame */ UI_view2d_view_ortho(v2d); if ((sseq->flag & SEQ_DRAWFRAMES) == 0) cfra_flag |= DRAWCFRA_UNIT_SECONDS; ANIM_draw_cfra(C, v2d, cfra_flag); - + /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); ED_markers_draw(C, DRAW_MARKERS_LINES | DRAW_MARKERS_MARGIN); - + /* preview range */ UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d, 1); @@ -1757,7 +1757,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) scrollers = UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP); UI_view2d_scrollers_draw(C, v2d, scrollers); UI_view2d_scrollers_free(scrollers); - + /* draw current frame number-indicator on top of scrollers */ if ((sseq->flag & SEQ_NO_DRAW_CFRANUM) == 0) { UI_view2d_view_orthoSpecial(ar, v2d, 1); |