Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_draw.c
| Context not available. | |||||
| } | } | ||||
| static void outliner_draw_highlights_recursive( | static void outliner_draw_highlights_recursive( | ||||
| const ARegion *ar, const SpaceOops *soops, const ListBase *lb, | unsigned pos, const ARegion *ar, const SpaceOops *soops, const ListBase *lb, | ||||
| const float col_selection[4], const float col_highlight[4], const float col_searchmatch[4], | const float col_selection[4], const float col_highlight[4], const float col_searchmatch[4], | ||||
| int start_x, int *io_start_y) | int start_x, int *io_start_y) | ||||
| { | { | ||||
| Context not available. | |||||
| /* selection status */ | /* selection status */ | ||||
| if (tselem->flag & TSE_SELECTED) { | if (tselem->flag & TSE_SELECTED) { | ||||
| glColor4fv(col_selection); | immUniformColor4fv(col_selection); | ||||
| glRecti(0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | immRecti(pos, 0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | ||||
| } | } | ||||
| /* search match highlights | /* search match highlights | ||||
| * we don't expand items when searching in the datablocks but we | * we don't expand items when searching in the datablocks but we | ||||
| * still want to highlight any filter matches. */ | * still want to highlight any filter matches. */ | ||||
| if (is_searching && (tselem->flag & TSE_SEARCHMATCH)) { | if (is_searching && (tselem->flag & TSE_SEARCHMATCH)) { | ||||
| glColor4fv(col_searchmatch); | immUniformColor4fv(col_searchmatch); | ||||
| glRecti(start_x, start_y + 1, ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | immRecti(pos, start_x, start_y + 1, ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | ||||
| } | } | ||||
| /* mouse hover highlights */ | /* mouse hover highlights */ | ||||
| if (tselem->flag & TSE_HIGHLIGHTED) { | if (tselem->flag & TSE_HIGHLIGHTED) { | ||||
| glColor4fv(col_highlight); | immUniformColor4fv(col_highlight); | ||||
| glRecti(0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | immRecti(pos, 0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1); | ||||
| } | } | ||||
| *io_start_y -= UI_UNIT_Y; | *io_start_y -= UI_UNIT_Y; | ||||
| if (TSELEM_OPEN(tselem, soops)) { | if (TSELEM_OPEN(tselem, soops)) { | ||||
| outliner_draw_highlights_recursive( | outliner_draw_highlights_recursive( | ||||
| ar, soops, &te->subtree, col_selection, col_highlight, col_searchmatch, | pos, ar, soops, &te->subtree, col_selection, col_highlight, col_searchmatch, | ||||
| start_x + UI_UNIT_X, io_start_y); | start_x + UI_UNIT_X, io_start_y); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| col_searchmatch[3] = 0.5f; | col_searchmatch[3] = 0.5f; | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| outliner_draw_highlights_recursive(ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch, | VertexFormat *format = immVertexFormat(); | ||||
| unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| outliner_draw_highlights_recursive(pos, ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch, | |||||
| startx, starty); | startx, starty); | ||||
| immUnbindProgram(); | |||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| Context not available. | |||||