Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager_text.c
| Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | void DRW_text_cache_add(DRWTextStore *dt, | ||||
| if (flag & DRW_TEXT_CACHE_STRING_PTR) { | if (flag & DRW_TEXT_CACHE_STRING_PTR) { | ||||
| memcpy(vos->str, &str, alloc_len); | memcpy(vos->str, &str, alloc_len); | ||||
| } | } | ||||
| else { | else { | ||||
| memcpy(vos->str, str, alloc_len); | memcpy(vos->str, str, alloc_len); | ||||
| } | } | ||||
| } | } | ||||
| void DRW_text_cache_draw(DRWTextStore *dt, ARegion *ar) | void DRW_text_cache_draw(DRWTextStore *dt, ARegion *ar, struct View3D *v3d) | ||||
| { | { | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| ViewCachedString *vos; | ViewCachedString *vos; | ||||
| int tot = 0; | int tot = 0; | ||||
| /* project first and test */ | /* project first and test */ | ||||
| BLI_memiter_handle it; | BLI_memiter_handle it; | ||||
| BLI_memiter_iter_init(dt->cache_strings, &it); | BLI_memiter_iter_init(dt->cache_strings, &it); | ||||
| Show All 11 Lines | while ((vos = BLI_memiter_iter_step(&it))) { | ||||
| else { | else { | ||||
| vos->sco[0] = IS_CLIPPED; | vos->sco[0] = IS_CLIPPED; | ||||
| } | } | ||||
| } | } | ||||
| if (tot) { | if (tot) { | ||||
| int col_pack_prev = 0; | int col_pack_prev = 0; | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { | ||||
| ED_view3d_clipping_disable(); | ED_view3d_clipping_disable(); | ||||
| } | } | ||||
| float original_proj[4][4]; | float original_proj[4][4]; | ||||
| GPU_matrix_projection_get(original_proj); | GPU_matrix_projection_get(original_proj); | ||||
| wmOrtho2_region_pixelspace(ar); | wmOrtho2_region_pixelspace(ar); | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| Show All 21 Lines | while ((vos = BLI_memiter_iter_step(&it))) { | ||||
| (vos->flag & DRW_TEXT_CACHE_STRING_PTR) ? *((const char **)vos->str) : vos->str, | (vos->flag & DRW_TEXT_CACHE_STRING_PTR) ? *((const char **)vos->str) : vos->str, | ||||
| vos->str_len); | vos->str_len); | ||||
| } | } | ||||
| } | } | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| GPU_matrix_projection_set(original_proj); | GPU_matrix_projection_set(original_proj); | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { | ||||
| ED_view3d_clipping_enable(); | ED_view3d_clipping_enable(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Copied from drawobject.c */ | /* Copied from drawobject.c */ | ||||
| void DRW_text_edit_mesh_measure_stats(ARegion *ar, | void DRW_text_edit_mesh_measure_stats(ARegion *ar, | ||||
| View3D *v3d, | View3D *v3d, | ||||
| ▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | if (em->selectmode & SCE_SELECT_FACE) { | ||||
| numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), "%d", i); | numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), "%d", i); | ||||
| DRW_text_cache_add(dt, v1, numstr, numstr_len, 0, 0, txt_flag, col); | DRW_text_cache_add(dt, v1, numstr, numstr_len, 0, 0, txt_flag, col); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| No newline at end of file | No newline at end of file | ||||