diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-21 13:53:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-21 15:44:37 +0300 |
commit | 727e569ac3f2d7965f0054da1db56c6fa99475c2 (patch) | |
tree | 6deb322a3166e0b27266e5597c0d727e8d440b8e /source | |
parent | 3fe5c0e5df8191053148b4605c476b555795ee16 (diff) |
Cleanup: CodeQuality: Replace OB_DRAWXRAY by OB_DRAW_IN_FRONT
This is to match the option name and to avoid confusion with
workbench xray mode.
Diffstat (limited to 'source')
17 files changed, 23 insertions, 22 deletions
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 8c00c20c822..44c7c35e47d 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1339,7 +1339,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) arm = blo_do_versions_newlibadr(fd, lib, ob->data); enum { ARM_DRAWXRAY = (1 << 1) }; if (arm->flag & ARM_DRAWXRAY) { - ob->dtx |= OB_DRAWXRAY; + ob->dtx |= OB_DRAW_IN_FRONT; } } else if (ob->type == OB_MESH) { diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 0dd3cc14234..94c380b3b50 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -165,7 +165,7 @@ static void basic_cache_populate(void *vedata, Object *ob) return; } - bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; const DRWContextState *draw_ctx = DRW_context_state_get(); if (ob != draw_ctx->object_edit) { diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index d97bf9255d2..8a4134ec8ea 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -106,7 +106,7 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob) copy_v3_v3(tgp_ob->plane_mat[3], center); /* Add to corresponding list if is in front. */ - if (ob->dtx & OB_DRAWXRAY) { + if (ob->dtx & OB_DRAW_IN_FRONT) { BLI_LINKS_APPEND(&pd->tobjects_infront, tgp_ob); } else { @@ -258,7 +258,7 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd, { bGPdata *gpd = (bGPdata *)ob->data; - const bool is_in_front = (ob->dtx & OB_DRAWXRAY); + const bool is_in_front = (ob->dtx & OB_DRAW_IN_FRONT); const bool is_screenspace = (gpd->flag & GP_DATA_STROKE_KEEPTHICKNESS) != 0; const bool overide_vertcol = (pd->v3d_color_type != -1); const bool is_vert_col_mode = (pd->v3d_color_type == V3D_SHADING_VERTEX_COLOR) || diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 0144fac76ab..960e5e424f2 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -2122,7 +2122,8 @@ static void armature_context_setup(ArmatureDrawContext *ctx, const float *const_color) { const bool is_object_mode = !do_envelope_dist; - const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0 || (pd->armature.do_pose_xray && is_pose_mode); + const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0 || + (pd->armature.do_pose_xray && is_pose_mode); const bool draw_as_wire = (ob->dt < OB_SOLID); const bool is_filled = (!pd->armature.transparent && !draw_as_wire) || !is_object_mode; const bool is_transparent = pd->armature.transparent || (draw_as_wire && !is_object_mode); diff --git a/source/blender/draw/engines/overlay/overlay_edit_curve.c b/source/blender/draw/engines/overlay/overlay_edit_curve.c index 9a79c78c996..6d907646817 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_curve.c +++ b/source/blender/draw/engines/overlay/overlay_edit_curve.c @@ -78,7 +78,7 @@ void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob) { OVERLAY_PrivateData *pd = vedata->stl->pd; bool draw_normals = (pd->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_NORMALS) != 0; - bool do_xray = (ob->dtx & OB_DRAWXRAY) != 0; + bool do_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; Curve *cu = ob->data; struct GPUBatch *geom; diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c b/source/blender/draw/engines/overlay/overlay_edit_mesh.c index fd872108b00..ebc8a2f97ef 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c +++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c @@ -270,7 +270,7 @@ void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob) struct GPUBatch *geom = NULL; bool draw_as_solid = (ob->dt > OB_WIRE); - bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; bool do_occlude_wire = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_OCCLUDE_WIRE) != 0; bool do_show_mesh_analysis = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_STATVIS) != 0; bool fnormals_do = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_FACE_NORMALS) != 0; @@ -312,7 +312,7 @@ void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob) overlay_edit_mesh_add_ob_to_pass(pd, ob, do_in_front); } - pd->edit_mesh.ghost_ob += (ob->dtx & OB_DRAWXRAY) ? 1 : 0; + pd->edit_mesh.ghost_ob += (ob->dtx & OB_DRAW_IN_FRONT) ? 1 : 0; pd->edit_mesh.edit_ob += 1; if (DRW_state_show_text() && (pd->edit_mesh.flag & OVERLAY_EDIT_TEXT)) { diff --git a/source/blender/draw/engines/overlay/overlay_edit_text.c b/source/blender/draw/engines/overlay/overlay_edit_text.c index 4ee936f5ce6..6ddd0e6d9be 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_text.c +++ b/source/blender/draw/engines/overlay/overlay_edit_text.c @@ -182,7 +182,7 @@ void OVERLAY_edit_text_cache_populate(OVERLAY_Data *vedata, Object *ob) OVERLAY_PrivateData *pd = vedata->stl->pd; Curve *cu = ob->data; struct GPUBatch *geom; - bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; bool has_surface = (cu->flag & (CU_FRONT | CU_BACK)) || cu->ext1 != 0.0f || cu->ext2 != 0.0f; if ((cu->flag & CU_FAST) || !has_surface) { diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index d4169014385..47f05eda58e 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -258,7 +258,7 @@ void OVERLAY_extra_line(OVERLAY_ExtraCallBuffers *cb, OVERLAY_ExtraCallBuffers *OVERLAY_extra_call_buffer_get(OVERLAY_Data *vedata, Object *ob) { - bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; OVERLAY_PrivateData *pd = vedata->stl->pd; return &pd->extra_call_buffers[do_in_front]; } diff --git a/source/blender/draw/engines/overlay/overlay_facing.c b/source/blender/draw/engines/overlay/overlay_facing.c index 4eb4b8ae85b..cfeaf8e1927 100644 --- a/source/blender/draw/engines/overlay/overlay_facing.c +++ b/source/blender/draw/engines/overlay/overlay_facing.c @@ -60,7 +60,7 @@ void OVERLAY_facing_cache_populate(OVERLAY_Data *vedata, Object *ob) const DRWContextState *draw_ctx = DRW_context_state_get(); const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d) && !DRW_state_is_image_render(); - const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0; + const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; if (use_sculpt_pbvh) { DRW_shgroup_call_sculpt(pd->facing_grp[is_xray], ob, false, false); diff --git a/source/blender/draw/engines/overlay/overlay_image.c b/source/blender/draw/engines/overlay/overlay_image.c index a754f7cbd49..67132a9e0ed 100644 --- a/source/blender/draw/engines/overlay/overlay_image.c +++ b/source/blender/draw/engines/overlay/overlay_image.c @@ -405,7 +405,7 @@ void OVERLAY_image_empty_cache_populate(OVERLAY_Data *vedata, Object *ob) /* Use the actual depth if we are doing depth tests to determine the distance to the object */ char depth_mode = DRW_state_is_depth() ? OB_EMPTY_IMAGE_DEPTH_DEFAULT : ob->empty_image_depth; DRWPass *pass = NULL; - if ((ob->dtx & OB_DRAWXRAY) != 0) { + if ((ob->dtx & OB_DRAW_IN_FRONT) != 0) { /* Object In Front overrides image empty depth mode. */ pass = psl->image_empties_front_ps; } diff --git a/source/blender/draw/engines/overlay/overlay_metaball.c b/source/blender/draw/engines/overlay/overlay_metaball.c index 76ffbe4cc6b..c10c0a84247 100644 --- a/source/blender/draw/engines/overlay/overlay_metaball.c +++ b/source/blender/draw/engines/overlay/overlay_metaball.c @@ -69,7 +69,7 @@ static void metaball_instance_data_set( void OVERLAY_edit_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob) { - const bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + const bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; const bool is_select = DRW_state_is_select(); OVERLAY_PrivateData *pd = vedata->stl->pd; MetaBall *mb = ob->data; @@ -112,7 +112,7 @@ void OVERLAY_edit_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob) void OVERLAY_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob) { - const bool do_in_front = (ob->dtx & OB_DRAWXRAY) != 0; + const bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; OVERLAY_PrivateData *pd = vedata->stl->pd; MetaBall *mb = ob->data; const DRWContextState *draw_ctx = DRW_context_state_get(); diff --git a/source/blender/draw/engines/overlay/overlay_paint.c b/source/blender/draw/engines/overlay/overlay_paint.c index 652d6af54a2..e94cc820568 100644 --- a/source/blender/draw/engines/overlay/overlay_paint.c +++ b/source/blender/draw/engines/overlay/overlay_paint.c @@ -63,7 +63,7 @@ void OVERLAY_paint_init(OVERLAY_Data *vedata) const DRWContextState *draw_ctx = DRW_context_state_get(); pd->painting.in_front = pd->use_in_front && draw_ctx->obact && - (draw_ctx->obact->dtx & OB_DRAWXRAY); + (draw_ctx->obact->dtx & OB_DRAW_IN_FRONT); pd->painting.alpha_blending = paint_object_is_rendered_transparent(draw_ctx->v3d, draw_ctx->obact); } diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index bf19d799474..4129983a901 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -131,7 +131,7 @@ void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata) static void wireframe_hair_cache_populate(OVERLAY_Data *vedata, Object *ob, ParticleSystem *psys) { OVERLAY_PrivateData *pd = vedata->stl->pd; - const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0; + const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; Object *dupli_parent = DRW_object_get_dupli_parent(ob); DupliObject *dupli_object = DRW_object_get_dupli(ob); @@ -167,7 +167,7 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, OVERLAY_PrivateData *pd = vedata->stl->pd; const DRWContextState *draw_ctx = DRW_context_state_get(); const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES) != 0; - const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0; + const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; const bool is_mesh = ob->type == OB_MESH; const bool is_mesh_verts_only = is_mesh && (((Mesh *)ob->data)->totedge == 0 && ((Mesh *)ob->data)->totvert > 0); diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index e04063c4487..3fa2e7ef084 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -168,7 +168,7 @@ DRWShadingGroup *workbench_material_setup_ex(WORKBENCH_PrivateData *wpd, Image *ima = NULL; ImageUser *iuser = NULL; eGPUSamplerState sampler; - const bool infront = (ob->dtx & OB_DRAWXRAY) != 0; + const bool infront = (ob->dtx & OB_DRAW_IN_FRONT) != 0; if (color_type == V3D_SHADING_TEXTURE_COLOR) { workbench_material_get_image(ob, mat_nr, &ima, &iuser, &sampler); @@ -273,7 +273,7 @@ DRWShadingGroup *workbench_image_setup_ex(WORKBENCH_PrivateData *wpd, tex = wpd->dummy_image_tx; } - const bool infront = (ob->dtx & OB_DRAWXRAY) != 0; + const bool infront = (ob->dtx & OB_DRAW_IN_FRONT) != 0; const bool transp = wpd->shading.xray_alpha < 1.0f; WORKBENCH_Prepass *prepass = &wpd->prepass[transp][infront][datatype]; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 4470269ec23..8a736c380bf 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2362,7 +2362,7 @@ static Object *modifier_skin_armature_create(Depsgraph *depsgraph, BKE_object_transform_copy(arm_ob, skin_ob); arm = arm_ob->data; arm->layer = 1; - arm_ob->dtx |= OB_DRAWXRAY; + arm_ob->dtx |= OB_DRAW_IN_FRONT; arm->drawtype = ARM_LINE; arm->edbo = MEM_callocN(sizeof(ListBase), "edbo armature"); diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 47e6db835c9..9424100e1c8 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -564,7 +564,7 @@ enum { /* for solid+wire display */ OB_DRAWWIRE = 1 << 5, /* for overdraw s*/ - OB_DRAWXRAY = 1 << 6, + OB_DRAW_IN_FRONT = 1 << 6, /* enable transparent draw */ OB_DRAWTRANSP = 1 << 7, OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */ diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 00d3a6e84b7..b7346ac4f5b 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -3242,7 +3242,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_in_front", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); + RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAW_IN_FRONT); RNA_def_property_ui_text(prop, "In Front", "Make the object draw in front of others"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_GPencil_update"); |