Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-02-04 22:06:30 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-02-05 17:02:15 +0300
commita131514d0f79f7b82be526438c125e35beab9f8f (patch)
tree16fb27a321d52435ba4f3e3e1f2cbaf4c36572ac /source/blender/draw/intern
parent112cf6eadff5642af21235aa1cd4eaecd575755d (diff)
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.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/DRW_render.h2
-rw-r--r--source/blender/draw/intern/draw_cache_impl.h1
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c14
3 files changed, 12 insertions, 5 deletions
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);
}
}