Cleanup: style
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -378,7 +378,7 @@ void DepsgraphNodeBuilder::end_build()
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphNodeBuilder::build_id(ID* id) {
|
||||
void DepsgraphNodeBuilder::build_id(ID *id) {
|
||||
if (id == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -68,4 +68,4 @@ void main()
|
||||
ssao_factors(depth, normal_viewport, position, screenco, cavity, edges);
|
||||
|
||||
fragColor = vec4(cavity, edges, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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__);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user