Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_channels_defines.c
| Context not available. | |||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| glColor3fv(color); | |||||
| /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | ||||
| UI_draw_roundbox_corner_set((expanded) ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | UI_draw_roundbox_corner_set((expanded) ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | ||||
| UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8); | UI_draw_roundbox_gl_mode_3fvAlpha(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f); | ||||
| } | } | ||||
Severin: It's a bit ugly to have float->uchar conversions everywhere, I'd suggest you solve this a bit… | |||||
Not Done Inline ActionsI disagree here. Why should a roundbox drawing function have two or more interfaces? I think it should just take byte[4] colors (like now) or just float[4] colors and callers have to deal with it. Looks like float colors are used more often so can we use that? UI_GetThemeColorShade4fv already exists. Keep the new UI_GetThemeColorShade4ubv because it is useful. I'll add immUniformColor4fv in a minute, so "git stash" then "git pull --rebase" then "git stash pop". Sorry for the extra work @Krantz Geoffroy (kgeogeo) -- we're almost there! merwin: I disagree here. Why should a roundbox drawing function have two or more interfaces? I think it… | |||||
| Context not available. | |||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| glColor3fv(color); | |||||
| /* rounded corners on LHS only | /* rounded corners on LHS only | ||||
| * - top and bottom | * - top and bottom | ||||
| * - special hack: make the top a bit higher, since we are first... | * - special hack: make the top a bit higher, since we are first... | ||||
| */ | */ | ||||
| UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT); | UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT); | ||||
| UI_draw_roundbox_gl_mode(GL_POLYGON, 0, yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8); | UI_draw_roundbox_gl_mode_3fvAlpha(GL_POLYGON, 0, yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f); | ||||
| } | } | ||||
| /* name for summary entries */ | /* name for summary entries */ | ||||
| Context not available. | |||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| glColor3fv(color); | |||||
| /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | ||||
| UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | ||||
| UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8); | UI_draw_roundbox_gl_mode_3fvAlpha(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f); | ||||
| } | } | ||||
| /* name for group entries */ | /* name for group entries */ | ||||
| Context not available. | |||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| glColor3fv(color); | |||||
| /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */ | ||||
| UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)); | ||||
| UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 5); | UI_draw_roundbox_gl_mode_3fvAlpha(GL_POLYGON, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 5, color, 1.0f); | ||||
| } | } | ||||
| /* name for nla controls expander entries */ | /* name for nla controls expander entries */ | ||||
| Context not available. | |||||
| */ | */ | ||||
| nla_action_get_color(adt, (bAction *)ale->data, color); | nla_action_get_color(adt, (bAction *)ale->data, color); | ||||
| if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { | if (adt && (adt->flag & ADT_NLA_EDIT_ON)) | ||||
| /* Yes, the color vector has 4 components, BUT we only want to be using 3 of them! */ | color[3] = 1.0f; | ||||
| glColor3fv(color); | else | ||||
| } | color[3] = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f; | ||||
| else { | |||||
| float alpha = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f; | /* only on top left corner, to show that this channel sits on top of the preceding ones | ||||
| glColor4f(color[0], color[1], color[2], alpha); | |||||
| } | |||||
| /* only on top left corner, to show that this channel sits on top of the preceding ones | |||||
| * while still linking into the action line strip to the right | * while still linking into the action line strip to the right | ||||
| */ | */ | ||||
| UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT); | UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT); | ||||
| /* draw slightly shifted up vertically to look like it has more separation from other channels, | /* draw slightly shifted up vertically to look like it has more separation from other channels, | ||||
| * but we then need to slightly shorten it so that it doesn't look like it overlaps | * but we then need to slightly shorten it so that it doesn't look like it overlaps | ||||
| */ | */ | ||||
| UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc + NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc + NLACHANNEL_SKIP - 1, 8); | UI_draw_roundbox_gl_mode(GL_POLYGON, offset, yminc + NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc + NLACHANNEL_SKIP - 1, 8, color); | ||||
| } | } | ||||
| /* name for nla action entries */ | /* name for nla action entries */ | ||||
| Context not available. | |||||
It's a bit ugly to have float->uchar conversions everywhere, I'd suggest you solve this a bit differently:
Here, the call would simplify to this then: