diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-27 00:00:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-27 00:01:54 +0300 |
commit | fb262f942e44f86931f3519383da9ad350733afb (patch) | |
tree | e56902d5c8f029c1985c849c4a70c6d6ca668ca9 /source/blender/draw/engines | |
parent | 0b0322099ccb99833e52196b46c144886b94428c (diff) |
Cleanup: style, includes
Diffstat (limited to 'source/blender/draw/engines')
4 files changed, 25 insertions, 21 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index e4d6fa582b8..932a6cc3df0 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -252,7 +252,7 @@ static void DRW_gpencil_recalc_geometry_caches( if ((gps->tot_triangles == 0) || (gps->triangles == NULL)) { if ((gps->totpoints > 2) && ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || - (gp_style->fill_style > 0) || (gpl->blend_mode != eGplBlendMode_Normal))) + (gp_style->fill_style > 0) || (gpl->blend_mode != eGplBlendMode_Normal))) { DRW_gpencil_triangulate_stroke_fill(ob, gps); } @@ -562,8 +562,9 @@ static void gpencil_add_fill_vertexdata( interp_v3_v3v3(tfill, gps->runtime.tmp_fill_rgba, tintcolor, tintcolor[3]); tfill[3] = gps->runtime.tmp_fill_rgba[3] * opacity; if ((tfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) || - (gp_style->fill_style > 0) || - (gpl->blend_mode != eGplBlendMode_Normal)) { + (gp_style->fill_style > 0) || + (gpl->blend_mode != eGplBlendMode_Normal)) + { if (cache->is_dirty) { const float *color; if (!onion) { @@ -586,7 +587,7 @@ static void gpencil_add_fill_vertexdata( if (old_len < cache->b_fill.vbo_len) { cache->grp_cache = gpencil_group_cache_add( cache->grp_cache, gpl, gpf, gps, - eGpencilBatchGroupType_Fill, onion, + eGpencilBatchGroupType_Fill, onion, cache->b_fill.vbo_len, &cache->grp_size, &cache->grp_used); } @@ -643,7 +644,7 @@ static void gpencil_add_stroke_vertexdata( if (old_len < cache->b_stroke.vbo_len) { cache->grp_cache = gpencil_group_cache_add( cache->grp_cache, gpl, gpf, gps, - eGpencilBatchGroupType_Stroke, onion, + eGpencilBatchGroupType_Stroke, onion, cache->b_stroke.vbo_len, &cache->grp_size, &cache->grp_used); } @@ -694,7 +695,7 @@ static void gpencil_add_editpoints_vertexdata( /* add to list of groups */ cache->grp_cache = gpencil_group_cache_add( cache->grp_cache, gpl, gpf, gps, - eGpencilBatchGroupType_Edlin, false, + eGpencilBatchGroupType_Edlin, false, cache->b_edlin.vbo_len, &cache->grp_size, &cache->grp_used); } @@ -707,7 +708,7 @@ static void gpencil_add_editpoints_vertexdata( /* add to list of groups */ cache->grp_cache = gpencil_group_cache_add( cache->grp_cache, gpl, gpf, gps, - eGpencilBatchGroupType_Edit, false, + eGpencilBatchGroupType_Edit, false, cache->b_edit.vbo_len, &cache->grp_size, &cache->grp_used); } @@ -786,7 +787,7 @@ static void gpencil_draw_strokes( if ((stl->storage->simplify_fill) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_REMOVE_FILL_LINE)) { if ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gp_style->fill_style > GP_STYLE_FILL_STYLE_SOLID) || - (gpl->blend_mode != eGplBlendMode_Normal)) + (gpl->blend_mode != eGplBlendMode_Normal)) { GP_SET_SRC_GPS(src_gps); continue; @@ -809,12 +810,12 @@ static void gpencil_draw_strokes( /* hide any blend layer */ if ((!stl->storage->simplify_blend) || - (gpl->blend_mode == eGplBlendMode_Normal)) + (gpl->blend_mode == eGplBlendMode_Normal)) { /* fill */ if ((gp_style->flag & GP_STYLE_FILL_SHOW) && - (!stl->storage->simplify_fill) && - ((gps->flag & GP_STROKE_NOFILL) == 0)) + (!stl->storage->simplify_fill) && + ((gps->flag & GP_STROKE_NOFILL) == 0)) { gpencil_add_fill_vertexdata( cache, ob, gpl, derived_gpf, gps, @@ -822,8 +823,8 @@ static void gpencil_draw_strokes( } /* stroke */ if ((gp_style->flag & GP_STYLE_STROKE_SHOW) && - ((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || - (gpl->blend_mode == eGplBlendMode_Normal))) + ((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || + (gpl->blend_mode == eGplBlendMode_Normal))) { gpencil_add_stroke_vertexdata( cache, ob, gpl, derived_gpf, gps, @@ -1301,8 +1302,7 @@ static void DRW_gpencil_shgroups_create( tag_first = true; } else { - if (elm->gpl != gpl_prev) - { + if (elm->gpl != gpl_prev) { /* first layer is always blend Normal */ array_elm->mode = idx == 0 ? eGplBlendMode_Normal: gpl->blend_mode; array_elm->end_shgrp = shgrp; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index a80ad133d09..a7141ff93bb 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -781,8 +781,8 @@ void GPENCIL_draw_scene(void *ved) array_elm = &cache_ob->shgrp_array[e]; if (((array_elm->mode == eGplBlendMode_Normal) && - (!use_blend) && (!array_elm->clamp_layer)) || - ( e == 0)) + (!use_blend) && (!array_elm->clamp_layer)) || + (e == 0)) { if (init_shgrp == NULL) { init_shgrp = array_elm->init_shgrp; diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index e92cb704216..18f4ced6074 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -84,8 +84,8 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color); wd->object_outline_color[3] = 1.0f; - wd->curvature_ridge = 0.5f / max_ff(wpd->shading.curvature_ridge_factor*wpd->shading.curvature_ridge_factor, 1e-4f); - wd->curvature_valley = 0.7f / max_ff(wpd->shading.curvature_valley_factor*wpd->shading.curvature_valley_factor, 1e-4f); + wd->curvature_ridge = 0.5f / max_ff(SQUARE(wpd->shading.curvature_ridge_factor), 1e-4f); + wd->curvature_valley = 0.7f / max_ff(SQUARE(wpd->shading.curvature_valley_factor), 1e-4f); wpd->world_ubo = DRW_uniformbuffer_create(sizeof(WORKBENCH_UBO_World), &wpd->world_data); @@ -111,7 +111,12 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) wpd->ssao_params[3] = 0; /* distance, factor, factor, attenuation */ - copy_v4_fl4(wpd->ssao_settings, scene->display.matcap_ssao_distance, wpd->shading.cavity_valley_factor, wpd->shading.cavity_ridge_factor, scene->display.matcap_ssao_attenuation); + copy_v4_fl4( + wpd->ssao_settings, + scene->display.matcap_ssao_distance, + wpd->shading.cavity_valley_factor, + wpd->shading.cavity_ridge_factor, + scene->display.matcap_ssao_attenuation); /* invert the view matrix */ DRW_viewport_matrix_get(wpd->winmat, DRW_MAT_WIN); diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 2da40a51e60..22b2a4020af 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -416,7 +416,6 @@ static void workbench_forward_cache_populate_particles(WORKBENCH_Data *vedata, O WORKBENCH_StorageList *stl = vedata->stl; WORKBENCH_PassList *psl = vedata->psl; WORKBENCH_PrivateData *wpd = stl->g_data; - const DRWContextState *draw_ctx = DRW_context_state_get(); for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type != eModifierType_ParticleSystem) { |