From a131514d0f79f7b82be526438c125e35beab9f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 4 Feb 2019 20:06:30 +0100 Subject: Edit Mesh: Fix some problem with new implementation - Add manual depth offset to vertices and edges. - Revert to plain edge decoration. - Fix active edge coloring. - Remove active face display if not in face selection mode. - Add wide line support. --- source/blender/draw/intern/DRW_render.h | 2 +- source/blender/draw/intern/draw_cache_impl.h | 1 - source/blender/draw/intern/draw_manager_exec.c | 14 +++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'source/blender/draw/intern') diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 4740879928c..87a1add4e81 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -289,7 +289,7 @@ typedef enum { DRW_STATE_OFFSET_POSITIVE = (1 << 12), /** Polygon offset. Does not work with lines and points. */ DRW_STATE_OFFSET_NEGATIVE = (1 << 13), - /* DRW_STATE_STIPPLE_4 = (1 << 14), */ /* Not used */ + DRW_STATE_WIRE_WIDE = (1 << 14), DRW_STATE_BLEND = (1 << 15), DRW_STATE_ADDITIVE = (1 << 16), DRW_STATE_MULTIPLY = (1 << 17), diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index ee91245fb1a..6481643a58e 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -120,7 +120,6 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edit_lnors(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(struct Mesh *me); /* edit-mesh selection */ struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_mask(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me); diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 8147da90899..9bdd5d2ae93 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -183,15 +183,23 @@ void drw_state_set(DRWState state) /* Wire Width */ { - if (CHANGED_ANY(DRW_STATE_WIRE | DRW_STATE_WIRE_SMOOTH)) { - if ((state & DRW_STATE_WIRE_SMOOTH) != 0) { + int test; + if (CHANGED_ANY_STORE_VAR( + DRW_STATE_WIRE | DRW_STATE_WIRE_WIDE | DRW_STATE_WIRE_SMOOTH, + test)) + { + if (test & DRW_STATE_WIRE_WIDE) { + GPU_line_width(3.0f); + } + else if (test & DRW_STATE_WIRE_SMOOTH) { GPU_line_width(2.0f); GPU_line_smooth(true); } - else if ((state & DRW_STATE_WIRE) != 0) { + else if (test & DRW_STATE_WIRE) { GPU_line_width(1.0f); } else { + GPU_line_width(1.0f); GPU_line_smooth(false); } } -- cgit v1.2.3