diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-28 18:15:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-28 18:19:42 +0300 |
commit | 9e85d4052fbc19d9244862d5858147e0d1ba83c3 (patch) | |
tree | 7789d23b09bbdc52a81de62586e84056f2ddf193 /source | |
parent | 2100dba34bbec7fffdff787c01d3270ab7d3dfbb (diff) |
Cleanup: DRW: Codestyle
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/edit_lattice_mode.c | 9 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 4 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 6 | ||||
-rw-r--r-- | source/blender/draw/modes/particle_mode.c | 5 |
4 files changed, 11 insertions, 13 deletions
diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index 3058c5c829c..56c3d48814d 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -179,16 +179,15 @@ static void EDIT_LATTICE_cache_init(void *vedata) } { - psl->wire_pass = DRW_pass_create("Lattice Wire", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | - DRW_STATE_DEPTH_LESS_EQUAL); + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; + psl->wire_pass = DRW_pass_create("Lattice Wire", state); stl->g_data->wire_shgrp = DRW_shgroup_create(sh_data->wire, psl->wire_pass); if (rv3d->rflag & RV3D_CLIPPING) { DRW_shgroup_state_enable(stl->g_data->wire_shgrp, DRW_STATE_CLIP_PLANES); } - psl->vert_pass = DRW_pass_create("Lattice Verts", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH); + state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH; + psl->vert_pass = DRW_pass_create("Lattice Verts", state); stl->g_data->vert_shgrp = DRW_shgroup_create(sh_data->overlay_vert, psl->vert_pass); DRW_shgroup_uniform_block(stl->g_data->vert_shgrp, "globalsBlock", G_draw.block_ubo); if (rv3d->rflag & RV3D_CLIPPING) { diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index afe735ec7f5..7b8dc01dfbc 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -397,8 +397,8 @@ static void edit_mesh_create_overlay_passes(float face_alpha, } /* Verts */ - passes->verts = DRW_pass_create("Edit Mesh Verts", - (DRW_STATE_WRITE_COLOR | statemod) & ~DRW_STATE_BLEND_ALPHA); + DRWState state = (DRW_STATE_WRITE_COLOR | statemod) & ~DRW_STATE_BLEND_ALPHA; + passes->verts = DRW_pass_create("Edit Mesh Verts", state); if (select_vert) { grp = shgrps->verts = DRW_shgroup_create(vert_sh, passes->verts); DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo); diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 454cf664014..8f0dc63fb1c 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1572,9 +1572,9 @@ static void OBJECT_cache_init(void *vedata) { /* Particle Pass */ - psl->particle = DRW_pass_create("Particle Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | - DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA); + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | + DRW_STATE_BLEND_ALPHA; + psl->particle = DRW_pass_create("Particle Pass", state); } } diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index ee35fa6d169..fa2c4d9b6a8 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -123,9 +123,8 @@ static void particle_cache_init(void *vedata) } /* Create a pass */ - psl->psys_edit_pass = DRW_pass_create( - "PSys Edit Pass", - (DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL)); + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; + psl->psys_edit_pass = DRW_pass_create("PSys Edit Pass", state); GPUShader *strand_shader = (use_weight) ? e_data.strands_weight_shader : e_data.strands_shader; stl->g_data->strands_group = DRW_shgroup_create(strand_shader, psl->psys_edit_pass); |