Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-05-05 04:49:26 +0400
committerJoshua Leung <aligorith@gmail.com>2014-05-05 06:16:40 +0400
commite5c306b101a093521368810202b4c826fecb18a1 (patch)
treebb3922041c83cf79891e4b649eae63f5d9b5a2d7 /source/blender/editors/space_nla
parent1e577739e74d670c23f10d2eca4a61282f0a4673 (diff)
Code Cleanup: Remove old deprecated NLA channel drawing code
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c193
1 files changed, 0 insertions, 193 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index a6f5cf1f5c5..943112624cd 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -619,199 +619,6 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* *********************************************** */
/* Channel List */
-/* old code for drawing NLA channels using GL only */
-// TODO: depreceate this code...
-static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View2D *v2d, float y)
-{
- SpaceNla *snla = (SpaceNla *)ac->sl;
- bAnimListElem *ale;
- float x = 0.0f;
-
- /* loop through channels, and set up drawing depending on their type */
- for (ale = anim_data->first; ale; ale = ale->next) {
- const float yminc = (float)(y - NLACHANNEL_HEIGHT_HALF(snla));
- const float ymaxc = (float)(y + NLACHANNEL_HEIGHT_HALF(snla));
- const float ydatac = (float)(y - 0.35f * U.widget_unit);
-
- /* check if visible */
- if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
- IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
- {
- AnimData *adt = ale->adt;
-
- short indent = 0, offset = 0, sel = 0, group = 0;
- int special = -1;
- char name[128];
- bool do_draw = false;
-
- /* determine what needs to be drawn */
- switch (ale->type) {
-#if 0
- case ANIMTYPE_NLAACTION: /* NLA Action-Line */
- {
- bAction *act = (bAction *)ale->data;
-
- group = 5;
-
- /* indicate tweaking-action state by changing the icon... */
- if ((adt) && (adt->flag & ADT_NLA_EDIT_ON))
- special = ICON_ACTION_TWEAK;
- else
- special = ICON_ACTION;
-
- BLI_strncpy(name, act ? act->id.name + 2 : "<No Action>", sizeof(name));
-
- /* draw manually still */
- do_draw = true;
- break;
- }
-#endif
- default: /* handled by standard channel-drawing API */
- /* (draw backdrops only...) */
- ANIM_channel_draw(ac, ale, yminc, ymaxc);
- break;
- }
-
- /* if special types, draw manually for now... */
- if (do_draw) {
- if (ale->id) {
- /* special exception for textures */
- if (GS(ale->id->name) == ID_TE) {
- offset = 0.7f * U.widget_unit;
- indent = 1;
- }
- /* special exception for nodetrees */
- else if (GS(ale->id->name) == ID_NT) {
- bNodeTree *ntree = (bNodeTree *)ale->id;
-
- switch (ntree->type) {
- case NTREE_SHADER:
- {
- /* same as for textures */
- offset = 0.7f * U.widget_unit;
- indent = 1;
- break;
- }
- case NTREE_TEXTURE:
- {
- /* even more */
- offset = U.widget_unit;
- indent = 1;
- break;
- }
- default:
- /* normal will do */
- offset = 0.7f * U.widget_unit;
- break;
- }
- }
- else {
- offset = 0.7f * U.widget_unit;
- }
- }
- else {
- offset = 0;
- }
-
- /* now, start drawing based on this information */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* draw backing strip behind channel name */
- if (group == 5) {
- float color[4];
-
- /* Action Line
- * The alpha values action_get_color returns are only useful for drawing
- * strips backgrounds but here we're doing channel list backgrounds instead
- * so we ignore that and use our own when needed
- */
- nla_action_get_color(adt, (bAction *)ale->data, color);
-
- 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! */
- glColor3fv(color);
- }
- else {
- float alpha = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f;
- glColor4f(color[0], color[1], color[2], alpha);
- }
-
- offset += 0.35f * U.widget_unit * indent;
-
- /* only on top two corners, to show that this channel sits on top of the preceding ones */
- uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
-
- /* 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
- */
- uiDrawBox(GL_POLYGON, x + offset, yminc + NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc + NLACHANNEL_SKIP - 1, 8);
-
- /* clear group value, otherwise we cause errors... */
- group = 0;
- }
-
-
- /* draw special icon indicating certain data-types */
- if (special > -1) {
- /* for normal channels */
- UI_icon_draw(x + offset, ydatac, special);
- offset += 0.85f * U.widget_unit;
- }
- glDisable(GL_BLEND);
-
- /* draw name */
- if (sel)
- UI_ThemeColor(TH_TEXT_HI);
- else
- UI_ThemeColor(TH_TEXT);
- offset += 3;
- UI_DrawString(x + offset, y - 4, name);
-
- /* reset offset - for RHS of panel */
- offset = 0;
-
- /* set blending again, as text drawing may clear it */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
-
- /* draw NLA-action line 'status-icons' - only when there's an action */
- if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) {
- offset += 0.8f * U.widget_unit;
-
- /* now draw some indicator icons */
- if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
- /* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */
- // for now, use pin icon to symbolise this
- if (adt->flag & ADT_NLA_EDIT_NOMAP)
- UI_icon_draw((float)(v2d->cur.xmax - offset), ydatac, ICON_PINNED);
- else
- UI_icon_draw((float)(v2d->cur.xmax - offset), ydatac, ICON_UNPINNED);
- }
- else {
- /* XXX firstly draw a little rect to help identify that it's different from the toggles */
- glBegin(GL_LINE_LOOP);
- glVertex2f((float)v2d->cur.xmax - offset - 1, y - 0.35f * U.widget_unit);
- glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45f * U.widget_unit);
- glVertex2f((float)v2d->cur.xmax - 1, y + 0.45f * U.widget_unit);
- glVertex2f((float)v2d->cur.xmax - 1, y - 0.35f * U.widget_unit);
- glEnd();
-
- /* 'push down' icon for normal active-actions */
- UI_icon_draw((float)v2d->cur.xmax - offset, ydatac, ICON_NLA_PUSHDOWN);
- }
- }
-
- glDisable(GL_BLEND);
- }
- }
-
- /* adjust y-position for next one */
- y -= NLACHANNEL_STEP(snla);
- }
-}
-
void draw_nla_channel_list(bContext *C, bAnimContext *ac, ARegion *ar)
{
ListBase anim_data = {NULL, NULL};