From 4923b8e7a2b4d5528efdefd4414c28dc55d3bc38 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 17 Nov 2006 11:56:00 +0000 Subject: Fixes for Time Marker support in Action window; - now draws on correct height - selection is clipped correctly (did entire height) - made showing scene markers default Actually this implementation should have been a patch review... it was done with entirely duplicating the code from timeline.c, whilst re-use and generalizing markers has a preference. That way markers can become supported in any time-based editor. Will send an extensive review to Joshua Leung :) --- source/blender/src/drawaction.c | 87 ----------------------------------------- 1 file changed, 87 deletions(-) (limited to 'source/blender/src/drawaction.c') diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index b127a895911..ddcee6689f9 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -215,93 +215,6 @@ void draw_cfra_action(void) glLineWidth(1.0); } -/* Aligorith: for now, just draw them as lines (for debugging) */ -static void draw_marker(TimeMarker *marker) -{ - float xpos, xspace, yspace, xpixels, ypixels; - float vec[2]; - - - xpos = marker->frame; - /* no time correction for framelen! space is drawn with old values */ - - xspace= G.v2d->cur.xmax - G.v2d->cur.xmin; - yspace= G.v2d->cur.ymax - G.v2d->cur.ymin; - xpixels= G.v2d->mask.xmax-G.v2d->mask.xmin; - ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* draw line through this point */ - vec[0]= G.scene->r.framelen * xpos; - - vec[1]= G.v2d->cur.ymin; - if (marker->flag & SELECT) - glColor3ub(0xFF, 0xFF, 0x99); - else - glColor3ub(0xAA, 0xAA, 0x55); - glLineWidth(2.0); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); - - glLineWidth(1.0); - - - /* 5 px to offset icon to align properly, space / pixels corrects for zoom */ - if(marker->flag & SELECT) - BIF_icon_draw(xpos-(5.0*(xspace/xpixels)), (12.0*yspace/ypixels)-CHANNELHEIGHT, ICON_MARKER_HLT); - else - BIF_icon_draw(xpos-(5.0*(xspace/xpixels)), (12.0*yspace/ypixels)-CHANNELHEIGHT, ICON_MARKER); - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - - /* and the marker name too, shifted slightly to the top-right */ - if(marker->name && marker->name[0]) { - if(marker->flag & SELECT) { - BIF_ThemeColor(TH_TEXT_HI); - glRasterPos2f(xpos+(4.0*(xspace/xpixels)), - ((ypixels<=39.0)?(ypixels-10.0):29.0)*yspace/ypixels); - } - else { - BIF_ThemeColor(TH_TEXT); - if((marker->frame <= G.scene->r.cfra) && (marker->frame+5 > G.scene->r.cfra)) - glRasterPos2f(xpos+(4.0*(xspace/xpixels)), - ((ypixels<=39.0)?(ypixels-10.0):29.0)*yspace/ypixels); - else - glRasterPos2f(xpos+(4.0*(xspace/xpixels)), 17.0*yspace/ypixels); - } - BMF_DrawString(G.font, marker->name); - } -} - -static void draw_markers_action(SpaceAction *saction) -{ - ListBase *markers; - TimeMarker *marker; - - /* try to get markers */ - markers = get_saction_markers(saction); - if (markers == NULL) - return; - - /* unselected markers are drawn at the first time */ - for(marker= markers->first; marker; marker= marker->next) { - if(!(marker->flag & SELECT)) draw_marker(marker); - } - - /* selected markers are drawn later ... selected markers have to cover unselected - * markers laying at the same position as selected markers - * (jiri: it is hack, it could be solved better) */ - for(marker= markers->first; marker; marker= marker->next) { - if(marker->flag & SELECT) draw_marker(marker); - } -} /* left hand */ static void draw_action_channel_names(bAction *act) -- cgit v1.2.3