From fb262f942e44f86931f3519383da9ad350733afb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Nov 2018 08:00:49 +1100 Subject: Cleanup: style, includes --- source/blender/blenlib/BLI_timer.h | 4 +-- source/blender/blenlib/intern/BLI_timer.c | 4 +-- .../intern/builder/deg_builder_relations.cc | 3 ++- .../draw/engines/gpencil/gpencil_draw_utils.c | 30 +++++++++++----------- .../blender/draw/engines/gpencil/gpencil_engine.c | 4 +-- .../draw/engines/workbench/workbench_data.c | 11 +++++--- .../draw/engines/workbench/workbench_forward.c | 1 - .../draw/intern/draw_cache_impl_particles.c | 4 +-- source/blender/draw/intern/draw_hair.c | 2 +- source/blender/editors/io/io_collada.c | 2 +- 10 files changed, 34 insertions(+), 31 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_timer.h b/source/blender/blenlib/BLI_timer.h index 6dfb13fd738..8f18d4fb3f4 100644 --- a/source/blender/blenlib/BLI_timer.h +++ b/source/blender/blenlib/BLI_timer.h @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * The Original Code is Copyright (C) 2008 Blender Foundation. + * The Original Code is Copyright (C) 2018 Blender Foundation. * All rights reserved. * * ***** END GPL LICENSE BLOCK ***** @@ -24,7 +24,7 @@ #ifndef __BLI_TIMER_H__ #define __BLI_TIMER_H__ -#include "BLI_utildefines.h" +#include "BLI_sys_types.h" /** \file BLI_timer.h * \ingroup BLI diff --git a/source/blender/blenlib/intern/BLI_timer.c b/source/blender/blenlib/intern/BLI_timer.c index 875b667de46..7bb919d47e0 100644 --- a/source/blender/blenlib/intern/BLI_timer.c +++ b/source/blender/blenlib/intern/BLI_timer.c @@ -15,11 +15,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * The Original Code is Copyright (C) 2018 Blender Foundation. * All rights reserved. * - * The Original Code is: all of this file, with exception of below: - * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5e1ebee337c..b5a221a2215 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1034,7 +1034,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, } /* if needs bbone shape, reference the segment computation */ if (BKE_constraint_target_uses_bbone(con, ct) && - bone_has_segments(ct->tar, ct->subtarget)) { + bone_has_segments(ct->tar, ct->subtarget)) + { opcode = DEG_OPCODE_BONE_SEGMENTS; } OperationKey target_key(&ct->tar->id, 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) { diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 46ce115c382..c8185c2db60 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -687,7 +687,7 @@ static float particle_key_select_ratio(const PTCacheEdit *edit, int strand, floa int index = (int)interp; interp -= floorf(interp); /* Time between 2 edit key */ float s1 = (point->keys[index].flag & PEK_SELECT) ? 1.0f : 0.0; - float s2 = (point->keys[index+1].flag & PEK_SELECT) ? 1.0f : 0.0; + float s2 = (point->keys[index + 1].flag & PEK_SELECT) ? 1.0f : 0.0; return s1 + interp * (s2 - s1); } } @@ -697,7 +697,7 @@ static int particle_batch_cache_fill_segments_edit( ParticleCacheKey **path_cache, const int start_index, const int num_path_keys, - GPUIndexBufBuilder *elb, + GPUIndexBufBuilder *elb, GPUVertBufRaw *attr_step) { int curr_point = start_index; diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c index 3f56837861c..f6891563dbb 100644 --- a/source/blender/draw/intern/draw_hair.c +++ b/source/blender/draw/intern/draw_hair.c @@ -86,7 +86,7 @@ void DRW_hair_init(void) g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_TRANS_FEEDBACK); } -typedef struct DRWHairInstanceData{ +typedef struct DRWHairInstanceData { DrawData dd; float mat[4][4]; diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index 2ddf5e2584e..47cf2780ac2 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -155,7 +155,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) include_all_actions = RNA_boolean_get(op->ptr, "include_all_actions"); export_animation_type = RNA_enum_get(op->ptr, "export_animation_type_selection"); sample_animations = (export_animation_type == BC_ANIMATION_EXPORT_SAMPLES); - sampling_rate = (sample_animations)? RNA_int_get(op->ptr, "sampling_rate") : 0; + sampling_rate = (sample_animations) ? RNA_int_get(op->ptr, "sampling_rate") : 0; keep_smooth_curves = RNA_boolean_get(op->ptr, "keep_smooth_curves"); keep_keyframes = RNA_boolean_get(op->ptr, "keep_keyframes"); -- cgit v1.2.3