diff options
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/space_info/info_stats.cc | 55 | ||||
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_info/textview.c | 17 |
4 files changed, 17 insertions, 60 deletions
diff --git a/source/blender/editors/space_info/CMakeLists.txt b/source/blender/editors/space_info/CMakeLists.txt index febb025f5bd..4e9df2b93b0 100644 --- a/source/blender/editors/space_info/CMakeLists.txt +++ b/source/blender/editors/space_info/CMakeLists.txt @@ -14,7 +14,6 @@ set(INC ../../makesdna ../../makesrna ../../windowmanager - ../../../../intern/glew-mx ../../../../intern/guardedalloc # RNA_prototypes.h ${CMAKE_BINARY_DIR}/source/blender/makesrna diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc index 29a7eb150a1..a796ed5a817 100644 --- a/source/blender/editors/space_info/info_stats.cc +++ b/source/blender/editors/space_info/info_stats.cc @@ -161,42 +161,6 @@ static void stats_object(Object *ob, stats->totlampsel++; } break; - case OB_SURF: - case OB_CURVES_LEGACY: - case OB_FONT: { - const Mesh *me_eval = BKE_object_get_evaluated_mesh(ob); - if ((me_eval != nullptr) && !BLI_gset_add(objects_gset, (void *)me_eval)) { - break; - } - - if (stats_mesheval(me_eval, is_selected, stats)) { - break; - } - ATTR_FALLTHROUGH; /* Fall-through to displist. */ - } - case OB_MBALL: { - int totv = 0, totf = 0, tottri = 0; - - if (ob->runtime.curve_cache && ob->runtime.curve_cache->disp.first) { - /* NOTE: We only get the same curve_cache for instances of the same curve/font/... - * For simple linked duplicated objects, each has its own dispList. */ - if (!BLI_gset_add(objects_gset, ob->runtime.curve_cache)) { - break; - } - - BKE_displist_count(&ob->runtime.curve_cache->disp, &totv, &totf, &tottri); - } - - stats->totvert += totv; - stats->totface += totf; - stats->tottri += tottri; - - if (is_selected) { - stats->totvertsel += totv; - stats->totfacesel += totf; - } - break; - } case OB_GPENCIL: { if (is_selected) { bGPdata *gpd = (bGPdata *)ob->data; @@ -381,7 +345,7 @@ static void stats_object_sculpt(const Object *ob, SceneStats *stats) stats->tottri = ob->sculpt->bm->totface; break; case PBVH_GRIDS: - stats->totvertsculpt = BKE_pbvh_get_grid_num_vertices(ss->pbvh); + stats->totvertsculpt = BKE_pbvh_get_grid_num_verts(ss->pbvh); stats->totfacesculpt = BKE_pbvh_get_grid_num_faces(ss->pbvh); break; } @@ -393,8 +357,8 @@ static void stats_update(Depsgraph *depsgraph, View3D *v3d_local, SceneStats *stats) { - const Object *ob = OBACT(view_layer); - const Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + const Object *ob = BKE_view_layer_active_object_get(view_layer); + const Object *obedit = BKE_view_layer_edit_object_get(view_layer); memset(stats, 0x0, sizeof(*stats)); @@ -439,14 +403,7 @@ static void stats_update(Depsgraph *depsgraph, } else if (ob && (ob->mode & OB_MODE_SCULPT)) { /* Sculpt Mode. */ - if (stats_is_object_dynamic_topology_sculpt(ob)) { - /* Dynamic topology. Do not count all vertices, - * dynamic topology stats are initialized later as part of sculpt stats. */ - } - else { - /* When dynamic topology is not enabled both sculpt stats and scene stats are collected. */ - stats_object_sculpt(ob, stats); - } + stats_object_sculpt(ob, stats); } else { /* Objects. */ @@ -535,7 +492,7 @@ static bool format_stats( static void get_stats_string( char *info, int len, size_t *ofs, ViewLayer *view_layer, SceneStatsFmt *stats_fmt) { - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); Object *obedit = OBEDIT_FROM_OBACT(ob); eObjectMode object_mode = ob ? (eObjectMode)ob->mode : OB_MODE_OBJECT; LayerCollection *layer_collection = view_layer->active_collection; @@ -727,7 +684,7 @@ void ED_info_draw_stats( return; } - Object *ob = OBACT(view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); Object *obedit = OBEDIT_FROM_OBACT(ob); eObjectMode object_mode = ob ? (eObjectMode)ob->mode : OB_MODE_OBJECT; const int font_id = BLF_set_default(); diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 73d81c93981..1513ba5e892 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -186,7 +186,7 @@ static void info_header_region_draw(const bContext *C, ARegion *region) static void info_main_region_listener(const wmRegionListenerParams *params) { ARegion *region = params->region; - wmNotifier *wmn = params->notifier; + const wmNotifier *wmn = params->notifier; /* context changes */ switch (wmn->category) { @@ -202,7 +202,7 @@ static void info_main_region_listener(const wmRegionListenerParams *params) static void info_header_listener(const wmRegionListenerParams *params) { ARegion *region = params->region; - wmNotifier *wmn = params->notifier; + const wmNotifier *wmn = params->notifier; /* context changes */ switch (wmn->category) { diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 8fc61f78a6c..9aa2b84169e 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -74,7 +74,7 @@ static void textview_draw_sel(const char *str, 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); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4ubv(bg_sel); immRecti(pos, xy[0] + (cwidth * sta), xy[1] + lheight, xy[0] + (cwidth * end), xy[1]); @@ -197,7 +197,7 @@ static bool textview_draw_string(TextViewDrawState *tds, if (bg) { 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); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4ubv(bg); immRecti(pos, tds->draw_rect_outer->xmin, line_bottom, tds->draw_rect_outer->xmax, line_top); immUnbindProgram(); @@ -245,9 +245,6 @@ static bool textview_draw_string(TextViewDrawState *tds, const int final_offset = offsets[tot_lines - 1]; len = str_len - final_offset; s = str + final_offset; - BLF_position(tds->font_id, tds->xy[0], tds->lofs + line_bottom + tds->row_vpadding, 0); - BLF_color4ubv(tds->font_id, fg); - BLF_draw_mono(tds->font_id, s, len, tds->cwidth); if (tds->sel[0] != tds->sel[1]) { textview_step_sel(tds, -final_offset); @@ -255,6 +252,10 @@ static bool textview_draw_string(TextViewDrawState *tds, textview_draw_sel(s, pos, len, tds, bg_sel); } + BLF_position(tds->font_id, tds->xy[0], tds->lofs + line_bottom + tds->row_vpadding, 0); + BLF_color4ubv(tds->font_id, fg); + BLF_draw_mono(tds->font_id, s, len, tds->cwidth); + tds->xy[1] += tds->lheight; BLF_color4ubv(tds->font_id, fg); @@ -263,14 +264,14 @@ static bool textview_draw_string(TextViewDrawState *tds, len = offsets[i] - offsets[i - 1]; s = str + offsets[i - 1]; - BLF_position(tds->font_id, tds->xy[0], tds->lofs + tds->xy[1], 0); - BLF_draw_mono(tds->font_id, s, len, tds->cwidth); - if (tds->sel[0] != tds->sel[1]) { textview_step_sel(tds, len); textview_draw_sel(s, tds->xy, len, tds, bg_sel); } + BLF_position(tds->font_id, tds->xy[0], tds->lofs + tds->xy[1], 0); + BLF_draw_mono(tds->font_id, s, len, tds->cwidth); + tds->xy[1] += tds->lheight; /* Check if we're out of view bounds. */ |