Merge branch 'blender2.8' into soc-2018-bevel
[blender.git] / source / blender / editors / space_outliner / outliner_draw.c
index 75349ce99c5511d08d4ca2317a02abf05b12a89f..87f7e1e4fb8013ab7c4fcbb695c691b0706eb711 100644 (file)
@@ -742,11 +742,11 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex)
 
        GPU_line_width(1.0f);
 
-       unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+       uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
        immUniformThemeColorShadeAlpha(TH_BACK, -15, -200);
 
-       immBegin(GWN_PRIM_LINES, 4);
+       immBegin(GPU_PRIM_LINES, 4);
 
        immVertex2f(pos, sizex, v2d->cur.ymax);
        immVertex2f(pos, sizex, miny);
@@ -1142,7 +1142,7 @@ static void tselem_draw_icon(
                                ICON_DRAW(ICON_RENDER_RESULT);
                                break;
                        case TSE_LINKED_LAMP:
-                               ICON_DRAW(ICON_LAMP_DATA);
+                               ICON_DRAW(ICON_LIGHT_DATA);
                                break;
                        case TSE_LINKED_MAT:
                                ICON_DRAW(ICON_MATERIAL_DATA);
@@ -1201,7 +1201,7 @@ static void tselem_draw_icon(
                        Object *ob = (Object *)tselem->id;
                        switch (ob->type) {
                                case OB_LAMP:
-                                       ICON_CLICK_DRAW(ICON_OUTLINER_OB_LAMP); break;
+                                       ICON_CLICK_DRAW(ICON_OUTLINER_OB_LIGHT); break;
                                case OB_MESH:
                                        ICON_CLICK_DRAW(ICON_OUTLINER_OB_MESH); break;
                                case OB_CAMERA:
@@ -1252,17 +1252,17 @@ static void tselem_draw_icon(
                                        Lamp *la = (Lamp *)tselem->id;
                                        switch (la->type) {
                                                case LA_LOCAL:
-                                                       tselem_draw_icon_uibut(&arg, ICON_LAMP_POINT); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_LIGHT_POINT); break;
                                                case LA_SUN:
-                                                       tselem_draw_icon_uibut(&arg, ICON_LAMP_SUN); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_LIGHT_SUN); break;
                                                case LA_SPOT:
-                                                       tselem_draw_icon_uibut(&arg, ICON_LAMP_SPOT); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_LIGHT_SPOT); break;
                                                case LA_HEMI:
-                                                       tselem_draw_icon_uibut(&arg, ICON_LAMP_HEMI); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_LIGHT_HEMI); break;
                                                case LA_AREA:
-                                                       tselem_draw_icon_uibut(&arg, ICON_LAMP_AREA); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_LIGHT_AREA); break;
                                                default:
-                                                       tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LAMP); break;
+                                                       tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LIGHT); break;
                                        }
                                        break;
                                }
@@ -1740,8 +1740,8 @@ static void outliner_draw_tree_element(
 
                                        /* divider */
                                        {
-                                               Gwn_VertFormat *format = immVertexFormat();
-                                               unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+                                               GPUVertFormat *format = immVertexFormat();
+                                               uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
                                                unsigned char col[4];
 
                                                immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -1798,7 +1798,7 @@ static void outliner_draw_tree_element_floating(
        const TreeElement *te_insert = te_floating->drag_data->insert_handle;
        const int line_width = 2;
 
-       unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+       uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
        int coord_y = te_insert->ys;
        int coord_x = te_insert->xs;
        float col[4];
@@ -1819,7 +1819,7 @@ static void outliner_draw_tree_element_floating(
                immUniformColor4fv(col);
                GPU_line_width(line_width);
 
-               immBegin(GWN_PRIM_LINE_STRIP, 2);
+               immBegin(GPU_PRIM_LINE_STRIP, 2);
                immVertex2f(pos, coord_x, coord_y);
                immVertex2f(pos, ar->v2d.cur.xmax, coord_y);
                immEnd();
@@ -1828,7 +1828,7 @@ static void outliner_draw_tree_element_floating(
                BLI_assert(te_floating->drag_data->insert_type == TE_INSERT_INTO);
                immUniformColor3fvAlpha(col, col[3] * 0.5f);
 
-               immBegin(GWN_PRIM_TRI_STRIP, 4);
+               immBegin(GPU_PRIM_TRI_STRIP, 4);
                immVertex2f(pos, coord_x, coord_y + UI_UNIT_Y);
                immVertex2f(pos, coord_x, coord_y);
                immVertex2f(pos, ar->v2d.cur.xmax, coord_y + UI_UNIT_Y);
@@ -1902,8 +1902,8 @@ static void outliner_draw_hierarchy_lines_recursive(
 
 static void outliner_draw_hierarchy_lines(SpaceOops *soops, ListBase *lb, int startx, int *starty)
 {
-       Gwn_VertFormat *format = immVertexFormat();
-       unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+       GPUVertFormat *format = immVertexFormat();
+       uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
        unsigned char col[4];
 
        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -1925,8 +1925,8 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase *
                /* selection status */
                if (TSELEM_OPEN(tselem, soops)) {
                        if (tselem->type == TSE_RNA_STRUCT) {
-                               Gwn_VertFormat *format = immVertexFormat();
-                               unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+                               GPUVertFormat *format = immVertexFormat();
+                               uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
                                immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
                                immThemeColorShadeAlpha(TH_BACK, -15, -200);
                                immRecti(pos, 0, *starty + 1, (int)ar->v2d.cur.xmax, *starty + UI_UNIT_Y - 1);
@@ -1938,12 +1938,12 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase *
                if (TSELEM_OPEN(tselem, soops)) {
                        outliner_draw_struct_marks(ar, soops, &te->subtree, starty);
                        if (tselem->type == TSE_RNA_STRUCT) {
-                               Gwn_VertFormat *format = immVertexFormat();
-                               unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+                               GPUVertFormat *format = immVertexFormat();
+                               uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
                                immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
                                immThemeColorShadeAlpha(TH_BACK, -15, -200);
 
-                               immBegin(GWN_PRIM_LINES, 2);
+                               immBegin(GPU_PRIM_LINES, 2);
                                immVertex2f(pos, 0, (float)*starty + UI_UNIT_Y);
                                immVertex2f(pos, ar->v2d.cur.xmax, (float)*starty + UI_UNIT_Y);
                                immEnd();
@@ -2008,8 +2008,8 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOops *soops, int startx,
        col_searchmatch[3] = 0.5f;
 
        GPU_blend(true);
-       Gwn_VertFormat *format = immVertexFormat();
-       unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+       GPUVertFormat *format = immVertexFormat();
+       uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
        outliner_draw_highlights_recursive(
                pos, ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch,
@@ -2083,8 +2083,8 @@ static void outliner_back(ARegion *ar)
        ystart = (int)ar->v2d.tot.ymax;
        ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET;
 
-       Gwn_VertFormat *format = immVertexFormat();
-       unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+       GPUVertFormat *format = immVertexFormat();
+       uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 
        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
        immUniformThemeColorShade(TH_BACK, 6);
@@ -2094,7 +2094,7 @@ static void outliner_back(ARegion *ar)
        int tot = (int)floor(ystart - ar->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y);
 
        if (tot > 0) {
-               immBegin(GWN_PRIM_TRIS, 6 * tot);
+               immBegin(GPU_PRIM_TRIS, 6 * tot);
                while (tot--) {
                        y1 -= 2 * UI_UNIT_Y;
                        y2 = y1 + UI_UNIT_Y;
@@ -2115,10 +2115,10 @@ static void outliner_draw_restrictcols(ARegion *ar)
 {
        GPU_line_width(1.0f);
 
-       unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+       uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
        immUniformThemeColorShadeAlpha(TH_BACK, -15, -200);
-       immBegin(GWN_PRIM_LINES, 8);
+       immBegin(GPU_PRIM_LINES, 8);
 
        immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), (int)ar->v2d.cur.ymax);
        immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), (int)ar->v2d.cur.ymin);