diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-06 23:17:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-06 23:17:06 +0300 |
commit | ba80d8440ff6f0ae566cf5f9562046c623e30b93 (patch) | |
tree | 8f82b19997710c243c75c514393f0e5fc24d9375 /source | |
parent | 1c4b04f1fde15a3be86a650b54f6e23030a97973 (diff) |
Cleanup: style
Diffstat (limited to 'source')
11 files changed, 47 insertions, 43 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 75018bbe5bd..e79f86c6520 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -705,7 +705,8 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool /* --------------------- */ -static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint*,int,float,float)) +static void rigidbody_constraint_set_limits( + RigidBodyCon *rbc, void (*set_limits)(rbConstraint *, int, float, float)) { if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X) set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper); diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 0eca7a00515..00af9721f07 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1767,13 +1767,13 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f if (output != output) output = 1; if (wipe->forward) output = 1 - output; break; - /* BOX WIPE IS NOT WORKING YET */ + /* BOX WIPE IS NOT WORKING YET */ /* case DO_CROSS_WIPE: */ /* BOX WIPE IS NOT WORKING YET */ #if 0 - case DO_BOX_WIPE: - if (!wipe->forward) - facf0 = 1.0f - facf0; /* Go the other direction */ + case DO_BOX_WIPE: + if (!wipe->forward) + facf0 = 1.0f - facf0; /* Go the other direction */ width = (int)(wipe->edgeWidth * ((xo + yo) / 2.0)); hwidth = (float)width / 2.0; @@ -1806,8 +1806,9 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f output = in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1); } - if (!wipe->forward) - facf0 = 1.0f - facf0; /* Go the other direction */ + if (!wipe->forward) { + facf0 = 1.0f - facf0; /* Go the other direction */ + } angle = -1 / angle; b1 = posy / 2 - (-angle) * posx / 2; b3 = (yo - posy / 2) - (-angle) * (xo - posx / 2); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc index 026aa309b02..feaba1a4aa8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc @@ -68,7 +68,9 @@ struct CyclesSolverState { : graph(graph), traversal_stack(BLI_stack_new(sizeof(StackEntry), "DEG detect cycles stack")), - num_cycles(0) { + num_cycles(0) + { + /* pass */ } ~CyclesSolverState() { BLI_stack_free(traversal_stack); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 8861ffc956a..3cafa29b894 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -378,7 +378,7 @@ void DepsgraphNodeBuilder::end_build() } } -void DepsgraphNodeBuilder::build_id(ID* id) { +void DepsgraphNodeBuilder::build_id(ID *id) { if (id == NULL) { return; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index f02a48e803e..8510687ebab 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1709,8 +1709,8 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) /* Init operation of object-level geometry evaluation. */ OperationKey geom_init_key(&object->id, DEG_NODE_TYPE_GEOMETRY, - DEG_OPCODE_PLACEHOLDER, - "Eval Init"); + DEG_OPCODE_PLACEHOLDER, + "Eval Init"); /* Get nodes for result of obdata's evaluation, and geometry evaluation * on object. */ @@ -1789,21 +1789,21 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) "Object Geometry UberEval"); } if (object->type == OB_MBALL) { - Object *mom = BKE_mball_basis_find(scene_, object); - ComponentKey mom_geom_key(&mom->id, DEG_NODE_TYPE_GEOMETRY); - /* motherball - mom depends on children! */ - if (mom == object) { - ComponentKey mom_transform_key(&mom->id, - DEG_NODE_TYPE_TRANSFORM); - add_relation(mom_transform_key, - mom_geom_key, - "Metaball Motherball Transform -> Geometry"); - } - else { - ComponentKey transform_key(&object->id, DEG_NODE_TYPE_TRANSFORM); - add_relation(geom_key, mom_geom_key, "Metaball Motherball"); - add_relation(transform_key, mom_geom_key, "Metaball Motherball"); - } + Object *mom = BKE_mball_basis_find(scene_, object); + ComponentKey mom_geom_key(&mom->id, DEG_NODE_TYPE_GEOMETRY); + /* motherball - mom depends on children! */ + if (mom == object) { + ComponentKey mom_transform_key(&mom->id, + DEG_NODE_TYPE_TRANSFORM); + add_relation(mom_transform_key, + mom_geom_key, + "Metaball Motherball Transform -> Geometry"); + } + else { + ComponentKey transform_key(&object->id, DEG_NODE_TYPE_TRANSFORM); + add_relation(geom_key, mom_geom_key, "Metaball Motherball"); + add_relation(transform_key, mom_geom_key, "Metaball Motherball"); + } } /* NOTE: This is compatibility code to support particle systems * @@ -1858,7 +1858,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) "Eval Done"); add_relation(obdata_geom_eval_key, obdata_geom_done_key, - "ObData Geom Eval Done"); + "ObData Geom Eval Done"); /* Type-specific links. */ const ID_Type id_type = GS(obdata->name); switch (id_type) { diff --git a/source/blender/draw/engines/workbench/shaders/workbench_cavity_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_cavity_frag.glsl index f6ddd54b7f7..38f55015877 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_cavity_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_cavity_frag.glsl @@ -68,4 +68,4 @@ void main() ssao_factors(depth, normal_viewport, position, screenco, cavity, edges); fragColor = vec4(cavity, edges, 0.0, 1.0); -}
\ No newline at end of file +} diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index caee998e427..aad4260241f 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -388,7 +388,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) psl->prepass_pass = DRW_pass_create("Prepass", state); psl->prepass_hair_pass = DRW_pass_create("Prepass", state); } - + { int state = DRW_STATE_WRITE_COLOR; psl->cavity_pass = DRW_pass_create("Cavity", state); @@ -565,11 +565,11 @@ static WORKBENCH_MaterialData *get_or_create_material_data( /* Solid */ workbench_material_update_data(wpd, ob, mat, &material_template); - material_template.object_id = OBJECT_ID_PASS_ENABLED(wpd)? engine_object_data->object_id: 1; + material_template.object_id = OBJECT_ID_PASS_ENABLED(wpd) ? engine_object_data->object_id : 1; material_template.drawtype = drawtype; material_template.ima = ima; uint hash = workbench_material_get_hash(&material_template); - + material = BLI_ghash_lookup(wpd->material_hash, SET_UINT_IN_POINTER(hash)); if (material == NULL) { material = MEM_mallocN(sizeof(WORKBENCH_MaterialData), __func__); diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 01e10bbefbe..13821e0e57e 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -180,7 +180,7 @@ static WORKBENCH_MaterialData *get_or_create_material_data( /* Solid */ workbench_material_update_data(wpd, ob, mat, &material_template); - material_template.object_id = OBJECT_ID_PASS_ENABLED(wpd)? engine_object_data->object_id: 1; + material_template.object_id = OBJECT_ID_PASS_ENABLED(wpd) ? engine_object_data->object_id : 1; material_template.drawtype = drawtype; material_template.ima = ima; uint hash = workbench_material_get_hash(&material_template); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index eadefc606b3..3188bc847a7 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2016,7 +2016,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB but->block->aspect *= 2.0f; } #endif - + const BIFIconID icon = (but->flag & UI_HAS_ICON) ? but->icon + but->iconadd : ICON_NONE; int icon_size_init = is_tool ? ICON_DEFAULT_HEIGHT_TOOLBAR : ICON_DEFAULT_HEIGHT; const float icon_size = icon_size_init / (but->block->aspect / UI_DPI_FAC); @@ -2040,13 +2040,13 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB } else if (ui_block_is_menu(but->block)) rect->xmin += 0.3f * U.widget_unit; - + widget_draw_icon(but, icon, alpha, rect, show_menu_icon); #ifdef USE_UI_TOOLBAR_HACK but->block->aspect = aspect_orig; #endif - + rect->xmin += icon_size; /* without this menu keybindings will overlap the arrow icon [#38083] */ if (show_menu_icon) { diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 3302f62955d..844e61966bb 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -642,7 +642,7 @@ static void rna_Particle_change_type(Main *bmain, Scene *UNUSED(scene), PointerR static void rna_Particle_change_physics_type(Main *bmain, Scene *scene, PointerRNA *ptr) { particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_PHYS); - + ParticleSettings *part = (ParticleSettings *)ptr->data; if (part->phystype == PART_PHYS_BOIDS && part->boids == NULL) { @@ -655,7 +655,7 @@ static void rna_Particle_change_physics_type(Main *bmain, Scene *scene, PointerR BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Separate)); BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Flock)); - ((BoidRule*)state->rules.first)->flag |= BOIDRULE_CURRENT; + ((BoidRule *)state->rules.first)->flag |= BOIDRULE_CURRENT; state->flag |= BOIDSTATE_CURRENT; BLI_addtail(&part->boids->states, state); diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index eee7f0c5561..0aafcf33202 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -149,7 +149,7 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps if (p >= psys->totpart) { ChildParticle *cpa = psys->child + (p - psys->totpart); - pa = psys->particles + (between? cpa->pa[0]: cpa->parent); + pa = psys->particles + (between ? cpa->pa[0] : cpa->parent); } else { pa = psys->particles + p; @@ -173,8 +173,8 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps /* TODO make randomization optional? */ randp = (int)(psys_frand(psys, 3578 + p) * totpart) % totpart; - minp = (int)(totpart * pimd->particle_offset) % (totpart+1); - maxp = (int)(totpart * (pimd->particle_offset + pimd->particle_amount)) % (totpart+1); + minp = (int)(totpart * pimd->particle_offset) % (totpart + 1); + maxp = (int)(totpart * (pimd->particle_offset + pimd->particle_amount)) % (totpart + 1); if (maxp > minp) { return randp < minp || randp >= maxp; @@ -340,7 +340,7 @@ static Mesh *applyModifier( for (p = part_start, p_skip = 0; p < part_end; p++) { float prev_dir[3]; float frame[4]; /* frame orientation quaternion */ - float p_random = psys_frand(psys, 77091 + 283*p); + float p_random = psys_frand(psys, 77091 + 283 * p); /* skip particle? */ if (particle_skip(pimd, psys, p)) @@ -404,7 +404,7 @@ static Mesh *applyModifier( pa = psys->particles + p; else { ChildParticle *cpa = psys->child + (p - psys->totpart); - pa = psys->particles + (between? cpa->pa[0]: cpa->parent); + pa = psys->particles + (between ? cpa->pa[0] : cpa->parent); } psys_mat_hair_to_global(sim.ob, sim.psmd->mesh_final, sim.psys->part->from, pa, hairmat); copy_m3_m4(mat, hairmat); @@ -412,7 +412,7 @@ static Mesh *applyModifier( mat3_to_quat(frame, mat); if (pimd->rotation > 0.0f || pimd->random_rotation > 0.0f) { - float angle = 2.0f*M_PI * (pimd->rotation + pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f)); + float angle = 2.0f * M_PI * (pimd->rotation + pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f)); float eul[3] = { 0.0f, 0.0f, angle }; float rot[4]; |