diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-09 01:35:37 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-09 02:13:43 +0300 |
commit | 21462565632b876ac4eadf2bd30573f2fda70c76 (patch) | |
tree | 483da4fc20c4c8cc7198abd6edd5f3a53aa90b91 /source/blender/blenkernel/intern/fluid.c | |
parent | 626c844105afc3b2455f5a1b87ac8a7839a7e0bf (diff) |
Cleanup: use ELEM macro
Diffstat (limited to 'source/blender/blenkernel/intern/fluid.c')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 6f2760e91a6..f85361e94ff 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1845,8 +1845,8 @@ static void sample_mesh(FluidFlowSettings *ffs, const float surface_distance = 1.732; nearest.dist_sq = surface_distance * surface_distance; /* find_nearest uses squared distance. */ - bool is_gas_flow = (ffs->type == FLUID_FLOW_TYPE_SMOKE || ffs->type == FLUID_FLOW_TYPE_FIRE || - ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE); + bool is_gas_flow = ELEM( + ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_FIRE, FLUID_FLOW_TYPE_SMOKEFIRE); /* Emission strength for gases will be computed below. * For liquids it's not needed. Just set to non zero value @@ -2035,8 +2035,7 @@ static void emit_from_mesh_task_cb(void *__restrict userdata, /* Compute emission only for flow objects that produce fluid (i.e. skip outflow objects). * Result in bb->influence. Also computes initial velocities. Result in bb->velocity. */ - if ((data->ffs->behavior == FLUID_FLOW_BEHAVIOR_GEOMETRY) || - (data->ffs->behavior == FLUID_FLOW_BEHAVIOR_INFLOW)) { + if (ELEM(data->ffs->behavior, FLUID_FLOW_BEHAVIOR_GEOMETRY, FLUID_FLOW_BEHAVIOR_INFLOW)) { sample_mesh(data->ffs, data->mvert, data->vert_normals, @@ -2697,8 +2696,8 @@ static bool escape_flowsobject(Object *flowobj, bool is_static = is_static_object(flowobj); bool liquid_flow = ffs->type == FLUID_FLOW_TYPE_LIQUID; - bool gas_flow = (ffs->type == FLUID_FLOW_TYPE_SMOKE || ffs->type == FLUID_FLOW_TYPE_FIRE || - ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE); + bool gas_flow = ELEM( + ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_FIRE, FLUID_FLOW_TYPE_SMOKEFIRE); bool is_geometry = (ffs->behavior == FLUID_FLOW_BEHAVIOR_GEOMETRY); bool liquid_domain = fds->type == FLUID_DOMAIN_TYPE_LIQUID; |