Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_draw.c
| Show First 20 Lines • Show All 785 Lines • ▼ Show 20 Lines | if (seq->startofs) { | ||||
| immRectf(pos, (float)(seq->start), y1 - pixely, x1, y1 - SEQ_STRIP_OFSBOTTOM); | immRectf(pos, (float)(seq->start), y1 - pixely, x1, y1 - SEQ_STRIP_OFSBOTTOM); | ||||
| /* Outline. */ | /* Outline. */ | ||||
| immUniformColor3ubv(blend_col); | immUniformColor3ubv(blend_col); | ||||
| imm_draw_box_wire_2d(pos, x1, y1 - pixely, (float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM); | imm_draw_box_wire_2d(pos, x1, y1 - pixely, (float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM); | ||||
| } | } | ||||
| if (seq->endofs) { | if (seq->endofs) { | ||||
| immUniformColor4ubv(col); | immUniformColor4ubv(col); | ||||
| immRectf(pos, x2, y2 + pixely, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM); | immRectf(pos, | ||||
| x2, | |||||
| y2 + pixely, | |||||
| (float)(seq->start + SEQ_time_strip_length_get(scene, seq)), | |||||
| y2 + SEQ_STRIP_OFSBOTTOM); | |||||
| /* Outline. */ | /* Outline. */ | ||||
| immUniformColor3ubv(blend_col); | immUniformColor3ubv(blend_col); | ||||
| imm_draw_box_wire_2d( | imm_draw_box_wire_2d(pos, | ||||
| pos, x2, y2 + pixely, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM); | x2, | ||||
| y2 + pixely, | |||||
| (float)(seq->start + SEQ_time_strip_length_get(scene, seq)), | |||||
| y2 + SEQ_STRIP_OFSBOTTOM); | |||||
| } | } | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| static void draw_color_strip_band(Sequence *seq, uint pos, float text_margin_y, float y1) | static void draw_color_strip_band(Sequence *seq, uint pos, float text_margin_y, float y1) | ||||
| { | { | ||||
| uchar col[4]; | uchar col[4]; | ||||
| SolidColorVars *colvars = (SolidColorVars *)seq->effectdata; | SolidColorVars *colvars = (SolidColorVars *)seq->effectdata; | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | static void draw_seq_background(Scene *scene, | ||||
| else { | else { | ||||
| col[3] = 255; | col[3] = 255; | ||||
| } | } | ||||
| immUniformColor4ubv(col); | immUniformColor4ubv(col); | ||||
| /* Draw the main strip body. */ | /* Draw the main strip body. */ | ||||
| if (is_single_image) { | if (is_single_image) { | ||||
| immRectf(pos, | immRectf(pos, | ||||
| SEQ_transform_get_left_handle_frame(seq, false), | SEQ_transform_get_left_handle_frame(scene, seq, false), | ||||
| y1, | y1, | ||||
| SEQ_transform_get_right_handle_frame(seq, false), | SEQ_transform_get_right_handle_frame(scene, seq, false), | ||||
| y2); | y2); | ||||
| } | } | ||||
| else { | else { | ||||
| immRectf(pos, x1, y1, x2, y2); | immRectf(pos, x1, y1, x2, y2); | ||||
| } | } | ||||
| /* Draw background for hold still regions. */ | /* Draw background for hold still regions. */ | ||||
| if (!is_single_image && (seq->startstill || seq->endstill)) { | if (!is_single_image && (seq->startstill || seq->endstill)) { | ||||
| UI_GetColorPtrShade3ubv(col, col, -35); | UI_GetColorPtrShade3ubv(col, col, -35); | ||||
| immUniformColor4ubv(col); | immUniformColor4ubv(col); | ||||
| if (seq->startstill) { | if (seq->startstill) { | ||||
| immRectf(pos, seq->startdisp, y1, (float)(seq->start), y2); | immRectf(pos, seq->startdisp, y1, (float)(seq->start), y2); | ||||
| } | } | ||||
| if (seq->endstill) { | if (seq->endstill) { | ||||
| immRectf(pos, (float)(seq->start + seq->len), y1, seq->enddisp, y2); | immRectf( | ||||
| pos, (float)(seq->start + SEQ_time_strip_length_get(scene, seq)), y1, seq->enddisp, y2); | |||||
| } | } | ||||
| } | } | ||||
| /* Draw right half of transition strips. */ | /* Draw right half of transition strips. */ | ||||
| if (ELEM(seq->type, SEQ_TYPE_CROSS, SEQ_TYPE_GAMCROSS, SEQ_TYPE_WIPE)) { | if (ELEM(seq->type, SEQ_TYPE_CROSS, SEQ_TYPE_GAMCROSS, SEQ_TYPE_WIPE)) { | ||||
| float vert_pos[3][2]; | float vert_pos[3][2]; | ||||
| Sequence *seq1 = seq->seq1; | Sequence *seq1 = seq->seq1; | ||||
| Sequence *seq2 = seq->seq2; | Sequence *seq2 = seq->seq2; | ||||
| ▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | static void draw_seq_strip(const bContext *C, | ||||
| float pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask); | float pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask); | ||||
| /* Check if we are doing "solo preview". */ | /* Check if we are doing "solo preview". */ | ||||
| bool is_single_image = (char)SEQ_transform_single_image_check(seq); | bool is_single_image = (char)SEQ_transform_single_image_check(seq); | ||||
| /* Draw strip body. */ | /* Draw strip body. */ | ||||
| x1 = (seq->startstill) ? seq->start : seq->startdisp; | x1 = (seq->startstill) ? seq->start : seq->startdisp; | ||||
| y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; | y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; | ||||
| x2 = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp; | x2 = (seq->endstill) ? (seq->start + SEQ_time_strip_length_get(scene, seq)) : seq->enddisp; | ||||
| y2 = seq->machine + SEQ_STRIP_OFSTOP; | y2 = seq->machine + SEQ_STRIP_OFSTOP; | ||||
| float text_margin_y; | float text_margin_y; | ||||
| bool y_threshold; | bool y_threshold; | ||||
| if ((sseq->flag & SEQ_SHOW_STRIP_NAME) || (sseq->flag & SEQ_SHOW_STRIP_SOURCE) || | if ((sseq->flag & SEQ_SHOW_STRIP_NAME) || (sseq->flag & SEQ_SHOW_STRIP_SOURCE) || | ||||
| (sseq->flag & SEQ_SHOW_STRIP_DURATION)) { | (sseq->flag & SEQ_SHOW_STRIP_DURATION)) { | ||||
| /* Calculate height needed for drawing text on strip. */ | /* Calculate height needed for drawing text on strip. */ | ||||
| ▲ Show 20 Lines • Show All 888 Lines • ▼ Show 20 Lines | for (seq = ed->seqbasep->first; seq; seq = seq->next) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (seq == last_seq && (last_seq->flag & SELECT)) { | if (seq == last_seq && (last_seq->flag & SELECT)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (min_ii(seq->startdisp, seq->start) > v2d->cur.xmax) { | if (min_ii(seq->startdisp, seq->start) > v2d->cur.xmax) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (max_ii(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) { | if (max_ii(seq->enddisp, seq->start + SEQ_time_strip_length_get(scene, seq)) < | ||||
| v2d->cur.xmin) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| if (seq->machine + 1.0f < v2d->cur.ymin) { | if (seq->machine + 1.0f < v2d->cur.ymin) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (seq->machine > v2d->cur.ymax) { | if (seq->machine > v2d->cur.ymax) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 464 Lines • Show Last 20 Lines | |||||